[rtlnow] Fix duration extraction
authorSergey M. <dstftw@gmail.com>
Wed, 26 Feb 2014 10:49:49 +0000 (17:49 +0700)
committerSergey M. <dstftw@gmail.com>
Wed, 26 Feb 2014 10:49:49 +0000 (17:49 +0700)
youtube_dl/extractor/rtlnow.py

index 76a9704fd6481bede2c9eb2834c5b6f4ab34b11f..6ad402c28647364d5c349e738d63470a892b0876 100644 (file)
@@ -123,14 +123,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)