Skip to content
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

Some youtube songs download speed varies often -- takes too long #30065

Closed
5 of 6 tasks
gitreset-hard opened this issue Oct 6, 2021 · 14 comments
Closed
5 of 6 tasks

Some youtube songs download speed varies often -- takes too long #30065

gitreset-hard opened this issue Oct 6, 2021 · 14 comments

Comments

@gitreset-hard
Copy link

gitreset-hard commented Oct 6, 2021

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.06.06
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

10.11.101.20 - - [06/Oct/2021 21:43:01] "GET /files/load_by?weblink=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrGN3nTC9Stg&folder=live_analysis%2Fmusimatch%2Fweblink%2F531d02e5-554f-44c7-8863-378993cdb659&bucket=msm-s3-redacted-eu-west-1-prd&start=0&stop=1500 HTTP/1.1" 200 -
[youtube] rGN3nTC9Stg: Downloading webpage
Download options: {'format': '140', 'outtmpl': '1633556601845.m4a', 'noplaylist': True, 'noprogress': True, 'cachedir': False}
[youtube] Downloading just video rGN3nTC9Stg because of --no-playlist
[youtube] rGN3nTC9Stg: Downloading player d33d444d
[download] Destination: 1633556601845.m4a
[download] Download completed
[ffmpeg] Correcting container in "1633556601845.m4a"
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
  configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1633556601845.m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.76.100
  Duration: 00:04:33.49, start: 0.000000, bitrate: 127 kb/s
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Output #0, ipod, to 'cut_1633556601845.m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.76.100
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    
size=    4253kB time=00:04:33.46 bitrate= 127.4kbits/s speed=1.06e+04x    
video:0kB audio:4193kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.418841% ```



---------------

## Description


We are lately running into issues with downloading youtube songs that have previously worked fine

Tracks are taking too long to download at random. Sometimes it succeeds, but can take a minute randomly.
This is the log of where the hangup is: (full output below snippet)

size=    4253kB time=00:04:33.46 bitrate= 127.4kbits/s **speed=1.06e+04x**    

does something look off in the logs?

FWIW we've been doing it like this for a long time and it worked fine. Updated the version as well today and this is happening a lot at random.

@dirkf
Copy link
Contributor

dirkf commented Oct 6, 2021

Duplicate of #29326.

@gitreset-hard
Copy link
Author

Duplicate of #29326.

@dirkf ah thanks for that. A possible solution to manipulate a var is mentioned but nothing concrete to update the library.

@gitreset-hard
Copy link
Author

I have an alternative tool, can download that file in less than a second:

PS C:\> Measure-Command { youtube -v -1 -a 140 rGN3nTC9Stg }
TotalSeconds      : 0.8858769

https://github.com/89z/mech

how does your downloader get past the issue of random throttling?

@gitreset-hard
Copy link
Author

how does your downloader get past the issue of random throttling?

Download in chunks:

https://github.com/89z/mech/blob/v1.33.6/youtube/format.go#L48-L49

Not sure why so many people keep having this issue, Ive had the same code for 4 month, no trouble with slow speed at all.

I believe we've been using it for years without issue but suddenly it's been breaking a lot. So to clarify, you are chunking the video/timestamp into 10million (couldn't find what the underscores mean in 10_000_000) and then downloading them ? I imagine it still downloads as 1 file?

@gitreset-hard
Copy link
Author

how does your downloader get past the issue of random throttling?

Download in chunks:

https://github.com/89z/mech/blob/v1.33.6/youtube/format.go#L48-L49

Not sure why so many people keep having this issue, Ive had the same code for 4 month, no trouble with slow speed at all.

here someone said chunking didn't mitigate the issue in this case. Maybe it is an issue for people who frequently download vs occasional

#29326 (comment)

@gitreset-hard
Copy link
Author

gitreset-hard commented Oct 7, 2021

@89z Thanks, I will bring it up. It seems like we are getting throttled

here's a screenshot from the docker container showing the speed https://i.imgur.com/UylAO01.png

as for chunking, it did nothing:

/app/Download # youtube-dl -f 140 http://www.youtube.com/watch?v=4-BtZWGaPNY --http-chunk-size 10M
[youtube] 4-BtZWGaPNY: Downloading webpage
[download] Resuming download at byte 169985
[download] Destination: NAIMA - Let Me See You [NCS Release]-4-BtZWGaPNY.m4a
[download]  36.1% of 2.47MiB at 48.44KiB/s ETA 00:33

@gitreset-hard
Copy link
Author

gitreset-hard commented Oct 7, 2021 via email

@crumhirnd
Copy link

@84436
Copy link

84436 commented Oct 8, 2021

I'm on 2021.06.06 and I also experience throttling. My network is capable of 4K@60 playback perfectly.
Here's the 4 videos I've tested:
https://youtu.be/o-AeEM1Nk0c
https://youtu.be/oT3mCybbhf0
https://youtu.be/kJQP7kiw5Fk
https://youtu.be/LXb3EKWsInQ

Screenshot 2021-10-08 103541

FYI yt-video is an alias for

youtube-dl -o "D:/Downloads/YouTube/%%(uploader)s/%%(title)s.%%(ext)s" -f bestvideo+bestaudio --write-sub --sub-lang en-US,en-GB,en --embed-subs

@gitreset-hard
Copy link
Author

gitreset-hard commented Oct 8, 2021

@84436 @crumhirnd yeah this has been a common issue it seems. I’m seeing threads a few years old as well

Today I tried chunking, running locally (outside the AWS EC2 instance it runs normally) and throttled all the time.

I’m trying to get @89z script as a temporary workaround but getting stuck in it

@fastily
Copy link

fastily commented Oct 8, 2021

youtube-dl isn't being actively maintained. This is a fixed issue in the spiritual successor to youtube-dl, yt-dlp

@84436
Copy link

84436 commented Oct 8, 2021

@fastily thanks for the suggestion; it works perfectly as a drop-in replacement.

image

Speaking of being inactive, I've just noticed right now there are 800+ PRs pending on this repo...

@rautamiekka
Copy link
Contributor

works perfectly as a drop-in replacement.

Near drop-in replacement but once you've adjusted your commands/config it's indeed a drop-in replacement.

@dirkf
Copy link
Contributor

dirkf commented Jan 31, 2022

Closed in af9e725.

@dirkf dirkf closed this as completed Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants