X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flifenews.py;h=f8cbca7b36afab1890b71806d6761bbe67d7d924;hb=ab180fc648d331643aaf340c3cf7e92bcbb10bce;hp=4e4035b76a8de9697b99c367476ee372ee9bdb6c;hpb=ff6b7b049b14a061a362e701df8ab4b2f7b82456;p=youtube-dl diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dl/extractor/lifenews.py index 4e4035b76..f8cbca7b3 100644 --- a/youtube_dl/extractor/lifenews.py +++ b/youtube_dl/extractor/lifenews.py @@ -4,60 +4,165 @@ from __future__ import unicode_literals import re from .common import InfoExtractor -from ..utils import unified_strdate +from ..compat import compat_urlparse +from ..utils import ( + determine_ext, + int_or_none, + remove_end, + unified_strdate, + ExtractorError, +) class LifeNewsIE(InfoExtractor): IE_NAME = 'lifenews' IE_DESC = 'LIFE | NEWS' - _VALID_URL = r'http://lifenews\.ru/(?:mobile/)?news/(?P\d+)' - - _TEST = { + _VALID_URL = r'http://lifenews\.ru/(?:mobile/)?(?P
news|video)/(?P\d+)' + + _TESTS = [{ 'url': 'http://lifenews.ru/news/126342', - 'file': '126342.mp4', 'md5': 'e1b50a5c5fb98a6a544250f2e0db570a', 'info_dict': { + 'id': '126342', + 'ext': 'mp4', 'title': 'МВД разыскивает мужчин, оставивших в IKEA сумку с автоматом', 'description': 'Камеры наблюдения гипермаркета зафиксировали троих мужчин, спрятавших оружейный арсенал в камере хранения.', - 'thumbnail': 'http://lifenews.ru/static/posts/2014/1/126342/.video.jpg', + 'thumbnail': 're:http://.*\.jpg', 'upload_date': '20140130', } - } + }, { + # video in