Update vube.py
authortinybug <tinybug1991@gmail.com>
Thu, 7 Aug 2014 03:24:51 +0000 (11:24 +0800)
committertinybug <tinybug1991@gmail.com>
Thu, 7 Aug 2014 03:24:51 +0000 (11:24 +0800)
fix extractor is broken #3459

youtube_dl/extractor/vube.py

index f1b9e9a19d05d9026feb24b6f22d395cd3990e5f..109c4b459b77a96402e44bd474ee756257924cf4 100644 (file)
@@ -71,12 +71,8 @@ class VubeIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
 
-        webpage = self._download_webpage(url, video_id)
-        data_json = self._search_regex(
-            r'(?s)window\["(?:tapiVideoData|vubeOriginalVideoData)"\]\s*=\s*(\{.*?\n});\n',
-            webpage, 'video data'
-        )
-        data = json.loads(data_json)
+        json_url = 'http://vube.com/t-api/v1/video/%s?country=US&limit=120&region=US' % video_id
+        data = self._download_json(json_url, video_id)
         video = (
             data.get('video') or
             data)