1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-08 02:25:13 +00:00

[ie/youtube] Fix signature and nsig extraction for player 363db69b (#12725)

Closes #12724
Authored by: bashonly
This commit is contained in:
bashonly
2025-03-24 16:18:51 -05:00
committed by GitHub
parent 9d5e6de2e7
commit b9c979461b
2 changed files with 14 additions and 2 deletions

View File

@@ -2176,10 +2176,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
"""Returns tuple of strings: variable assignment code, variable name, variable value code"""
return self._search_regex(
r'''(?x)
\'use\s+strict\';\s*
(?P<q1>["\'])use\s+strict(?P=q1);\s*
(?P<code>
var\s+(?P<name>[a-zA-Z0-9_$]+)\s*=\s*
(?P<value>"(?:[^"\\]|\\.)+"\.split\("[^"]+"\))
(?P<value>
(?P<q2>["\'])(?:(?!(?P=q2)).|\\.)+(?P=q2)
\.split\((?P<q3>["\'])(?:(?!(?P=q3)).)+(?P=q3)\)
)
)[;,]
''', jscode, 'global variable', group=('code', 'name', 'value'), default=(None, None, None))