Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Multi-Threaded downloading for playlists #350
Comments
|
This technique is used by desktop apps and is very useful in increasing download speed. I agree that 50k/s is way too slow. |
|
I agree that this is essential - it is the only issue I have with the youtube-dl library but its a big issue. multi-threaded dowloading and the resulting increase in speed is a dire necessity. |
|
Well there might be other reasons you're only getting 50k/s. It could be an issue with your ISP or the site. All that being said I too would love to see concurrent or multi threaded downloads. Sent via Hubroid |
|
It's actually Youtube slowing it down after the first 30% have been cached. I'm running this on a box with dedicated 200MB/s internet connection. |
|
Yes, it is youtube and yes, PLEASE add multithreaded downloading. we promote a desktop app downloading youtube apps and multithreading is crucial for use experience. we need to be able to offer the same speed for online conversions... thanks |
|
any chance this will be going somewhere? Are we the only ones annoyed by youtube throttling our downloads? thanks! |
|
Hi! use external downloaders (like wget, axel) and get full speed. :) |
|
Wonderful idea. I've just implemented Axel and get 15MB/s now instead of 200k/s. Very nice indeed. Thanks so much for pointing me this way. The only thing I don't like is that did I not think of this myself??!! Seems so easy. |
|
By the way, wget does not make sense as it is single threaded, too and gets the same throttling as youtube-dl.py |
|
I tried many options and here is the best that I came up with - use aria2. The
|
|
Let me write some summary. Here are several levels to implement threaded downloading in youtube-dl:
Only the last case works with external downloaders like aria2c or axel. For the first three kinds, more codes are necessary. |
|
Multi-Threaded postproc for playlists Was tempted to open another issue for it, but this is too similar (edit: as suggested, I put this in a separate issue #12215). I'm fine with single threaded downloads (multi threaded downloads introduce the possibility of getting your IP banned), but I'd like to see the postproc done in separate thread(s) (up to N threads, N being the number of CPU cores). As soon as a download is finished, the postproc job should be dispatched and the next download should start immediately. But if all N cores are doing postproc, wait for one to finish before downloading another playlist item. If the machine has only 1 core then the the behavior is exactly the same as it already is. On my setup postproc is the bottleneck, not bandwidth. Postproc benefits much more from mult-threading, whereas downloading only benefits from multi-threading if the server is throttling you (which implies they don't want you to use multiple connections simultaneously, and might ban you if you do). |
|
@d3fault: Thanks for writing this. Technically, postprocessing and downloading are implemented in different modules, it's better to have an separate issue. |
|
I wrote a multithreaded youtube-dl GUI. It basically just wraps the youtube-dl process and calls it for as many links as you set. The playlist portion does not run multithreaded however - before I wrapped youtube-dl I wrote the code to pull the links automatically, but since youtube-dl already handled it in a single thread, I left it alone. You could use it to download multiple playlists at a time though. One thing I've done for personal use is inject some javascript in the youtube playlist browser that just pulls the links into a text box at the bottom. You end up with a list of links and you can just paste them in and watch the multithreaded magic go. You can see it here https://www.youtube.com/watch?v=ihEH4DuTcTg |
|
Will this ever be put in the main program? |
|
Hey Guys, any plans to add multithreaded HLS downloading feature? |
|
@singhpratyush Is it possible to modify your command to extract audio? In particular, I want to extract audio-- I usually run |
|
@crypdick: Yes, it would work fine. You can also do postprocessing on the audio if you want, e.g. |
|
my sh snippet ytall() {
special_o='%(upload_date)s__%(title)s-%(id)s.%(ext)s'
default_threads=3
if [[ -z $1 ]]; then
echo "ytall [channel_url/playlist] [threads] [special -o ${special_o}]"
return
fi
if [[ -n $3 ]]; then
youtube-dl -j --flat-playlist $1 | jq -r '.url' | parallel -j $2 --progress youtube-dl -i -o \'$special_o\' --
elif [[ -n $2 ]]; then
youtube-dl -j --flat-playlist $1 | jq -r '.url' | parallel -j $2 --progress youtube-dl -i --
else
youtube-dl -j --flat-playlist $1 | jq -r '.url' | parallel -j $default_threads --progress youtube-dl -i --
fi
} |
|
@oltodosel that's a good snippet, but there are 2 things I notice right away:
|
|
There are playlists for which the -g option returns links that start with manifest.googlevideo.com, and if such a link is opened in a browser it will download a few hundred KB file. Is there a solution for cases like that? |
When downloading playlists youtube-dl could use multiple connections to download videos at the same time, right now my dl speed averages at 50k/s, and the full playlist is about 15G (defcon19).
I've been running 4 terminals with --playlist-start=N so far, and spaced them out.