mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-27 06:14:21 +03:00
[ie/youtube] Improve nsig extraction
Authored by: bashonly
This commit is contained in:
@@ -2318,10 +2318,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
return varname, interpret_global_var(array_code, {}, allow_recursion=10)
|
return varname, interpret_global_var(array_code, {}, allow_recursion=10)
|
||||||
|
|
||||||
def _fixup_n_function_code(self, argnames, nsig_code, jscode, player_url):
|
def _fixup_n_function_code(self, argnames, nsig_code, jscode, player_url):
|
||||||
varcode, varname, _ = self._extract_player_js_global_var(jscode, player_url)
|
varname, global_list = self._interpret_player_js_global_var(jscode, player_url)
|
||||||
if varcode and varname:
|
if varname and global_list:
|
||||||
nsig_code = varcode + '; ' + nsig_code
|
nsig_code = f'var {varname}={json.dumps(global_list)}; {nsig_code}'
|
||||||
_, global_list = self._interpret_player_js_global_var(jscode, player_url)
|
|
||||||
else:
|
else:
|
||||||
varname = 'dlp_wins'
|
varname = 'dlp_wins'
|
||||||
global_list = []
|
global_list = []
|
||||||
|
|||||||
Reference in New Issue
Block a user