[jsinterp] Fix for youtube player 1f7d5369

Closes #4635 again
This commit is contained in:
pukkandan
2022-08-18 16:38:35 +05:30
parent 3ce2933693
commit f6ca640b12
3 changed files with 60 additions and 19 deletions

View File

@@ -2652,9 +2652,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if self.get_param('youtube_print_sig_code'):
self.to_screen(f'Extracted nsig function from {player_id}:\n{func_code[1]}\n')
func = jsi.extract_function_from_code(*func_code)
return lambda s: func([s])
def inner(s):
ret = func([s])
if ret.startswith('enhanced_except_'):
raise ExtractorError('Signature function returned an exception')
return ret
return inner
def _extract_signature_timestamp(self, video_id, player_url, ytcfg=None, fatal=False):
"""