[youtube] Fix extraction (closes #17457, closes #17464)
authorSergey M․ <dstftw@gmail.com>
Fri, 7 Sep 2018 20:36:10 +0000 (03:36 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 7 Sep 2018 20:36:10 +0000 (03:36 +0700)
youtube_dl/extractor/youtube.py

index 0442906df5e02802747ae9ddc6f6bb4a909c5c85..27047425db6a121c0b5e39e11f597e82db26301a 100644 (file)
@@ -1178,7 +1178,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
     def _parse_sig_js(self, jscode):
         funcname = self._search_regex(
             (r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',
-             r'\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\('),
+             r'\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(',
+             r'yt\.akamaized\.net/\)\s*\|\|\s*.*?\s*c\s*&&\s*d\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',
+             r'\bc\s*&&\s*d\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\('),
             jscode, 'Initial JS player signature function name', group='sig')
 
         jsi = JSInterpreter(jscode)