[bambuser] Modernize
authorSergey M․ <dstftw@gmail.com>
Mon, 20 Apr 2015 16:33:35 +0000 (22:33 +0600)
committerSergey M․ <dstftw@gmail.com>
Mon, 20 Apr 2015 16:33:35 +0000 (22:33 +0600)
youtube_dl/extractor/bambuser.py

index c193e66cad7275cffb6ee96e051d567b9262e773..12673e766fd8fe8cee09e76c40138b13fa4e5804 100644 (file)
@@ -35,12 +35,11 @@ class BambuserIE(InfoExtractor):
     }
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        video_id = mobj.group('id')
-        info_url = ('http://player-c.api.bambuser.com/getVideo.json?'
-                    '&api_key=%s&vid=%s' % (self._API_KEY, video_id))
-        info_json = self._download_webpage(info_url, video_id)
-        info = json.loads(info_json)['result']
+        video_id = self._match_id(url)
+
+        info = self._download_json(
+            'http://player-c.api.bambuser.com/getVideo.json?api_key=%s&vid=%s'
+            % (self._API_KEY, video_id), video_id)['result']
 
         return {
             'id': video_id,