[Feature Request] Abort/restart download if speed falls too low for too long (to bypass throttling)
See original GitHub issueFor the past couple of weeks, I’ve been experiencing what I can only assume is YouTube’s alternative to the dreaded 429: I’ll check my archive run and it’ll be stuck around 69 KB/sec. with an insane amount of time remaining.
Since I archive over 300 YouTube channels at this point, this is a major problem when it happens because I run downloads consecutively, so once a single download gets choked like this, it basically stops everything until I manually intervene. When I abort and start the archive run again, the downloads proceed at normal speed. I’m starting to encounter this problem multiple times a day.
So, my proposed solution is to add a feature where a minimum download speed and a check interval can be set, and if the download fails to speed up beyond the minimum within the check interval, it gets either canceled or (ideally) restarted, perhaps after a short delay, to make the throttling go away.
Edit: it happened right after I typed this feature request…
[debug] [youtube] Extracting URL: L5TGFEoidEM
[youtube] L5TGFEoidEM: Downloading webpage
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en
[debug] Default format spec: bestvideo*+bestaudio/best
[info] L5TGFEoidEM: Downloading 1 format(s): 248+251
[info] Writing video description to: Games Done Quick (to ban everyone).description
[info] Writing video subtitles to: Games Done Quick (to ban everyone).en.vtt
[debug] Invoking downloader on "https://www.youtube.com/api/timedtext?v=L5TGFEoidEM&asr_langs=de%2Cen%2Ces%2Cfr%2Cit%2Cja%2Cko%2Cnl%2Cpt%2Cru&caps=asr&exp=xftt%2Cxctw&xoaf=4&hl=en&ip=0.0.0.0&ipbits=0&expire=1624397894&sparams=ip%2Cipbits%2Cexpire%2Cv%2Casr_langs%2Ccaps%2Cexp%2Cxoaf&signature=1A9CABE587D13C1DECFD0A00C54C269239F06F26.C180D694D577CFDF35779D323317044E70A53DC2&key=yt8&kind=asr&lang=en&tlang=en&fmt=vtt"
[download] Destination: Games Done Quick (to ban everyone).en.vtt
[download] 100% of 129.36KiB in 00:00
[info] Writing video metadata as JSON to: Games Done Quick (to ban everyone).info.json
[youtube] L5TGFEoidEM: Downloading thumbnail ...
WARNING: Unable to download thumbnail "https://i.ytimg.com/vi/L5TGFEoidEM/maxresdefault.jpg": HTTP Error 404: Not Found
[youtube] L5TGFEoidEM: Downloading thumbnail ...
[youtube] L5TGFEoidEM: Writing thumbnail to: Games Done Quick (to ban everyone).jpg
[SubtitlesConvertor] Converting subtitles
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Games Done Quick (to ban everyone).en.vtt" -f srt "file:Games Done Quick (to ban everyone).en.srt"
Deleting original file Games Done Quick (to ban everyone).en.vtt (pass -k to keep)
WARNING: webm doesn't support embedding a thumbnail, mkv will be used.
[debug] Invoking downloader on "https://r6---sn-tt1eln7e.googlevideo.com/videoplayback?expire=1624394294&ei=1vXRYOOACLaYzLUPwPWSiAs&ip=172.98.80.90&id=o-AFWYT8XgIXuvpfVj6Kt-GTdLFKDRtPcERFWhY0NAVnTf&itag=248&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278%2C394%2C395%2C396%2C397%2C398%2C399&source=youtube&requiressl=yes&mh=5b&mm=31%2C26&mn=sn-tt1eln7e%2Csn-vgqs7nly&ms=au%2Conr&mv=m&mvi=6&pl=27&initcwndbps=586250&vprv=1&mime=video%2Fwebm&ns=i-DMP0Yf_6J7R2Ax6hwEUCMF&gir=yes&clen=133171938&dur=939.205&lmt=1517126865485725&mt=1624372128&fvip=6&keepalive=yes&fexp=24001373%2C24007246&c=WEB&n=zwwIFgRpIY5ZXQcmh&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgcKkzT7RcpBNIijDa6dX5fqTnU9YHFv3BygKtrRkhxs4CIQDyGAL269CGftMiy6Ji8tctKvGJdr3FJIGmHM17UwNFDA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgAYcFMIMFnxV1ZVTWsyD2m2g87cNWnmBDgazv_KTS8HQCIQDN1pqZauKa48a27b_N6uvaIXOzIyvCg9ZyYn2p44bfmg%3D%3D"
[download] Destination: Games Done Quick (to ban everyone).f248.webm
[download] 23.8% of 127.00MiB at 82.11KiB/s ETA 20:06
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Related: https://github.com/ytdl-org/youtube-dl/issues/29326 Possible alternative solution: https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-865985377
I didnt want to resort to this, but I couldn’t figure out how to actually fix the throttling issue. And my policy for yt-dlp has always been that any solution is better than no solution, especially on issues like this that affect a lot of users