Fix for 60kb/s throttled downloads (2021-Oct) : r/youtubedl Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/youtubedl icon
r/youtubedl icon
Go to youtubedl
r/youtubedl
A banner for the subreddit

youtube-dl and the yt-dlp fork are a command-line program to download videos from YouTube.com, as well as many other sites. We are a community of enthusiasts helping each other with problems and usability issues.


Members Online

Fix for 60kb/s throttled downloads (2021-Oct)

I'm posting this one more time, with a thread title that hopefully enables people to find it.

apt-get install aria2

youtube-dl --external-downloader=aria2c --external-downloader-args '--min-split-size=1M --max-connection-per-server=16 --max-concurrent-downloads=16 --split=16' $URL

This makes downloads about 16 times as fast, or about 1MB/s when throttled.

Archived post. New comments cannot be posted and votes cannot be cast.
Share
Sort by:
Best
Open comment sort options
u/JosephSaber945 avatar

just use yt-dlp right away youtube-dl is dead, recently I've been encountering so many issues.

u/Cardinal_System avatar

yt-dlp

shit this looks like the way to go 👀

u/luksfuks avatar
Edited

yt-dlp doesn't help if you're permanently throttled.

EDIT - see for example this unresolved throttle issue: https://github.com/yt-dlp/yt-dlp/issues/985

yt-dlp doesn't help if you're permanently throttled. EDIT - see for example this unresolved throttle issue: https://github.com/yt-dlp/yt-dlp/issues/985

This is kinda disingenuous. That issue is reporting a one-off (no one else has given evidence of being able to reproduce this) throttling to 1MBps, not the 80KBps one that most people are reporting with youtube-dl. And, even your method limits you to 1MBps.

I am not saying that yt-dlp fixes throttling for ALL videos, but there is no such thing as "permamently throttled" as far as we know. It is just that our method doesn't work for some specific videos

More replies

☝️☝️☝️

This is the real solution folks

Thank you for this.

More replies
u/japones1232 avatar
Edited

I use this command, My speed is 30 Mbps but there is a problem, the video download is super fast, it uses all my bandwidth and that is excellent, but when downloading audio the throttling comes and it downloads the audio at 200 or 100 kbps, that is to say, it took longer to download the audio than the video.

This happens with youtubedl and youtubedlp

youtube-dl.exe -f bestvideo+bestaudio --external-downloader aria2c.exe --external-downloader-args "-c -j 5 -s 5 -x 5 -k 1M" -ciw URL

--min-split-size is -k

--max-connection-per-server is -x

--max-concurrent-downloads is -j

--split is -s

u/luksfuks Do you know how I can solve it?

u/luksfuks avatar

There are two fundamentially different ways to approach your question. One is to magically make the throttle disappear, and the other one is to download acceptably fast despite being throttled.

Downloading with aria2 aims for the latter. It downloads multiple pieces of the stream concurrently. Unfortunately it also comes with some arbitrary limitations that are not very helpful in the context of youtubedl.

Most prominently, --min-split-size must be 1M or higher. Files smaller than 2x min-split-size will be downloaded through a single connection, thus severly affected by throttling. BTW you seem to use 5M which is worse, you should lower it to the minimum of 1M.

However, a smaller value would be even better. For example 32K or 64K. You can compile a custom version of aria2 to allow such small values. I haven't tried, but I think you need to modify lines 406-407 of aria2/src/OptionHandlerFactory.cc which read

OptionHandler* op(new UnitNumberOptionHandler(
    PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "20M", 1_m, 1_g, 'k'));

and I think changing 1_m to -1 would allow you to use small values like 32K.

Another unfortunate limitation is that youtubedl seems to dispatch only 1 download at a time to the external tool. Therefore, audio will always be downloaded after video, rather than concurrently with video. You'd need to patch youtubedl to change this. I don't know if it's easy or not. Basically you would need to dispatch the downloads in the background, track how many outstanding threads you have still running, and wait for them to finish before merging the final file. Most of this can already be done with simple wrapper scripts for the downloader tool, the missing piece is to make youtubedl call an external cleanup script before doing the merge.

Don't forget that there's also the option of avoiding the throttle alltogether. Some people think it's triggered by TLS connection fingerprinting, others say it's related to the (lack of) watchtime API requests. If you're knowledgable, you should invest a few hours or a day and help finding a solution that works for everybody.

More replies

WORKS! thank-you! Turned a 2 hour throttled download into a 12 minute one!

Question; Can I paste the above command into terminal, then delete $URL and add the actual HTTP or HTTPS URL? Will that work???

u/luksfuks avatar

Yes, $URL is just a placeholder for the actual URL.

More replies
[deleted]
[deleted]

Comment removed by moderator

this is not the way to ask for help. make a new post, and include a better description of what you've tried, don't hijack another post.

u/administrator_224 avatar

Dunno why but I am unable to make post.

At first I tried to that only

but the Post button is grey

the button is grey until a title is filled in

u/administrator_224 avatar
More replies
More replies
More replies
More replies

I was skeptical about this at first, but this does actually work :o

assuming the file is large enough to make use of all the threads, ofc

u/JumpyPin2154 avatar

This is a solution that works.

It gave me an error youtube-dl: error: no such option: --max-connection-per-server.

Resolved it by replacing the ' with ".