1
0
Fork 0

[jsinterp] Fix for youtube player 1f7d5369

Closes #4635 again
This commit is contained in:
pukkandan 2022-08-18 16:38:35 +05:30
commit f6ca640b12
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
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):
"""