]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/rtlnow.py
a45884b251fa355e04c65de554f0e9cbfb5406bb
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
  15 class RTLnowIE(InfoExtractor
): 
  16     """Information Extractor for RTL NOW, RTL2 NOW, RTL NITRO, SUPER RTL NOW, VOX NOW and n-tv NOW""" 
  24                                 (?:www\.)?rtlnitronow\.de| 
  25                                 (?:www\.)?superrtlnow\.de| 
  26                                 (?:www\.)?n-tvnow\.de) 
  27                             /+[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\? 
  28                             (?:container_id|film_id)=(?P<video_id>[0-9]+)& 
  29                             player=1(?:&season=[0-9]+)?(?:&.*)? 
  34             'url': 'http://rtl-now.rtl.de/ahornallee/folge-1.php?film_id=90419&player=1&season=1', 
  38                 'title': 'Ahornallee - Folge 1 - Der Einzug', 
  39                 'description': 'md5:ce843b6b5901d9a7f7d04d1bbcdb12de', 
  40                 'upload_date': '20070416', 
  44                 'skip_download': True, 
  46             'skip': 'Only works from Germany', 
  49             'url': 'http://rtl2now.rtl2.de/aerger-im-revier/episode-15-teil-1.php?film_id=69756&player=1&season=2&index=5', 
  53                 'title': 'Ärger im Revier - Ein junger Ladendieb, ein handfester Streit u.a.', 
  54                 'description': 'md5:3fb247005ed21a935ffc82b7dfa70cf0', 
  55                 'thumbnail': 'http://autoimg.static-fra.de/rtl2now/219850/1500x1500/image2.jpg', 
  56                 'upload_date': '20120519', 
  60                 'skip_download': True, 
  62             'skip': 'Only works from Germany', 
  65             'url': 'http://www.voxnow.de/voxtours/suedafrika-reporter-ii.php?film_id=13883&player=1&season=17', 
  69                 'title': 'Voxtours - Südafrika-Reporter II', 
  70                 'description': 'md5:de7f8d56be6fd4fed10f10f57786db00', 
  71                 'upload_date': '20090627', 
  75                 'skip_download': True, 
  79             'url': 'http://superrtlnow.de/medicopter-117/angst.php?film_id=99205&player=1', 
  83                 'title': 'Medicopter 117 - Angst!', 
  84                 'description': 'md5:895b1df01639b5f61a04fc305a5cb94d', 
  85                 'thumbnail': 'http://autoimg.static-fra.de/superrtlnow/287529/1500x1500/image2.jpg', 
  86                 'upload_date': '20080928', 
  90                 'skip_download': True, 
  94             'url': 'http://www.n-tvnow.de/deluxe-alles-was-spass-macht/thema-ua-luxushotel-fuer-vierbeiner.php?container_id=153819&player=1&season=0', 
  95             'only_matching': True, 
  99     def _real_extract(self
, url
): 
 100         mobj 
= re
.match(self
._VALID
_URL
, url
) 
 101         video_page_url 
= 'http://%s/' % mobj
.group('domain') 
 102         video_id 
= mobj
.group('video_id') 
 104         webpage 
= self
._download
_webpage
('http://' + mobj
.group('url'), video_id
) 
 106         mobj 
= re
.search(r
'(?s)<div style="margin-left: 20px; font-size: 13px;">(.*?)<div id="playerteaser">', webpage
) 
 108             raise ExtractorError(clean_html(mobj
.group(1)), expected
=True) 
 110         title 
= self
._og
_search
_title
(webpage
) 
 111         description 
= self
._og
_search
_description
(webpage
) 
 112         thumbnail 
= self
._og
_search
_thumbnail
(webpage
, default
=None) 
 114         upload_date 
= unified_strdate(self
._html
_search
_meta
('uploadDate', webpage
, 'upload date')) 
 116         mobj 
= re
.search(r
'<meta itemprop="duration" content="PT(?P<seconds>\d+)S" />', webpage
) 
 117         duration 
= int(mobj
.group('seconds')) if mobj 
else None 
 119         playerdata_url 
= self
._html
_search
_regex
( 
 120             r
"'playerdata': '(?P<playerdata_url>[^']+)'", webpage
, 'playerdata_url') 
 122         playerdata 
= self
._download
_xml
(playerdata_url
, video_id
, 'Downloading player data XML') 
 124         videoinfo 
= playerdata
.find('./playlist/videoinfo') 
 127         for filename 
in videoinfo
.findall('filename'): 
 128             mobj 
= re
.search(r
'(?P<url>rtmpe://(?:[^/]+/){2})(?P<play_path>.+)', filename
.text
) 
 131                     'url': mobj
.group('url'), 
 132                     'play_path': 'mp4:' + mobj
.group('play_path'), 
 133                     'page_url': video_page_url
, 
 134                     'player_url': video_page_url 
+ 'includes/vodplayer.swf', 
 138                     'url': filename
.text
, 
 141                 'width': int_or_none(filename
.get('width')), 
 142                 'height': int_or_none(filename
.get('height')), 
 143                 'vbr': int_or_none(filename
.get('bitrate')), 
 151             'description': description
, 
 152             'thumbnail': thumbnail
, 
 153             'upload_date': upload_date
, 
 154             'duration': duration
,