mirror of https://github.com/yt-dlp/yt-dlp.git
[youtube] Fix n-sig extraction for phone player JS (#2816)
Authored by: MinePlayersPE
This commit is contained in:
parent
5b804e3906
commit
c571b3a6ab
|
@ -90,6 +90,10 @@ _NSIG_TESTS = [
|
||||||
'https://www.youtube.com/s/player/e06dea74/player_ias.vflset/en_US/base.js',
|
'https://www.youtube.com/s/player/e06dea74/player_ias.vflset/en_US/base.js',
|
||||||
'AiuodmaDDYw8d3y4bf', 'ankd8eza2T6Qmw',
|
'AiuodmaDDYw8d3y4bf', 'ankd8eza2T6Qmw',
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/5dd88d1d/player-plasma-ias-phone-en_US.vflset/base.js',
|
||||||
|
'kSxKFLeqzv_ZyHSAt', 'n8gS8oRlHOxPFA',
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2413,7 +2413,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
|
|
||||||
def _extract_n_function_name(self, jscode):
|
def _extract_n_function_name(self, jscode):
|
||||||
nfunc, idx = self._search_regex(
|
nfunc, idx = self._search_regex(
|
||||||
r'\.get\("n"\)\)&&\(b=(?P<nfunc>[a-zA-Z0-9$]{3})(?:\[(?P<idx>\d+)\])?\([a-zA-Z0-9]\)',
|
r'\.get\("n"\)\)&&\(b=(?P<nfunc>[a-zA-Z0-9$]+)(?:\[(?P<idx>\d+)\])?\([a-zA-Z0-9]\)',
|
||||||
jscode, 'Initial JS player n function name', group=('nfunc', 'idx'))
|
jscode, 'Initial JS player n function name', group=('nfunc', 'idx'))
|
||||||
if not idx:
|
if not idx:
|
||||||
return nfunc
|
return nfunc
|
||||||
|
|
Loading…
Reference in New Issue