yt-dlp: [Youtube] throttling and inconsistent speed in Russia

🚨Click here for workarounds🚨

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

No response

Provide a description that is worded well enough to be understood

For the last couple of days I’m having constant throttling issues with Youtube downloads. It’s the same on the latest public (2024.07.09) and nightly (2024.07.11) releases. I use yt-dlp by itself, with ytdlp-interface and with mpc-hc (I also use PotPlayer which has it’s own way of delivering Youtube streams and it’s also having trouble, but I don’t know if it’s relevant here). In all cases the speed I get is inconsistent, but consistently bad. It’s usually hovering somewhere around 200KiB or lower, sometimes going up to 400-500 or having a rare spike of even faster speed. For some videos the base speed is better, for some it’s worse, but I didn’t had one downloading at a normal speed for a couple of days.

I’ve tried adding PhantomJS and I’ve stopped getting a warning about it, but the speed and it’s inconsistency didn’t really improved.

Also, when watching on the actual Youtube (in Firefox) I don’t have any noticeable playback issues. It doesn’t feel any slower to load the video or skip around.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=e8ehi-1FwUU']
[debug] User config "C:\Users\User\AppData\Roaming\yt-dlp\config": ['-o', 'c:/users/user/desktop/%(title)s.%(ext)s', '-r', '999K', '-f', '136+140', '--cookies-from-browser', 'firefox:ko0oafee.default-release']
[debug] Encodings: locale cp1251, fs utf-8, pref cp1251, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2024.07.11.232833 from yt-dlp/yt-dlp-nightly-builds [cc1a3098c] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-7-6.1.7601-SP1 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 4.2, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, curl_cffi-0.7.0, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\User\AppData\Roaming\Mozilla\Firefox\Profiles\ko0oafee.default-release\cookies.sqlite"
Extracted 1195 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.07.11.232833 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.07.11.232833 from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: https://www.youtube.com/watch?v=e8ehi-1FwUU
[youtube] e8ehi-1FwUU: Downloading webpage
[debug] [youtube] Extracted SAPISID cookie
[youtube] e8ehi-1FwUU: Downloading ios player API JSON
[debug] [youtube] Extracting signature function js_8d9f6215_109
[debug] Loading youtube-sigfuncs.js_8d9f6215_109 from cache
[debug] Loading youtube-nsig.8d9f6215 from cache
[debug] [youtube] Decrypted nsig mLbhvbt9lcHfXg2xqNA => LuTqjoDb154j6w
[debug] [youtube] Extracting signature function js_8d9f6215_105
[debug] Loading youtube-sigfuncs.js_8d9f6215_105 from cache
[debug] Loading youtube-nsig.8d9f6215 from cache
[debug] [youtube] Decrypted nsig VwS3V6ro-hTWB4onsBQ => TiCGZvfd9Iu7sA
[youtube] e8ehi-1FwUU: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] e8ehi-1FwUU: Downloading 1 format(s): 136+140
[debug] Invoking http downloader on "https://rr4---sn-gvnuxaxjvh-n8vd.googlevideo.com/videoplayback?expire=1720824020&ei=dFyRZunLDKmqv_IP-b6yoAg&ip=109.237.236.140&id=o-AM6fE97szfyB0QHyf3y6DN1YA4URRH64SjJC64rZhhwb&itag=136&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=kV&mm=31%2C29&mn=sn-gvnuxaxjvh-n8vd%2Csn-n8v7kn7y&ms=au%2Crdu&mv=m&mvi=4&pl=20&initcwndbps=762500&siu=1&bui=AXc671L83m4SFUlcVxtqgsp7NZrA6yPagMQZy6l7PiP0ih9BK1qnTI7BUYKV1c9hxg3JlZ-AhA&spc=NO7bAdTtcqmysz7c7NCgnLcxTzi2njcVfrLBjm2NE1z9FS2FaIfJnuWYFlCHAxBAr9gg_AaD8w&vprv=1&svpuc=1&mime=video%2Fmp4&ns=JfigxZQxmdTvHRE4Vq2DblMQ&rqh=1&gir=yes&clen=1747681569&dur=7075.066&lmt=1720670775794204&mt=1720802002&fvip=12&keepalive=yes&c=WEB&sefc=1&txp=7309224&n=TiCGZvfd9Iu7sA&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Csiu%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRAIgeOIdXTJjcTvAk9PwIS3A5aGcbhVVnZsYTlKWG2RWVHECIC8Oyalj5h856_nJR7m-2fNmKCewLUzWMFru6icAclOX&sig=AJfQdSswRAIgchPdmffm6X4IHBuPxVtCelmjO7C2FXe5_spuNvdBB9ECIHC2o8wPQXi56ujmLp5VMwdDdInJmD_BjmD6uhZj6ZT7"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: c:\users\user\desktop\?#3rdAnniversaRyS?HOLOLIVE SONG KARAOKE ?? to CELEBRATE 3 YEARS HERE!!?3 Year Anniversary Stream?.f136.m
p4
[download]   0.3% of    1.63GiB at   85.55KiB/s ETA 05:31:27

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 81 (13 by maintainers)

Most upvoted comments

This is not yt-dlp issue. The throttling is done using Deep Packet Inspection appliances by Russian government.

(updated 26.07.2024 20:25 MSK)

Workaround only for yt-dlp

ByeDPI (Windows/Linux)

  1. ./ciadpi-x86_64 -i 127.0.0.1 -p 10801 -d 1
  2. yt-dlp --proxy 'socks5://127.0.0.1:10801' …

Workaround system-wide

  • On Windows: GoodbyeDPI

    1. Create youtube-domain.txt text file with googlevideo.com text
    2. goodbyedpi.exe --blacklist youtube-domain.txt -6
    3. Or goodbyedpi.exe --blacklist youtube-domain.txt -e 1 --reverse-frag if the above didn’t work
  • On Linux: zapret

    1. Create youtube-domain.txt text file with googlevideo.com text
    2. sudo ./nfqws --qnum=200 --dpi-desync=disorder2 --dpi-desync-split-pos=1 --hostlist=youtube-domain.txt
    3. sudo iptables -I OUTPUT -o <network_interface> -p tcp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:6 -m mark ! --mark 0x40000000/0x40000000 -j NFQUEUE --queue-num 200 --queue-bypass
    4. sudo ip6tables -I OUTPUT -o <network_interface> -p tcp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:6 -m mark ! --mark 0x40000000/0x40000000 -j NFQUEUE --queue-num 200 --queue-bypass
  • On Android: ByeDPIAndroid

  • To make it work in browsers, you must disable support for the QUIC protocol and the Kyber cipher suite. Chrome-based (Yandex, Edge, Opera, Vivaldi): disable in chrome://flags (search by ā€œQUICā€, ā€œKyberā€), in Firefox: about:config (network.http.http3.enable false, Kyber is disabled by default).
    This is needed only for system-wide workarounds, proxy should work without additional tuning.

Just relax and be prepared Youtube to be blocked in Mother Russia! šŸ˜‰

@krasnh

  1. Local GGC, if installed directly on your ISP premises, is apparently not throttled (at least in case of my ISP)
  2. TSPU DPI hardware doesn’t seem to be able to dissect QUIC (HTTP/3) protocol in Firefox, that’s why Firefox is not getting throttled. You most probably will face throttling in Chrome (unless #1).
  3. yt-dlp doesn’t support QUIC
  4. yt-dlp doesn’t reliably use local GGC, at least on my ISP: it generates URL for ā€œglobalā€ GGC of a city (on Google IP range) for which throttling applies, but not for the local GGC of my ISP (on my ISP IP range in whois).

TL;DR: the fact you’re getting full speed in Firefox is a filtering deficiency. More information: https://ntc.party/t/замеГление-youtube-в-россии/8055/ and https://ntc.party/t/обсужГение-замеГление-youtube-в-россии/8074/

Does passing --extractor-args "youtube:formats=dashy" help? You can try additionally passing -N 4 (or adjust the value as desired)

@WeAreLiving1984 an infinite loop retrying something that will never succeed, and the incessant hammering of the youtube API and videoplayback endpoints (or whatever site you’re downloading from) could lead to an IP and/or account ban

--retries/-R is applied to more than just --throttled-rate. You could run into an unresolvable error that yt-dlp retries on, leading to an infinite loop, leading to your playlist/batch download stalling at that point, leading to an IP ban

Note: this thread will be locked soon to prevent the useful workarounds comment from disappearing into the hidden comments. Please only comment if you have something useful to add. No more chit chat please.

I found this utility (mentioned on the forum that Waujito linked): https://github.com/ValdikSS/GoodbyeDPI

Running it with these parameters goodbyedpi.exe -6 --frag-by-sni completely recovers the speed. Both in yt-dlp and players. But you need to grab it from Actions not from Releases.

goodbyedpi c -6 вообще ни на что не Š²Š»ŠøŃŠµŃ‚. Ростелеком.

Extra note about goodbyedpi.exe. In Releases there’s a script to turn it into a service for convenience. You just need to change arguments to goodbyedpi.exe -6 --frag-by-sni in the script and make sure that it will use the Actions version of the exe.

I found this utility (mentioned on the forum that Waujito linked): https://github.com/ValdikSS/GoodbyeDPI

Running it with these parameters goodbyedpi.exe -6 --frag-by-sni completely recovers the speed. Both in yt-dlp and players. But you need to grab it from Actions not from Releases.

Yes, VladikSS found that RKN blocks it based on SNI. So even curl request with SNI replacement works:

curl \
-k --connect-to ::rr4---sn-4g5lzne6.googlevideo.com \
 "https://google.com/videoplayback?expire=1721352280&ei=-GuZZpfWGdXUv_IP9q67QA&ip=2a00%3A62d0%3A3395%3Aa000%3A67f8%3Aeada%3Ada3d%3Aa86&id=o-ACZFWPpixW4dSEfOxVZlQmZyugzE83A55Md_-WJzIlD0&itag=337&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303%2C308%2C315%2C330%2C331%2C332%2C333%2C334%2C335%2C336%2C337%2C394%2C395%2C396%2C397%2C398%2C399%2C400%2C401%2C694%2C695%2C696%2C697%2C698%2C699%2C700%2C701&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&bui=AXc671L-y_4u26gODmHtXo16V3jiueb2GsrbSU8PVFQrQ1aAub1YGF8mv1ciurPDJptkW5f5fYv4zCA9&spc=NO7bASkJP0CXSG_EU-N3lbs_Rga8MBWAW5bxy6q93-d2jKNrzgRjbunzzXlZ&vprv=1&svpuc=1&mime=video%2Fwebm&ns=xKSmzS2jBJARd5rJEjjLtWoQ&rqh=1&gir=yes&clen=1135566526&dur=313.779&lmt=1711474575024876&keepalive=yes&c=WEB&sefc=1&txp=4502434&n=dGX3_gVknbmIQw&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgWqpLs6K9_sDfw8jMZPKoQcn4RpnflXAdpKVoieXj9dYCIAGLNG6ABNxJk5LrUpm1gGbr1BahvOZatBJf38iFiOm-&rm=sn-5gos776,sn-5gose7e&rrc=104,40&fexp=24350516,24350518&req_id=a8293fc46386cc4b&ipbypass=yes&redirect_counter=2&cms_redirect=yes&cmsv=e&mh=NH&mip=109.61.240.120&mm=34&mn=sn-4g5lzne6&ms=ltu&mt=1721330429&mv=m&mvi=4&pl=20&lsparams=ipbypass,mh,mip,mm,mn,ms,mv,mvi,pl&lsig=AHlkHjAwRQIgEGlgi21J6rDKLHer8gtKFIyOIKfIpka8Q-jeIGTS7koCIQDL3f9xbyEqleg16XWNOYlSL_KywXEzHFKKQeOwHApXug%3D%3D"\ 
-H "Host: rr4---sn-4g5lzne6.googlevideo.com"\
 --verbose -o/dev/null -4

(the request is for reference and may not work on your IPs, grab URI from --verbose option for qzmtch’s yt-dlp command)

image image

The fact that it works also breaks the theory about google’s internal tests as they won’t relay on so low-level thing as TLS SNI. Also the thing that proves that this is an RKN jokes is throttling of the SNI-replaced packages to selectel’s speedtest (curl requests provided by VladikSS in top of the thread, duplicated for fullness):

Google IP + GCR SNI
curl -s -o/dev/null -k --connect-to ::google.com -k -L -H Host:\ mirror.gcr.io --range 0-40000000 --max-time 30 https://mirror.gcr.io/v2/cimg/android/blobs/sha256:6fd8bdac3da660bde7bd0b6f2b6a46e1b686afb74b9a4614def32532b73f5eaa -w %{speed_download}

Google IP + Googlevideo SNI
curl -s -o/dev/null -k --connect-to ::google.com -k -L -H Host:\ mirror.gcr.io --range 0-40000000 --max-time 30 https://test.googlevideo.com/v2/cimg/android/blobs/sha256:6fd8bdac3da660bde7bd0b6f2b6a46e1b686afb74b9a4614def32532b73f5eaa -w %{speed_download}

Does passing --extractor-args "youtube:formats=dashy" help? You can try additionally passing -N 4 (or adjust the value as desired)

Adding --extractor-args "youtube:formats=dashy" or -N 4 separately didn’t change anything, but adding them both together did the trick. Speed is in 1MiB range, sometimes dipping to 700-800KiB or rising to 1.2-1.5MiB.

--throttled-rate RATE           Minimum download rate in bytes per second
                                below which throttling is assumed and the
                                video data is **re-extracted**, e.g. 100K

What does video data being re-extracted even mean in this context?

As a workaround, I add ā€œā€“throttled-rate 500K -R infinite --socket-timeout 1ā€ to yt-dlp. Throttling switches on after several seconds of downloading. It works for me.

I would caution against using -R infinite, or using infinite as an argument for any retry option, unless you will never be leaving any downloads unattended. Also, re-extracting the video so many times (as --throttled-rate does) could easily lead to an IP/account ban

As a workaround, I add ā€œā€“throttled-rate 500K -R infinite --socket-timeout 1ā€ to yt-dlp. Throttling switches on after several seconds of downloading. It works for me.

The use of http3 does not help for me.

I just want to take a note about GoodbyeDPI, you don’t need SNI to fix that, it will work with just -6 argument. But if you used blacklist txt file as well, then you would need to add domain googlevideo.com to that txt file and restart GDPI, this should fix throttling.

Hello! I have written an userspace application for linux that bypasses these restrictions. This is a simple application aims only to googlevideo. After a bunch of research it turned out that the best decision is to split the packet in SNI position, just like the GoodbyeDPI does. I made it work with Firefox, Chrome and yt-dlp.

goodbyedpi.exe

For some, this is a decision. What about Linux? )

You can find out more about this on the ntc party forum (Note: blocked in Russia, use VPN)

Russian IP here too, experiencing the same throttling issue. And, likewise, opening YT in a browser works as it should without any throttling. However, once I started using yt-dlp with an HTTPS proxy (by passing the --proxy option) the throttling in yt-dlp is gone and I can finally download videos normally, with download speed going back up to ~10MiB/s, exactly how it was before.

Something strange is definitely going on here, and it’s hard to say who is to blame. This doesn’t seem like RKN’s MO, at least not intentionally.

I think the behavior is expected because one thing is to load chunks of video as it is playing and another is to download the video as fast as possible.

I also watch Youtube in MPC-HC (with yt-dlp) and PotPlayer (that uses it’s own way of getting a stream), and both of them are struggling. 200KiB is not a stream speed you can watch 720p/1080p video at. 480p is watchable, but, you know…

Roscomnadzor doesn’t throttle sites. It blocks them outright (or fails like with Telegram). And if there were attempting to block Youtube, runet would’ve been in an uproar. It’s unlikely I’ve just missed the memo on that.

About your browser you can check network logs of youtube tab (in developer options) and see NS_BINDING_ABORTED’s

I don’t see any errors in the network logs, other then uBlock and Privacy Badger blocking things.

I don’t have ipv6, so can’t check how -6 would behave for me.

Hello, as I can see by Yokosven’s IP he is Russian. It is sad to say but Russian censorship seems to have started dropping random youtube packets (they stay it is due to google’s GGC ineffectiveness in Russia but it anyway uses Ireland/Sweden servers so that’s a lie. Also It’s hard to believe that google itself will random drop packets). I have 184 Kib/s with yt-dlp now when downloading 4k60 fps. Also I have noticible throttling in youtube itself(but I think youtube behaves better with that than yt-dlp). By the way everything turns out to be ok for ipv6. (9 Mib/s). But not too much ISPs have support for ipv6 now. I think here may be a workaround for this problem. May be multiple parallel connections or something like this.

image

This is not yt-dlp issue. The throttling is done using Deep Packet Inspection appliances by Russian government.

(updated 26.07.2024 20:25 MSK)

Workaround only for yt-dlp

ByeDPI (Windows/Linux)

1. `./ciadpi-x86_64 -i 127.0.0.1 -p 10801 -d 1`

2. `yt-dlp --proxy 'socks5://127.0.0.1:10801' …`

Workaround system-wide

* On **Windows**: [GoodbyeDPI](https://github.com/ValdikSS/GoodbyeDPI)
  
  1. Create `youtube-domain.txt` text file with `googlevideo.com` text
  2. `goodbyedpi.exe --blacklist youtube-domain.txt -6`
  3. Or `goodbyedpi.exe --blacklist youtube-domain.txt -e 1 --reverse-frag` if the above didn't work

* On **Linux**: [zapret](https://github.com/bol-van/zapret)
  
  1. Create `youtube-domain.txt` text file with `googlevideo.com` text
  2. `sudo ./nfqws --qnum=200 --dpi-desync=disorder2 --dpi-desync-split-pos=1 --hostlist=youtube-domain.txt`
  3. `sudo iptables -I OUTPUT -o <network_interface> -p tcp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:6 -m mark ! --mark 0x40000000/0x40000000 -j NFQUEUE --queue-num 200 --queue-bypass`
  4. `sudo ip6tables -I OUTPUT -o <network_interface> -p tcp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:6 -m mark ! --mark 0x40000000/0x40000000 -j NFQUEUE --queue-num 200 --queue-bypass`

* On **Android**: [ByeDPIAndroid](https://github.com/dovecoteescapee/ByeDPIAndroid)

* To make it work in browsers, you must disable support for the QUIC protocol and the Kyber cipher suite. Chrome-based (Yandex, Edge, Opera, Vivaldi): disable in `chrome://flags` (search by "QUIC", "Kyber"), in Firefox: `about:config` (`network.http.http3.enable false`, Kyber is disabled by default).
  This is needed only for system-wide workarounds, proxy should work without additional tuning.

yt-dlp and https proxy (I recommend a proxy on port 9002) yt-dlp --no-check-certificates --proxy='https://xxx.xxx.xxx.xxx:xxxx' 'https://www.youtube.com/watch?v=xxxxxxxx'

Avpanov, this is the best advice for increasing the download speed. I would like to notice that the owner of the Chrome browser and YouTube is the same company. YouTube can also help slow down traffic by manipulating local CDN and harming yt-dlp along the way.

  1. yt-dlp can use QUIC via curl (a special curl build with HTTP3 support, not every curl will work, especially on Linux). For some formats (for https, not ~m3u8). But since curl downloads the whole URL at once, not in parts (as yt-dlp does), the speed will be limited by Google itself, approximately 2xrealtime bitrate/time (by the way, that’s why audio speed is very low, because of low audio bitrate). Google’s fault in this case can be determined by running under a VPN. So choose streams with high quality (and duration) for yt-dlp+curl+quic test.

yt-dlp URL -f 137 --downloader=curl --downloader-args="curl:--http3-only"

Add -v to the arguments for detailed logging. Add -k to ignore certificates, useful in curl for Windows.

As it seems that this problem is not going anywhere any time soon and is likely to appear in other countries (as dpi technologies progresses), could an option to automatically launch byedpi from PATH be added to yt-dlp?

goodbyedpi.exe

Š”Š»Ń кого-то ŃŃ‚Š¾ Ń€ŠµŃˆŠµŠ½ŠøŠµ. А как насчет Linux? )

https://github.com/bol-van/zapret

When I completly disabled quic on firefox (disabled http3 and http2, network.http.http(2,3).enable(d) in about:config, you can try it and check load speed) it has started to load on 200 KiB/s with tons of random tcp errors in wireshark.

Can confirm. When http2/http3 are disabled, even on Youtube itself videos can’t play at 720p, and I do see errors in network logs. Also, if on top of that I enable VPN - speed recovers back to normal, which fits the RKN theory. Though if it’s actually RKN’s doing, I don’t understand what they’re trying to achieve here, even if it is a test for the real thing that will come later. This doesn’t stop the spread of information they deem unwanted, it just makes the watching experience crappy and less convenient.

maybe they want more authors to duplicate their content on Russian sites, like VK, Rutube, OK

I think the behavior is expected because one thing is to load chunks of video as it is playing and another is to download the video as fast as possible.

I also watch Youtube in MPC-HC (with yt-dlp) and PotPlayer (that uses it’s own way of getting a stream), and both of them are struggling. 200KiB is not a stream speed you can watch 720p/1080p video at. 480p is watchable, but, you know…

Roscomnadzor doesn’t throttle sites. It blocks them outright (or fails like with Telegram). And if there were attempting to block Youtube, runet would’ve been in an uproar. It’s unlikely I’ve just missed the memo on that.

Yea, but they were talking about youtube slowdown a lot in the past. Also here is an about 7 days-old announcement from Rostelecom that google can’t update GGC in Russia due to the US sanctions and here may be outperforms in youtube video load speed. BUT I haven’t seen any Russian IP in googlevideo after that announcement. And I think it wasn’t here for a lot of time so we all have been watching youtube from foreign cache servers which are unrelated to Russia. So I dont think that google updated software on their servers to invalidate random packets and send random rsts for Russian ips. And even more that I got that thing only on ipv4 and http/1.1 (=> over tcp proto). When I completly disabled quic on firefox (disabled http3 and http2, network.http.http(2,3).enable(d) in about:config, you can try it and check load speed) it has started to load on 200 KiB/s with tons of random tcp errors in wireshark. When I enabled ipv6 and keeped firefox to use http/1.1 everything started to load normally. So I dont think that google ingeneers are too dumb to detect Russian ipv6 if they wish to do so. And I don’t think that they will support quic on both ipv4 and ipv6, tcp on ipv6 and slow down only tcp on ipv4. So logic statement from this is a middleware which loves Russian children and want to protect them from Western propaganda, Grand Roscomnadzor. They may be doing tests for youtube slowdown and checking how their servers behaves with this. And if this is true the most we can do is to pray that they will not touch QUIC.

But also it may be google that wish to move completly on quic and just tests http/1.1 slowdown for youtube for better performance on their servers.

So in my opinion for this time it seems like the solution is http/3 support. yt-dlp uses HTTP/1.1 with TCP when firefox/chrome uses HTTP/3 with QUIC and it’s the reason why you may be ok in browser and have bad speed with yt-dlp. Interesting that I didn’t got quic earlier in firefox by default. And got scared that this is the end 😃. May be firefox needed restart when I disabled ipv6 or anything else which may prevent it from establishing http/3 and enforce fallback to http/1.1.

Hello, as I can see by Yokosven’s IP he is Russian. It is sad to say but Russian censorship seems to have started dropping random youtube packets

That would be relevant if it was happening on the actual Youtube as well, but the site’s performance is as solid as ever. It’s only yt-dlp and similar unofficial methods.

I think the behavior is expected because one thing is to load chunks of video as it is playing and another is to download the video as fast as possible. Unluckily for us that might be done for performance/speed reasons but it turns out to break under that censor of Roscomnadzor. It seems like the most that contributors can do is to fine-tune module to behave as youtube itself. About your browser you can check network logs of youtube tab (in developer options) and see NS_BINDING_ABORTED’s. Or open wireshark and see how tcp packets are invalidated. Also you can try to pass -6 option for yt-dlp to force ipv6 (if it is available for you) and check the speed.

switching between IPv4 and IPv6 (or even to a completely unrelated IP) doesn’t bypass it either.

Yes, agreed. But it seems like some ISPs (Rostelecom for me) provide ipv6 and don’t put censor for it. Even other services which are completly blocked on ipv4 are available on ipv6.

Another interesting option is that youtube drops to http/1.1 on firefox on ipv4 (unstable, bad speed), http/3 on firefox on ipv6 and uses quic on chrome which has no drops, clear logs, good speed and works for ipv4. May be the solution is to implement quic?

Tried 2024.07.14.232743. Everything is the same, so far. I’ll stop reporting on each nightly build, until there’s one that brings noticeable changes.

Have tried 2024.07.13.232701. No noticeable difference in speed with and without --extractor-args "youtube:formats=dashy" -N 4. Without still ~200KiB. With still starts fast and slows down. I get read time outs more frequently, but it’s the same on nightly or stable.

Things are getting worse for me. Even with these parameters, what I’m seeing more and more is that the download will start fast, but then slow down to a crawl of 200~400KiB, sometimes getting faster, but then slowing back down. Downloads of audio files are the worst part. Their speed is all over the place, including 0, leading to timeouts.

yes

Does --extractor-args "youtube:formats=dashy" download the same thing but using a different protocol? I can’t understand that from the doc.