X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Ftudou.py;h=161e47624b383dfe76ea1e2ea6ec73395a97db53;hb=1139a54d9bb9d214a8451301a44af6d03dd450b7;hp=a85065121f8fc7937e157ec99817cda9d436ab67;hpb=329818484ce44229835f4b2b02006120b0d81bcf;p=youtube-dl diff --git a/youtube_dl/extractor/tudou.py b/youtube_dl/extractor/tudou.py index a85065121..161e47624 100644 --- a/youtube_dl/extractor/tudou.py +++ b/youtube_dl/extractor/tudou.py @@ -19,6 +19,14 @@ class TudouIE(InfoExtractor): 'title': '卡马乔国足开大脚长传冲吊集锦', 'thumbnail': 're:^https?://.*\.jpg$', } + }, { + 'url': 'http://www.tudou.com/programs/view/ajX3gyhL0pc/', + 'info_dict': { + 'id': '117049447', + 'ext': 'f4v', + 'title': 'La Sylphide-Bolshoi-Ekaterina Krysanova & Vyacheslav Lopatin 2012', + 'thumbnail': 're:^https?://.*\.jpg$', + } }, { 'url': 'http://www.tudou.com/albumplay/TenTw_JgiPM/PzsAs5usU9A.html', 'info_dict': { @@ -28,12 +36,12 @@ class TudouIE(InfoExtractor): 'skip': 'Only works from China' }] - def _url_for_id(self, id, quality = None): - info_url = "http://v2.tudou.com/f?id="+str(id) + def _url_for_id(self, id, quality=None): + info_url = "http://v2.tudou.com/f?id=" + str(id) if quality: info_url += '&hd' + quality webpage = self._download_webpage(info_url, id, "Opening the info webpage") - final_url = self._html_search_regex('>(.+?)',webpage, 'video url') + final_url = self._html_search_regex('>(.+?)', webpage, 'video url') return final_url def _real_extract(self, url): @@ -65,7 +73,7 @@ class TudouIE(InfoExtractor): result = [] len_parts = len(parts) if len_parts > 1: - self.to_screen(u'%s: found %s parts' % (video_id, len_parts)) + self.to_screen('%s: found %s parts' % (video_id, len_parts)) for part in parts: part_id = part['k'] final_url = self._url_for_id(part_id, quality)