alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
6.29k stars 397 forks source link

Multi-download : Possible ? #314

Closed lenuxfrance closed 1 year ago

lenuxfrance commented 1 year ago

Hello and thank you for this excellent docker I would like to know if it is possible to add a simultaneous multi-download function? Thanks

alexta69 commented 1 year ago

You can configure yt-dlp to perform parallel downloads via the concurrent_fragment_downloads option, specifying the number of desired threads. You can put it in your YTDL_OPTIONS. It won't download multiple videos in parallel, but it will download each video in parallel fragments, which is even better.

p0358 commented 10 months ago

I don't really see how it's better, especially with many small videos (where extra time is lost on initial metadata extraction for every video) and the sites throttling per-video connections too. Tartube has such an option enabled by default (I think defaults to max 8 videos at once)

PikuZheng commented 10 months ago

Is it possible to use a third party like aria2?

p0358 commented 10 months ago

I mean aria2 as a standalone tool might be able to do something like this, but I feel like trying to integrate that into the UI would be harder than just having metube spawn multiple yt-dlp processes according to some settings instead of just one at once

PikuZheng commented 10 months ago

metube includes aira2 and just set options YTDL_OPTIONS={"external_downloader":"aria2c"}

p0358 commented 10 months ago

I don't think that'd work, YTDL_OPTIONS is just what's passed to yt-dlp according to the docs. And yt-dlp, as far as I know, can and would only get invoked in a single instance for single particular video at once only still...

Perhaps something like https://github.com/swolegoal/squid-dl could be used if integrated into metube, but idk if that wouldn't make it harder than implementing multi-tasking directly (since stuff like download progress reports would need to be made, which might be harder to extract from a wrapper)

PikuZheng commented 10 months ago

i see. you want multi tasking but threads