From: Philipp Hagemeister Date: Sun, 25 Aug 2013 22:45:22 +0000 (-0700) Subject: Merge pull request #1310 from rzhxeo/rtlnow X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=90648143c315cc65b2449b72aec5025ff4e9ac17;hp=-c;p=youtube-dl Merge pull request #1310 from rzhxeo/rtlnow Add support for http://superrtlnow.de --- 90648143c315cc65b2449b72aec5025ff4e9ac17 diff --combined youtube_dl/extractor/rtlnow.py index 2f134e6a7,67f341bcc..7bb236c2b --- a/youtube_dl/extractor/rtlnow.py +++ b/youtube_dl/extractor/rtlnow.py @@@ -2,14 -2,11 +2,14 @@@ import re from .common import InfoExtractor -from ..utils import ExtractorError +from ..utils import ( + clean_html, + ExtractorError, +) class RTLnowIE(InfoExtractor): - """Information Extractor for RTLnow, RTL2now and VOXnow""" - _VALID_URL = r'(?:http://)?(?P(?Prtl(?:(?P2)|-)now\.rtl(?(is_rtl2)2|)\.de/|(?:www\.)?voxnow\.de/)[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\?(?:container_id|film_id)=(?P[0-9]+)&player=1(?:&season=[0-9]+)?(?:&.*)?)' + """Information Extractor for RTL NOW, RTL2 NOW, SUPER RTL NOW and VOX NOW""" + _VALID_URL = r'(?:http://)?(?P(?Prtl-now\.rtl\.de/|rtl2now\.rtl2\.de/|(?:www\.)?voxnow\.de/|(?:www\.)?superrtlnow\.de/)[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\?(?:container_id|film_id)=(?P[0-9]+)&player=1(?:&season=[0-9]+)?(?:&.*)?)' _TESTS = [{ u'url': u'http://rtl-now.rtl.de/ahornallee/folge-1.php?film_id=90419&player=1&season=1', u'file': u'90419.flv', @@@ -21,7 -18,6 +21,7 @@@ u'params': { u'skip_download': True, }, + u'skip': u'Only works from Germany', }, { u'url': u'http://rtl2now.rtl2.de/aerger-im-revier/episode-15-teil-1.php?film_id=69756&player=1&season=2&index=5', @@@ -35,7 -31,6 +35,7 @@@ u'params': { u'skip_download': True, }, + u'skip': u'Only works from Germany', }, { u'url': u'www.voxnow.de/voxtours/suedafrika-reporter-ii.php?film_id=13883&player=1&season=17', @@@ -48,6 -43,19 +48,19 @@@ u'params': { u'skip_download': True, }, + }, + { + u'url': u'http://superrtlnow.de/medicopter-117/angst.php?film_id=99205&player=1', + u'file': u'99205.flv', + u'info_dict': { + u'upload_date': u'20080928', + u'title': u'Medicopter 117 - Angst!', + u'description': u'Angst!', + u'thumbnail': u'http://autoimg.static-fra.de/superrtlnow/287529/1500x1500/image2.jpg' + }, + u'params': { + u'skip_download': True, + }, }] def _real_extract(self,url): @@@ -58,14 -66,6 +71,14 @@@ video_id = mobj.group(u'video_id') webpage = self._download_webpage(webpage_url, video_id) + + note_m = re.search(r'''(?sx) + (.*?) + ''', webpage) + if note_m: + msg = clean_html(note_m.group(1)) + raise ExtractorError(msg) + video_title = self._html_search_regex(r'(?P<title>[^<]+)', webpage, u'title') playerdata_url = self._html_search_regex(r'\'playerdata\': \'(?P[^\']+)\'',