[baidu] Add notes for API calls
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 2 Jan 2016 13:44:49 +0000 (21:44 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 2 Jan 2016 13:44:49 +0000 (21:44 +0800)
youtube_dl/extractor/baidu.py

index d60cb0fdd352a2a4ede35712f3d6f3297f6ffe53..d35116a7cb412c236977ff84829966b996faf57f 100644 (file)
@@ -28,8 +28,9 @@ class BaiduVideoIE(InfoExtractor):
         'playlist_mincount': 12,
     }]
 
-    def _call_api(self, path, category, playlist_id):
-        return self._download_json('http://app.video.baidu.com/%s/?worktype=adnative%s&id=%s' % (path, category, playlist_id), playlist_id)
+    def _call_api(self, path, category, playlist_id, note):
+        return self._download_json('http://app.video.baidu.com/%s/?worktype=adnative%s&id=%s' % (
+            path, category, playlist_id), playlist_id, note)
 
     def _real_extract(self, url):
         category, playlist_id = re.match(self._VALID_URL, url).groups()
@@ -38,12 +39,14 @@ class BaiduVideoIE(InfoExtractor):
         if category == 'tv':
             category = 'tvplay'
 
-        playlist_detail = self._call_api('xqinfo', category, playlist_id)
+        playlist_detail = self._call_api(
+            'xqinfo', category, playlist_id, 'Download playlist JSON metadata')
 
         playlist_title = playlist_detail['title']
         playlist_description = unescapeHTML(playlist_detail.get('intro'))
 
-        episodes_detail = self._call_api('xqsingle', category, playlist_id)
+        episodes_detail = self._call_api(
+            'xqsingle', category, playlist_id, 'Download episodes JSON metadata')
 
         entries = []
         for episode in episodes_detail['videos']: