'low bandwith usage on golang exec.Command("").Run()
I am building a golang app which uses youtube-dl to download some files from mixcloud.
I recognized that when I execute youtube-dl https://www.mixcloud.com/FatboySlim/
in my terminal I receive download speeds with an average of 10 MiB/s.
When I execute the same command in golang I only receive download speeds with an average of 2 MiB/s.
Is there any reason why it is so slow? Any idea how to fix it?
Reproduce as follows:
In Bash/Shell
bash youtube-dl https://www.mixcloud.com/FatboySlim/
package main
import (
"log"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("youtube-dl", "https://www.mixcloud.com/FatboySlim/")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|