[acast] fix extraction(#9117)
authorremitamine <remitamine@gmail.com>
Fri, 8 Apr 2016 13:51:00 +0000 (14:51 +0100)
committerremitamine <remitamine@gmail.com>
Fri, 8 Apr 2016 13:51:00 +0000 (14:51 +0100)
youtube_dl/extractor/acast.py

index 92eee8119da420a78782d5eea05a2d3564468d3a..79a17e73a68229beffe2ee4a71d3ba16d846e000 100644 (file)
@@ -26,13 +26,7 @@ class ACastIE(InfoExtractor):
 
     def _real_extract(self, url):
         channel, display_id = re.match(self._VALID_URL, url).groups()
-
-        embed_page = self._download_webpage(
-            re.sub('(?:www\.)?acast\.com', 'embedcdn.acast.com', url), display_id)
-        cast_data = self._parse_json(self._search_regex(
-            r'window\[\'acast/queries\'\]\s*=\s*([^;]+);', embed_page, 'acast data'),
-            display_id)['GetAcast/%s/%s' % (channel, display_id)]
-
+        cast_data = self._download_json('https://embed.acast.com/api/acasts/%s/%s' % (channel, display_id), display_id)
         return {
             'id': compat_str(cast_data['id']),
             'display_id': display_id,