X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fnewstube.py;h=dab4aec44a29614c02f34c8cb8668155e42ae60e;hb=HEAD;hp=a860350af1f0452ff4406f7ae156934d671e42ce;hpb=76bafa8ffe4631405bba17eb447f366b5c8ce734;p=youtube-dl diff --git a/youtube_dl/extractor/newstube.py b/youtube_dl/extractor/newstube.py index a860350af..dab4aec44 100644 --- a/youtube_dl/extractor/newstube.py +++ b/youtube_dl/extractor/newstube.py @@ -1,92 +1,83 @@ -# encoding: utf-8 +# coding: utf-8 from __future__ import unicode_literals -import re +import base64 +import hashlib from .common import InfoExtractor -from ..utils import ExtractorError +from ..aes import aes_cbc_decrypt +from ..utils import ( + bytes_to_intlist, + int_or_none, + intlist_to_bytes, + parse_codecs, + parse_duration, +) class NewstubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P.+)' _TEST = { - 'url': 'http://newstube.ru/media/na-korable-progress-prodolzhaetsya-testirovanie-sistemy-kurs', + 'url': 'http://www.newstube.ru/media/telekanal-cnn-peremestil-gorod-slavyansk-v-krym', + 'md5': '9d10320ad473444352f72f746ccb8b8c', 'info_dict': { - 'id': 'd156a237-a6e9-4111-a682-039995f721f1', - 'ext': 'flv', - 'title': 'На корабле «Прогресс» продолжается тестирование системы «Курс»', - 'description': 'md5:d0cbe7b4a6f600552617e48548d5dc77', - 'duration': 20.04, - }, - 'params': { - # rtmp download - 'skip_download': True, + 'id': '728e0ef2-e187-4012-bac0-5a081fdcb1f6', + 'ext': 'mp4', + 'title': 'Телеканал CNN переместил город Славянск в Крым', + 'description': 'md5:419a8c9f03442bc0b0a794d689360335', + 'duration': 31.05, }, } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_id = self._match_id(url) - page = self._download_webpage(url, video_id, 'Downloading page') + page = self._download_webpage(url, video_id) + title = self._html_search_meta(['og:title', 'twitter:title'], page, fatal=True) video_guid = self._html_search_regex( - r'