Skip to content

Commit

Permalink
[YouTube] Pass nsig value as return hook, fixes player 3bb1f723
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkf committed Dec 12, 2024
1 parent 54c145a commit 1e6397b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/test_youtube_signature.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# coding: utf-8

from __future__ import unicode_literals

Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion youtube_dl/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ def _extract_n_function_from_code(self, jsi, func_code):

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:
Expand Down

0 comments on commit 1e6397b

Please sign in to comment.