lol

Merge pull request #177304 from collares/youtubedl-throttling2

authored by

Maciej Krüger and committed by
GitHub
c59d9f20 e5f8e819

+16 -2
+16 -2
pkgs/tools/misc/youtube-dl/default.nix
··· 25 25 }; 26 26 27 27 patches = [ 28 - # Fixes throttling on youtube.com. Without the patch downloads are capped at 29 - # about 80KiB/s. See, e.g., 28 + # Fixes throttling on youtube.com by decoding a "n-parameter". Without the patch 29 + # downloads are capped at about 80KiB/s. See, e.g., 30 30 # 31 31 # https://github.com/ytdl-org/youtube-dl/issues/29326 32 32 # ··· 36 36 name = "fix-youtube-dl-speed.patch"; 37 37 url = "https://github.com/ytdl-org/youtube-dl/compare/57044eacebc6f2f3cd83c345e1b6e659a22e4773...1e677567cd083d43f55daef0cc74e5fa24575ae3.diff"; 38 38 sha256 = "11s0j3w60r75xx20p0x2j3yc4d3yvz99r0572si8b5qd93lqs4pr"; 39 + }) 40 + # The above patch may fail to decode the n-parameter (if, say, YouTube is updated). Failure to decode 41 + # it blocks the download instead of falling back to the throttled version. The patch below implements 42 + # better fallback behaviour. 43 + (fetchpatch { 44 + name = "avoid-crashing-if-nsig-decode-fails.patch"; 45 + url = "https://github.com/ytdl-org/youtube-dl/commit/41f0043983c831b7c0c3614340d2f66ec153087b.diff"; 46 + sha256 = "sha256-a72gWhBXCLjuBBD36PpZ5F/AHBdiBv4W8Wf9g4P/aBY="; 47 + }) 48 + # YouTube changed the n-parameter format in April 2022, so decoder updates are required. 49 + (fetchpatch { 50 + name = "fix-n-descrambling.patch"; 51 + url = "https://github.com/ytdl-org/youtube-dl/commit/a0068bd6bec16008bda7a39caecccbf84881c603.diff"; 52 + sha256 = "sha256-tSuEns4jputa2nOOo6JsFXpK3hvJ/+z1/ymcLsd3A6w="; 39 53 }) 40 54 ]; 41 55