summary refs log tree commit diff
path: root/pkgs/tools/misc/youtube-dl
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2022-06-24 20:32:59 +0200
committerGitHub <noreply@github.com>2022-06-24 20:32:59 +0200
commitc59d9f20d9fe1290fd0690a58cd403a35b6dabe3 (patch)
tree8c67134227df25dd54f14c5a601e54bfdc2506dc /pkgs/tools/misc/youtube-dl
parente5f8e81946d12bfa2cb25b74f1e3149275a7ad11 (diff)
parent6be823dd77ecd67bc335c272b6892bb5d7e24d7b (diff)
downloadnixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar.gz
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar.bz2
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar.lz
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar.xz
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.tar.zst
nixpkgs-c59d9f20d9fe1290fd0690a58cd403a35b6dabe3.zip
Merge pull request #177304 from collares/youtubedl-throttling2
Diffstat (limited to 'pkgs/tools/misc/youtube-dl')
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index fd038d7acb1..4aee6bdeb5f 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -25,8 +25,8 @@ buildPythonPackage rec {
   };
 
   patches = [
-    # Fixes throttling on youtube.com. Without the patch downloads are capped at
-    # about 80KiB/s. See, e.g.,
+    # Fixes throttling on youtube.com by decoding a "n-parameter". Without the patch
+    # downloads are capped at about 80KiB/s. See, e.g.,
     #
     #   https://github.com/ytdl-org/youtube-dl/issues/29326
     #
@@ -37,6 +37,20 @@ buildPythonPackage rec {
       url = "https://github.com/ytdl-org/youtube-dl/compare/57044eacebc6f2f3cd83c345e1b6e659a22e4773...1e677567cd083d43f55daef0cc74e5fa24575ae3.diff";
       sha256 = "11s0j3w60r75xx20p0x2j3yc4d3yvz99r0572si8b5qd93lqs4pr";
     })
+    # The above patch may fail to decode the n-parameter (if, say, YouTube is updated). Failure to decode
+    # it blocks the download instead of falling back to the throttled version. The patch below implements
+    # better fallback behaviour.
+    (fetchpatch {
+      name = "avoid-crashing-if-nsig-decode-fails.patch";
+      url = "https://github.com/ytdl-org/youtube-dl/commit/41f0043983c831b7c0c3614340d2f66ec153087b.diff";
+      sha256 = "sha256-a72gWhBXCLjuBBD36PpZ5F/AHBdiBv4W8Wf9g4P/aBY=";
+    })
+    # YouTube changed the n-parameter format in April 2022, so decoder updates are required.
+    (fetchpatch {
+      name = "fix-n-descrambling.patch";
+      url = "https://github.com/ytdl-org/youtube-dl/commit/a0068bd6bec16008bda7a39caecccbf84881c603.diff";
+      sha256 = "sha256-tSuEns4jputa2nOOo6JsFXpK3hvJ/+z1/ymcLsd3A6w=";
+    })
   ];
 
   nativeBuildInputs = [ installShellFiles makeWrapper ];