From ce5c83508cf74b2402efe38c9df6ff26ca1da542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=95=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=80=D0=BE=D0=B2?= Date: Fri, 1 Jan 2016 18:19:16 +0300 Subject: [PATCH] added one new source --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/lenfilm.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 youtube_dl/extractor/lenfilm.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index b3f7059e4..7b1614871 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -328,6 +328,7 @@ from .kuwo import ( from .la7 import LA7IE from .laola1tv import Laola1TvIE from .lecture2go import Lecture2GoIE +from .lenfilm import LenFilmIE from .letv import ( LetvIE, LetvTvIE, diff --git a/youtube_dl/extractor/lenfilm.py b/youtube_dl/extractor/lenfilm.py new file mode 100644 index 000000000..db0ea84e0 --- /dev/null +++ b/youtube_dl/extractor/lenfilm.py @@ -0,0 +1,21 @@ +from .common import InfoExtractor +from re import match + + +class LenFilmIE(InfoExtractor): + _VALID_URL = r'(?:https?://)?(?:www\.)?lenfilm\.tv/(?P\w+)' + + def _real_extract(self, url): + mobj = match(self._VALID_URL, url) + video_id = mobj.group('id') + webpage_url = u'http://www.lenfilm.tv/' + video_id + webpage = self._download_webpage(webpage_url, video_id) + downloadPageLink = self._html_search_regex(r'[^<]*
[^<]*
[^<]*
[^<]*
[^<]*', webpage, u'download_page') + title = self._html_search_regex(r'(.*).*', webpage, u'title') + self.report_extraction(title) + downloadPage = self._download_webpage(downloadPageLink, video_id) + video_url = self._html_search_regex(r'