1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-01 23:25:14 +00:00

[youtube] Fix n-sig extraction for phone player JS (#2816)

Authored by: MinePlayersPE
This commit is contained in:
MinePlayersPE
2022-02-18 15:12:20 +07:00
committed by GitHub
parent 5b804e3906
commit c571b3a6ab
2 changed files with 5 additions and 1 deletions

View File

@@ -2413,7 +2413,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
def _extract_n_function_name(self, jscode):
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'))
if not idx:
return nfunc