Merge branch 'vgtv' of https://github.com/mrkolby/youtube-dl into mrkolby-vgtv
[youtube-dl] / youtube_dl / extractor / rtlnow.py
index 76a9704fd6481bede2c9eb2834c5b6f4ab34b11f..a45884b251fa355e04c65de554f0e9cbfb5406bb 100644 (file)
@@ -8,7 +8,6 @@ from ..utils import (
     ExtractorError,
     clean_html,
     unified_strdate,
-    parse_duration,
     int_or_none,
 )
 
@@ -93,16 +92,7 @@ class RTLnowIE(InfoExtractor):
         },
         {
             'url': 'http://www.n-tvnow.de/deluxe-alles-was-spass-macht/thema-ua-luxushotel-fuer-vierbeiner.php?container_id=153819&player=1&season=0',
-            'info_dict': {
-                'id': '153819',
-                'ext': 'flv',
-                'title': 'Deluxe - Alles was Spaß macht - Thema u.a.: Luxushotel für Vierbeiner',
-                'description': 'md5:c3705e1bb32e1a5b2bcd634fc065c631',
-                'thumbnail': 'http://autoimg.static-fra.de/ntvnow/383157/1500x1500/image2.jpg',
-                'upload_date': '20140221',
-                'duration': 2429,
-            },
-            'skip': 'Only works from Germany',
+            'only_matching': True,
         },
     ]
 
@@ -123,14 +113,16 @@ class RTLnowIE(InfoExtractor):
 
         upload_date = unified_strdate(self._html_search_meta('uploadDate', webpage, 'upload date'))
 
+        mobj = re.search(r'<meta itemprop="duration" content="PT(?P<seconds>\d+)S" />', webpage)
+        duration = int(mobj.group('seconds')) if mobj else None
+
         playerdata_url = self._html_search_regex(
             r"'playerdata': '(?P<playerdata_url>[^']+)'", webpage, 'playerdata_url')
 
         playerdata = self._download_xml(playerdata_url, video_id, 'Downloading player data XML')
 
         videoinfo = playerdata.find('./playlist/videoinfo')
-        duration = parse_duration(videoinfo.find('duration').text)
-
+        
         formats = []
         for filename in videoinfo.findall('filename'):
             mobj = re.search(r'(?P<url>rtmpe://(?:[^/]+/){2})(?P<play_path>.+)', filename.text)