Merge remote-tracking branch 'Dineshs91/f4m-2.0'
[youtube-dl] / youtube_dl / extractor / rtlnow.py
index e84919aa5784fe430a7eeaa13a9782547d2e95e2..285c3c4bebf8ec7c2cd793d2b40739222c18a5ca 100644 (file)
@@ -8,7 +8,6 @@ from ..utils import (
     ExtractorError,
     clean_html,
     unified_strdate,
-    parse_duration,
     int_or_none,
 )
 
@@ -82,7 +81,7 @@ class RTLnowIE(InfoExtractor):
                 'id': '99205',
                 'ext': 'flv',
                 'title': 'Medicopter 117 - Angst!',
-                'description': 'md5:895b1df01639b5f61a04fc305a5cb94d',
+                'description': 're:^Im Therapiezentrum \'Sonnalm\' kommen durch eine Unachtsamkeit die für die B.handlung mit Phobikern gehaltenen Voglespinnen frei\. Eine Ausreißerin',
                 'thumbnail': 'http://autoimg.static-fra.de/superrtlnow/287529/1500x1500/image2.jpg',
                 'upload_date': '20080928',
                 'duration': 2691,
@@ -92,18 +91,8 @@ class RTLnowIE(InfoExtractor):
             },
         },
         {
-            'url': 'http://www.n-tvnow.de/top-gear/episode-1-2013-01-01-00-00-00.php?film_id=124903&player=1&season=10',
-            'info_dict': {
-                'id': '124903',
-                'ext': 'flv',
-                'title': 'Top Gear vom 01.01.2013',
-                'description': 'Episode 1',
-                'upload_date': '20130101',
-            },
-            'params': {
-                'skip_download': True,
-            },
-            'skip': 'Only works from Germany',
+            'url': 'http://www.n-tvnow.de/deluxe-alles-was-spass-macht/thema-ua-luxushotel-fuer-vierbeiner.php?container_id=153819&player=1&season=0',
+            'only_matching': True,
         },
     ]
 
@@ -124,13 +113,15 @@ 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'):
@@ -162,4 +153,4 @@ class RTLnowIE(InfoExtractor):
             'upload_date': upload_date,
             'duration': duration,
             'formats': formats,
-        }
\ No newline at end of file
+        }