[youtube] Fix sigfunc name extraction (closes #23819)
authorSergey M․ <dstftw@gmail.com>
Thu, 23 Jan 2020 21:09:10 +0000 (04:09 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 23 Jan 2020 21:09:10 +0000 (04:09 +0700)
youtube_dl/extractor/youtube.py

index b913d07a63920de2c56570644f7b8175afd5fd8a..eacaa5ecdb70d2a16748b4c2e58edc14d7d69484 100644 (file)
@@ -1343,6 +1343,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         funcname = self._search_regex(
             (r'\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(',
              r'\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(',
+             r'\b(?P<sig>[a-zA-Z0-9$]{2})\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)',
              r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)',
              # Obsolete patterns
              r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',