mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-05 12:36:17 -07:00
[YouTube] Fix KeyError QV
in signature extraction failed
* temporarily force missing global definition into sig JS * improve test: thanks https://github.com/yt-dlp/yt-dlp/issues/7327#issuecomment-1595274615 * resolves #32314
This commit is contained in:
parent
d6433cbb2c
commit
ae8ba2c319
2 changed files with 11 additions and 2 deletions
|
@ -1569,8 +1569,12 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||
r'\bc\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\('),
|
||||
jscode, 'Initial JS player signature function name', group='sig')
|
||||
|
||||
jsi = JSInterpreter(jscode)
|
||||
# temporary (please) hack for player 6ed0d907 #32314
|
||||
ah = 'var AH={LR:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b%a.length]=c},QV:function(a){a.reverse()},pO:function(a,b){a.splice(0,b)}};'
|
||||
jsi = JSInterpreter(ah + jscode)
|
||||
|
||||
initial_function = jsi.extract_function(funcname)
|
||||
|
||||
return lambda s: initial_function([s])
|
||||
|
||||
def _decrypt_signature(self, s, video_id, player_url):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue