[rtlnow] Fix duration extraction

pull/2447/merge
Sergey M. 2014-02-26 17:49:49 +07:00
parent 995befe0e9
commit 33f1f2c455
1 changed files with 4 additions and 2 deletions

View File

@ -123,13 +123,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'):