[ie/youtube] Improve nsig extraction

Authored by: bashonly
This commit is contained in:
bashonly
2025-05-23 13:39:39 -05:00
parent 538eb30567
commit 8dc77e6034
+3 -4
View File
@@ -2318,10 +2318,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
return varname, interpret_global_var(array_code, {}, allow_recursion=10)
def _fixup_n_function_code(self, argnames, nsig_code, jscode, player_url):
varcode, varname, _ = self._extract_player_js_global_var(jscode, player_url)
if varcode and varname:
nsig_code = varcode + '; ' + nsig_code
_, global_list = self._interpret_player_js_global_var(jscode, player_url)
varname, global_list = self._interpret_player_js_global_var(jscode, player_url)
if varname and global_list:
nsig_code = f'var {varname}={json.dumps(global_list)}; {nsig_code}'
else:
varname = 'dlp_wins'
global_list = []