[mixcloud] Fix extraction (closes #13958)
authorSergey M․ <dstftw@gmail.com>
Fri, 18 Aug 2017 16:31:42 +0000 (23:31 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 18 Aug 2017 16:31:42 +0000 (23:31 +0700)
youtube_dl/extractor/mixcloud.py

index fcf7beeb25af5e5b9394e448519a891ce46d1f2d..798968ae3dd8a7c16ede20eb7e328c848e61b8b9 100644 (file)
@@ -91,12 +91,14 @@ class MixcloudIE(InfoExtractor):
             if js_url:
                 js = self._download_webpage(js_url, track_id, fatal=False)
                 if js:
-                    key = self._search_regex(
-                        r'player\s*:\s*{.*?\bvalue\s*:\s*(["\'])(?P<key>(?:(?!\1).)+)\1',
-                        js, 'key', default=None, group='key')
-                    if key and isinstance(key, compat_str):
-                        self._keys.insert(0, key)
-                        self._current_key = key
+                    KEY_RE_TEMPLATE = r'player\s*:\s*{.*?\b%s\s*:\s*(["\'])(?P<key>(?:(?!\1).)+)\1'
+                    for key_name in ('value', 'key_value'):
+                        key = self._search_regex(
+                            KEY_RE_TEMPLATE % key_name, js, 'key',
+                            default=None, group='key')
+                        if key and isinstance(key, compat_str):
+                            self._keys.insert(0, key)
+                            self._current_key = key
 
         message = self._html_search_regex(
             r'(?s)<div[^>]+class="global-message cloudcast-disabled-notice-light"[^>]*>(.+?)<(?:a|/div)',