From b8b01bb92ad5399e655c0756a74902aefe7bc6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Thu, 1 May 2014 21:15:25 +0700 Subject: [PATCH] [newstube] Add support for newstube.ru (Closes #2814) --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/newstube.py | 87 ++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 youtube_dl/extractor/newstube.py 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'