X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Ftvigle.py;h=0921cc5f822f5bf0bcfefae8d6ef063e88f6e29d;hb=43f0537c06384b9b97235a93ea39649ee3de4d45;hp=eb826613dd419237a7cd540d5284fa69dc355b5c;hpb=fb8b8fdd628ef8f88f4e596c197f47c9fb42d93f;p=youtube-dl diff --git a/youtube_dl/extractor/tvigle.py b/youtube_dl/extractor/tvigle.py index eb826613d..0921cc5f8 100644 --- a/youtube_dl/extractor/tvigle.py +++ b/youtube_dl/extractor/tvigle.py @@ -7,25 +7,39 @@ from .common import InfoExtractor from ..utils import ( unified_strdate, clean_html, + int_or_none, ) class TvigleIE(InfoExtractor): IE_NAME = 'tvigle' IE_DESC = 'Интернет-телевидение Tvigle.ru' - _VALID_URL = r'http://(?:www\.)?tvigle\.ru/category/.+?video=(?P\d+)' + _VALID_URL = r'http://(?:www\.)?tvigle\.ru/category/.+?[\?&]v(?:ideo)?=(?P\d+)' - _TEST = { - 'url': 'http://www.tvigle.ru/category/cinema/1608/?video=503081', - 'md5': '09afba4616666249f087efc6dcf83cb3', - 'info_dict': { - 'id': '503081', - 'ext': 'flv', - 'title': 'Брат 2 ', - 'description': 'md5:f5a42970f50648cee3d7ad740f3ae769', - 'upload_date': '20110919', - } - } + _TESTS = [ + { + 'url': 'http://www.tvigle.ru/category/cinema/1608/?video=503081', + 'md5': '09afba4616666249f087efc6dcf83cb3', + 'info_dict': { + 'id': '503081', + 'ext': 'flv', + 'title': 'Брат 2 ', + 'description': 'md5:f5a42970f50648cee3d7ad740f3ae769', + 'upload_date': '20110919', + }, + }, + { + 'url': 'http://www.tvigle.ru/category/men/vysotskiy_vospominaniya02/?flt=196&v=676433', + 'md5': 'e7efe5350dd5011d0de6550b53c3ba7b', + 'info_dict': { + 'id': '676433', + 'ext': 'flv', + 'title': 'Ведущий телепрограммы «60 минут» (США) о Владимире Высоцком', + 'description': 'md5:027f7dc872948f14c96d19b4178428a4', + 'upload_date': '20121218', + }, + }, + ] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) @@ -42,7 +56,7 @@ class TvigleIE(InfoExtractor): description = clean_html(description) thumbnail = video_data.get('img') upload_date = unified_strdate(video.get('date')) - like_count = video.get('vtp') + like_count = int_or_none(video.get('vtp')) formats = [] for num, (format_id, format_note) in enumerate([['low_file', 'SQ'], ['file', 'HQ'], ['hd', 'HD 720']]): @@ -65,5 +79,6 @@ class TvigleIE(InfoExtractor): 'thumbnail': thumbnail, 'upload_date': upload_date, 'like_count': like_count, + 'age_limit': 18, 'formats': formats, } \ No newline at end of file