diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index e27cd2d2d5..09209a7396 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 0000000000..119414da02 --- /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'