[youtube] fix extraction

This commit is contained in:
Mort Yao 2024-07-14 08:28:21 +02:00
parent 882b9c07f8
commit 1a928fac49
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -80,7 +80,8 @@ class YouTube(VideoExtractor):
# Examples: # Examples:
# yma - https://www.youtube.com/s/player/84314bef/player_ias.vflset/en_US/base.js # yma - https://www.youtube.com/s/player/84314bef/player_ias.vflset/en_US/base.js
# Xka - https://www.youtube.com/s/player/dc0c6770/player_ias.vflset/sv_SE/base.js # Xka - https://www.youtube.com/s/player/dc0c6770/player_ias.vflset/sv_SE/base.js
f1 = match1(js, r'a\.set\("n",b\),[$\w]+\.length\|\|([$\w]+)\(""\)') # jma - https://www.youtube.com/s/player/8d9f6215/player_ias.vflset/sv_SE/base.js
f1 = match1(js, r',[$\w]+\.length\|\|([$\w]+)\(""\)\)}};')
f1def = match1(js, r'\W%s=(function\(\w+\).+?\)});' % re.escape(f1)) f1def = match1(js, r'\W%s=(function\(\w+\).+?\)});' % re.escape(f1))
n = dukpy.evaljs('(%s)("%s")' % (f1def, n)) n = dukpy.evaljs('(%s)("%s")' % (f1def, n))
return n return n