-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YouTube] Randomly slow youtube download speed #29326
Comments
I'm having exactly the same issue. |
我也注意到了,我一直是配合aria2使用的,只是也和你一样的问题,希望更多人提供有帮助的信息 |
Same issue, i.e. also noticing downloads are much slower than "normal", even short videos taking extremely long times. |
Same issue, restarting the download keeps it working fine for a while but then it happens again. I would think throttling perhaps, but I have Starlink and they sure as shit don't throttle. Perhaps it's something on youtube's end? edit: Curiously, I don't think it happens after I switched on a vpn to test it... |
same here, this is driving me out of my mind |
Same issue here. When this happens, speed is like in OP's case around 77kb/s From the 2018 ticket #15271 I found that |
This comment has been minimized.
This comment has been minimized.
Are you saying that youtube-dl will be obsolete with youtube.com because of this update when it spreads to all videos? Honestly I have my doubts. I think it's more of a bug or maybe related to this update, but I imagine (and hope) that the contributors of youtube-dl will be able to find a solution, as they did in the last 15 years of existence. |
@nao20010128nao What I found suspicious is the download speed - for me - always being around 77kb/s if this happens. This is way to slow even for playback, and it happens independently of the format. f137 takes forever like this. If this was purely a problem on youtube's side, I'd expect to hit this problem in the browser too at times, but I never experience buffering. |
The temporal inaccurate workaround which can help in dealing with automatic downloads: def speed_check(s):
speed = s.get('speed')
ready = s.get('downloaded_bytes', 0)
total = s.get('total_bytes', 0)
if speed and speed <= 77 * 1024 and ready >= total * 0.1:
# if the speed is less than 77 kb/s and we have
# at least one tenths of the video downloaded
raise DownloadError('Abnormal downloading speed drop.')
ydl.add_progress_hook(speed_check) |
would you then retry the video until it's fast? |
@nikooo777 I have some kind of proxy in front of the Python downloader and it decides about retrying or not, so no need in doing it here, though it really makes sense for someone. |
I can confirm I am also experiencing this, since July 14th. I am either noticing ~77kb/s, or ~50kb/s. The throttling is consistent across all of my servers and seems to only occur if I download a lot of videos; making me think it is an intentional form of throttling on youtube's side. I have increased the timeouts and reduced the frequency of my throttling, and I am noticing far less throttles. If you are hitting this, I recommend you increase your timeouts. |
@danny-wu In my case, this happens even during the first download on my private internet connection. Also noticed on a linux server. |
I think YT may be throttling for profit reasons and/or they may be having technical difficulties and/or they are upgrading and/or censorship reasons. |
From what I understand, if youtube is throttling downloads aria2c might help (https://wiki.archlinux.org/title/Youtube-dl#Faster_downloads)? I have absolutely no experience with it (if someone does and could link something that would be greatly appreciated) but I think it might be worth a try if someone here does have it set up. |
yep ! same here ! it works flawlessly on macOS but the build on Ubuntu gets slow randomly, also around 76/77kbps... |
hmm is anyone experiencing this issue NOT on ubuntu?
…On Tue, 22 Jun 2021, 1:03 am petaire92, ***@***.***> wrote:
yep ! same here ! it works flawlessly on macOS but the build on Ubuntu
gets slow randomly, also around 76/77kbps...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29326 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7CVVGTZMZWWOKP5T3IU6LTT5IDDANCNFSM463R5FEQ>
.
--
**
** <https://www.canva.com/>Empowering the world to design
Share accurate
information on COVID-19 and spread messages of support to your community.
Here are some resources
<https://about.canva.com/coronavirus-awareness-collection/?utm_medium=pr&utm_source=news&utm_campaign=covid19_templates>
that can help.
<https://twitter.com/canva> <https://facebook.com/canva>
<https://au.linkedin.com/company/canva> <https://twitter.com/canva>
<https://facebook.com/canva> <https://au.linkedin.com/company/canva>
<https://instagram.com/canva>
|
Win10 x64 here. |
Nope, macOS 11 here and I have the same issue! |
Well I have a big sur build that works perfectly with multiple dl per days and works flawlessly. But maybe it’s because those are newly added videos ? |
Seems so. I don't notice buffering or quality loss on new videos. Buffering/throttling on several months old videos only. Maybe they introduced some new encoding codec and are reencoding old videos and new videos are already good? Maybe so. |
Seems like the Same Problem here on a Debian 10 Machine with youtube-dl. I can download a few Video normal and then it gets so slow that there is no noticable Network Activity. |
Same issue here on Linux. |
I have a similar problem, I thought that youtube was blocking me by ip, so I started uploading via vpn, but the problem repeats |
There were helpful comments on this ticket from a user with initials A.W.; unfortunately it looks like they got deleted. I saw them because I have email notifications. Has anyone made further progress on the query parameter investigation? |
This is incredibly helpful. wow. Thanks.
Deliberate sabotage of YouTube-dl by Google. Sucks to see this continue.
Please, Googlers, you are reading this. We are just trying to download a
small fraction of YouTube videos for offline playback, personal use. Please
don't sabotage us.
…On Tue, 22 Jun 2021, 11:29 pm Aaron Wojnowski, ***@***.***> wrote:
I have the solution for this issue. I do not have the bandwidth to
actually implement it in the source, but this should be more than enough
information to do so.
The issue is that YouTube is modifying the n query parameter on the video
playback URLs in a very similar fashion as the signature cipher. There's a
pure function in the player JavaScript which takes the n parameter as
input and outputs an n parameter which is not subject to throttling.
As an example, let's look at
https://www.youtube.com/s/player/52dacbe2/player_ias.vflset/et_EE/base.js.
The code in question which modifies n is as follows:
a.C&&(b=a.get("n"))&&(b=Dea(b),a.set("n",b))}};
In this case, Dea is the function we are looking for:
function(a){var b=a.split(""),c=[-704589781,1347684200,618483978,1439350859,null,63715372,function(d){d.reverse()},
159924259,-312652635,function(d,e){for(e=(e%d.length+d.length)%d.length;e--;)d.unshift(d.pop())},
-1208266546,function(d,e){d.push(e)},
-2143203774,-103233324,b,function(d,e){e=(e%d.length+d.length)%d.length;d.splice(0,1,d.splice(e,1,d[0])[0])},
837025862,1654738381,1184416163,1983454500,b,-200631744,1130073900,null,2047141935,-337180565,1654738381,1913297860,-399114812,b,714887321,function(d,e){for(var
f=64,h=[];++f-h.length-32;){switch(f){case 58:f-=14;case 91:case 92:case
93:continue;case 123:f=47;case 94:case 95:case 96:continue;case
46:f=95}h.push(String.fromCharCode(f))}d.forEach(function(l,m,n){this.push(n[m]=h[(h.indexOf(l)-h.indexOf(this[m])+m-32+f--)%h.length])},e.split(""))},
626129880,"pop",1331847507,-103233324,2092257394,function(d,e){for(e=(e%d.length+d.length)%d.length;e--;)d.unshift(d.pop())},
669147323,1184416163,-216051470,193134360,null,2045900346,1675782975,-1997658115,function(d,e){e=(e%d.length+d.length)%d.length;var
f=d[0];d[0]=d[e];d[e]=f},
1675782975,161770346,function(d,e){e=(e%d.length+d.length)%d.length;d.splice(-e).reverse().forEach(function(f){d.unshift(f)})},
function(d){for(var e=d.length;e;)d.push(d.splice(--e,1)[0])},
1454215184,-2123929123];c[4]=c;c[23]=c;c[42]=c;try{c6,c6,c6,c43,c30,c43,c
25,c52,c43,c40,c21,c0,c0,c21,c37,c16,c51,c10,c7,c7,c6,c2,c38,c3,c3,c3,
c49,c17,c28,c5,c46,c37,c37,c41,c41,c16,c12,c14,c52,c39,c22}catch(d){return"enhanced_except_AAAAAAAAAAE_"+a}return
b.join("")};
This *does* change with different player versions, so youtube-dl will
need to extract this for every video that it fetches and then modify the n
parameter as such.
Hope this is helpful.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29326 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7CVVBZOS3SEPT7WXBSA4TTUCF5HANCNFSM463R5FEQ>
.
--
**
** <https://www.canva.com/>Empowering the world to design
Share accurate
information on COVID-19 and spread messages of support to your community.
Here are some resources
<https://about.canva.com/coronavirus-awareness-collection/?utm_medium=pr&utm_source=news&utm_campaign=covid19_templates>
that can help.
<https://twitter.com/canva> <https://facebook.com/canva>
<https://au.linkedin.com/company/canva> <https://twitter.com/canva>
<https://facebook.com/canva> <https://au.linkedin.com/company/canva>
<https://instagram.com/canva>
|
youtube-dl is larely dormant, with only infrequent updates (https://news.ycombinator.com/item?id=29590501). In particular, youtube-dl *still* hasn’t fixed a six month old bug that causes YouTube downloads to be dramatically throttled, rendering it largely useless (ytdl-org/youtube-dl#29326). yt-dlp is youtube-dl’s spritual successor and appears better maintained at the moment (ytdl-org/youtube-dl#30317).
ytdl-org/youtube-dl#29326 Signed-off-by: Kros Dai <kros@dai.sg>
macOS here, on version 2021.12.17, and YouTube downloads are extremely slow, <100kbps |
Why is this closed? This is super obviously still a problem. |
Here's my fix: #28859 (comment) |
It was fixed long time ago. Just use the If you still have issue using the |
Well, you should really have read my fix, because it is not a diff to this project. It is a self-contained example that demonstrates the method, which is quite different from the one youtube-dl actually adopted. |
And I will necro the hell out of any "closed" issue, for as long as it isn't actually closed. All I saw was one failed PR. I think it was fair to me to assume, then, that this issue was marked as closed spuriously. Now, I see that is not the case, but I stand by my methods. Anyway, thanks for integrating a fix. You are too late, though. I already made my own client, and I like it better, lololoлололо:trollface:لُلُلُلُلُلُلُلُلٌ. I can use it to grep youtube comments and search results. |
Problem happened again, with yt-dlp, for youtube and twitch. Does it happen for someone else? |
|
Fixes ytdl-org#29326, closes ytdl-org#29790, closes ytdl-org#30004, closes ytdl-org#30024, closes ytdl-org#30052, closes ytdl-org#30088, closes ytdl-org#30097, closes ytdl-org#30102, closes ytdl-org#30109, closes ytdl-org#30119, closes ytdl-org#30125, closes ytdl-org#30128, closes ytdl-org#30162, closes ytdl-org#30173, closes ytdl-org#30186, closes ytdl-org#30192, closes ytdl-org#30221, closes ytdl-org#30239, closes ytdl-org#30539, closes ytdl-org#30552.
Checklist
Verbose log
While the download was in progress, I ran the exact same command in another terminal, another folder, and the download was completed in a few seconds:
Description
Hello,
Important: The problem is random, maybe 1 chance on 8 to produce it. You have to download several videos in a row (about 10) to notice it.
Since a few weeks, randomly a youtube video can be slowed down to 48 Kio/s, so it takes 5-10 minutes to download a short video of 5 minutes instead of 4, 5 seconds, often the download does not succeed and stops after a few minutes.
This happens on several servers, several internet providers as well as with my private connection.
I even managed to launch a second download in parallel when the first one was taking time, the second one finished in 1 seconds, the first one in 5 minutes and was interrupted before the end. Same video, same connection, same command. (tested only with ipv4 because I don't have ipv6 on my servers or with my internet connection).
Attached is an extraction of the results with --dump-pages.
ko.txt
ok.txt
The text was updated successfully, but these errors were encountered: