[youtube] fix #749, again (see also 1401f9a)

This commit is contained in:
Mort Yao 2019-05-09 01:22:03 +02:00
parent b746ac01c9
commit fbf46b0453
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -109,7 +109,7 @@ class YouTube(VideoExtractor):
else:
f2def = re.search(r'[^$\w]%s:function\((\w+)\)(\{[^\{\}]+\})' % f2e, js)
f2def = 'function {}({},b){}'.format(f2e, f2def.group(1), f2def.group(2))
f2 = re.sub(r'(\W)(as|if|in|is|or)\(', r'\1_\2(', f2)
f2 = re.sub(r'(as|if|in|is|or)', r'_\1', f2)
f2 = re.sub(r'\$', '_dollar', f2)
code = code + 'global %s\n' % f2 + tr_js(f2def)