[youtube] fix signature extraction

This commit is contained in:
Mort Yao 2017-02-02 05:50:00 +01:00
parent ed99b91d18
commit 098b6a9dd8
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -52,7 +52,7 @@ class YouTube(VideoExtractor):
return code
js = js.replace('\n', ' ')
f1 = match1(js, r'\w+\.sig\|\|([$\w]+)\(\w+\.\w+\)')
f1 = match1(js, r'"signature",([\w]+)\(\w+\.\w+\)')
f1def = match1(js, r'function %s(\(\w+\)\{[^\{]+\})' % re.escape(f1)) or \
match1(js, r'\W%s=function(\(\w+\)\{[^\{]+\})' % re.escape(f1))
f1def = re.sub(r'([$\w]+\.)([$\w]+\(\w+,\d+\))', r'\2', f1def)