ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.97k stars 10.01k forks source link

youtube-dl downloading from YouTube is very slow?! #15275

Closed zannix closed 6 years ago

zannix commented 6 years ago

This is essentially a re-opening of an existing thread: https://github.com/rg3/youtube-dl/issues/15271

I believe the issue is real, and it is not being addressed.

In short, I urge everyone interested to run:

youtube-dl -f 140 http://www.youtube.com/watch?v=4-BtZWGaPNY

... and you will see that it takes 10 times as much as usual to download the video in any format.

Please do not close the thread and let's try to solve this.

yan12125 commented 6 years ago

Sorry, I don't think it's possible to solve the issue at the client side. It's most likely a server side issue.

ghost commented 6 years ago

Had the same issue, "fixed" by restarting and resuming the download. Seems like a bug

➜ youtube-dl -f 140 http://www.youtube.com/watch\?v\=4-BtZWGaPNY        
[youtube] 4-BtZWGaPNY: Downloading webpage
[youtube] 4-BtZWGaPNY: Downloading video info webpage
[youtube] 4-BtZWGaPNY: Extracting video information
[download] Destination: NAIMA - Let Me See You [NCS Release]-4-BtZWGaPNY.m4a
[download]  41.2% of 2.42MiB at 129.76KiB/s ETA 00:11^C
ERROR: Interrupted by user

/tmp took 13s 
➜ youtube-dl -f 140 http://www.youtube.com/watch\?v\=4-BtZWGaPNY
[youtube] 4-BtZWGaPNY: Downloading webpage
[youtube] 4-BtZWGaPNY: Downloading video info webpage
[youtube] 4-BtZWGaPNY: Extracting video information
[download] Resuming download at byte 1047552
[download] Destination: NAIMA - Let Me See You [NCS Release]-4-BtZWGaPNY.m4a
[download] 100% of 2.42MiB in 00:00
[ffmpeg] Correcting container in "NAIMA - Let Me See You [NCS Release]-4-BtZWGaPNY.m4a"

/tmp took 3s 
➜ 

EDIT: it seems like only low (<360p) quality involved

antdude commented 6 years ago

Yes, I am having the same problem since yesterday morning PST. I wonder if Google is throttling. I notice my downloads start very fast and the slow. For an example with a Verizon FIOS pipe (also seen on Time Warner/Spectrum Cable's pipe):

$ youtube-dl https://www.youtube.com/watch?v=sC_qXF5UOtg [youtube] sC_qXF5UOtg: Downloading webpage [youtube] sC_qXF5UOtg: Downloading video info webpage [youtube] sC_qXF5UOtg: Extracting video information WARNING: Requested formats are incompatible for merge and will be merged into mkv. [download] Destination: DO TEENS KNOW 2000s TEEN MOVIES (REACT - Do They Know It)-sC_qXF5UOtg.f137.mp4 [download] 83.8% of 135.64MiB at 611.51KiB/s ETA 00:36

ghost commented 6 years ago

I agree with @antdude

➜ youtube-dl -f "(mp4)[height=720]" https://www.youtube.com/watch\?v\=sC_qXF5UOtg
[youtube] sC_qXF5UOtg: Downloading webpage
[youtube] sC_qXF5UOtg: Downloading video info webpage
[youtube] sC_qXF5UOtg: Extracting video information
[download] Destination: DO TEENS KNOW 2000s TEEN MOVIES (REACT - Do They Know It)-sC_qXF5UOtg.mp4
[download] 100% of 43.66MiB in 00:08

/tmp took 10s 
➜ youtube-dl -f "(mp4)[height=144]" https://www.youtube.com/watch\?v\=sC_qXF5UOtg
[youtube] sC_qXF5UOtg: Downloading webpage
[youtube] sC_qXF5UOtg: Downloading video info webpage
[youtube] sC_qXF5UOtg: Extracting video information
[download] Destination: DO TEENS KNOW 2000s TEEN MOVIES (REACT - Do They Know It)-sC_qXF5UOtg.mp4
[download] 100% of 3.07MiB in 00:49

/tmp took 51s 

With download restarting:

➜ youtube-dl -f "(mp4)[height=144]" https://www.youtube.com/watch\?v\=sC_qXF5UOtg            
[youtube] sC_qXF5UOtg: Downloading webpage
[youtube] sC_qXF5UOtg: Downloading video info webpage
[youtube] sC_qXF5UOtg: Extracting video information
[download] Destination: DO TEENS KNOW 2000s TEEN MOVIES (REACT - Do They Know It)-sC_qXF5UOtg.mp4
[download]  32.5% of 3.07MiB at 194.26KiB/s ETA 00:10^C
ERROR: Interrupted by user

/tmp took 8s 
➜ youtube-dl -f "(mp4)[height=144]" https://www.youtube.com/watch\?v\=sC_qXF5UOtg
[youtube] sC_qXF5UOtg: Downloading webpage
[youtube] sC_qXF5UOtg: Downloading video info webpage
[youtube] sC_qXF5UOtg: Extracting video information
[download] Resuming download at byte 1047552
[download] Destination: DO TEENS KNOW 2000s TEEN MOVIES (REACT - Do They Know It)-sC_qXF5UOtg.mp4
[download] 100% of 3.07MiB in 00:00

/tmp took 2s 
farazpartoei commented 6 years ago

I have interrupted and restart youtube-dl proc multiple times and speed improved maybe we can put it in a script which calls youtube-dl and waits 3 seconds and restarts it again till download finishes that's all I know and guess

zannix commented 6 years ago

It seems to be downloading at high speed in the first few moments, after which it throttles down significantly. Because you can re-download multiple times, and youtube-dl will just resume where it left off (again with high speed initially), it can download a piece faster.

But this is a very ugly workaround, I wonder if there's anything that can be done about it inside the actual library.

farazpartoei commented 6 years ago

@zannix agreed it's a dirty solution

by the way are you guys are sure that this restriction comes from Google or it might be on our ISP/data center/hosting etc. i have raised a ticket for datacenter which takes care of my server anyway

antdude commented 6 years ago

Resuming my download is the same problem. Fast and then slow. I am pretty sure Google is throttling us downloaders. Streaming doesn't need to download fast all the way. :/ I think Google knows we're downloading. :(

amit177 commented 6 years ago

youtube-dl -v --format bestaudio <url> Downloads at 100 KiB/s and youtube-dl -v --format best <url> Downloads at 10-20 MiB/s

that can't be client side... that's a youtube/youtube-dl problem

yan12125 commented 6 years ago

@AmiT177: it's common that YouTube discriminate different formats. Sometimes a format is slower than others, and sometimes a format doesn't work at all (#3721).

Restarting downloading automatically is a feasible solution. Please move on to #6923 for further discussions and #11476 for a possible solution.