From: Sergey M․ Date: Thu, 1 May 2014 14:15:25 +0000 (+0700) Subject: [newstube] Add support for newstube.ru (Closes #2814) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=b8b01bb92ad5399e655c0756a74902aefe7bc6a7;p=youtube-dl [newstube] Add support for newstube.ru (Closes #2814) --- diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index e27cd2d2d..09209a739 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -180,6 +180,7 @@ from .nbc import ( from .ndr import NDRIE from .ndtv import NDTVIE from .newgrounds import NewgroundsIE +from .newstube import NewstubeIE from .nfb import NFBIE from .nhl import NHLIE, NHLVideocenterIE from .niconico import NiconicoIE diff --git a/youtube_dl/extractor/newstube.py b/youtube_dl/extractor/newstube.py new file mode 100644 index 000000000..119414da0 --- /dev/null +++ b/youtube_dl/extractor/newstube.py @@ -0,0 +1,87 @@ +# encoding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor + + +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', + 'info_dict': { + 'id': 'd156a237-a6e9-4111-a682-039995f721f1', + 'ext': 'flv', + 'title': 'На корабле «Прогресс» продолжается тестирование системы «Курс»', + 'description': 'md5:d0cbe7b4a6f600552617e48548d5dc77', + 'duration': 20.04, + }, + 'params': { + # rtmp download + 'skip_download': True, + }, + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + page = self._download_webpage(url, video_id, 'Downloading page') + + video_guid = self._html_search_regex( + r'