diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-02 21:44:49 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-02 21:44:49 +0800 |
commit | 03116772583103ba97eaf8ce2cbabba9742e1929 (patch) | |
tree | 6c802fa31cd0808b43173dcc207dd1d73125f05f /youtube_dl/extractor/baidu.py | |
parent | a1d9f6c5dc15f1d62e0ab8c9dd6feaed4ff83a34 (diff) |
[baidu] Add notes for API calls
Diffstat (limited to 'youtube_dl/extractor/baidu.py')
-rw-r--r-- | youtube_dl/extractor/baidu.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/youtube_dl/extractor/baidu.py b/youtube_dl/extractor/baidu.py index d60cb0fdd..d35116a7c 100644 --- a/youtube_dl/extractor/baidu.py +++ b/youtube_dl/extractor/baidu.py @@ -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']: |