aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordirkf <[email protected]>2024-12-12 04:38:23 +0000
committerdirkf <[email protected]>2024-12-16 12:38:51 +0000
commiteed784e15f6066b152a3cce8db6fe3f059290b22 (patch)
tree941814031f0013e536ecf8176638fd4bbf65e1b6
parentb4469a0f652c450a81901795a8f522ae5457a1cf (diff)
downloadyoutube-dl-eed784e15f6066b152a3cce8db6fe3f059290b22.tar.gz
youtube-dl-eed784e15f6066b152a3cce8db6fe3f059290b22.zip
[YouTube] Pass nsig value as return hook, fixes player `3bb1f723`
-rw-r--r--test/test_youtube_signature.py4
-rw-r--r--youtube_dl/extractor/youtube.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index 7d1ff90ba..1c2ba848e 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# coding: utf-8
from __future__ import unicode_literals
@@ -275,7 +276,8 @@ def signature(jscode, sig_input):
def n_sig(jscode, sig_input):
funcname = YoutubeIE(FakeYDL())._extract_n_function_name(jscode)
- return JSInterpreter(jscode).call_function(funcname, sig_input)
+ return JSInterpreter(jscode).call_function(
+ funcname, sig_input, _ytdl_do_not_return=sig_input)
make_sig_test = t_factory(
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index d633032ae..55881f4d1 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1740,7 +1740,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
def extract_nsig(s):
try:
- ret = func([s])
+ ret = func([s], kwargs={'_ytdl_do_not_return': s})
except JSInterpreter.Exception:
raise
except Exception as e: