mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-13 14:37:43 +01:00
[rtlnow] Fix duration extraction
This commit is contained in:
parent
995befe0e9
commit
33f1f2c455
@ -123,14 +123,16 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
upload_date = unified_strdate(self._html_search_meta('uploadDate', webpage, 'upload date'))
|
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(
|
playerdata_url = self._html_search_regex(
|
||||||
r"'playerdata': '(?P<playerdata_url>[^']+)'", webpage, 'playerdata_url')
|
r"'playerdata': '(?P<playerdata_url>[^']+)'", webpage, 'playerdata_url')
|
||||||
|
|
||||||
playerdata = self._download_xml(playerdata_url, video_id, 'Downloading player data XML')
|
playerdata = self._download_xml(playerdata_url, video_id, 'Downloading player data XML')
|
||||||
|
|
||||||
videoinfo = playerdata.find('./playlist/videoinfo')
|
videoinfo = playerdata.find('./playlist/videoinfo')
|
||||||
duration = parse_duration(videoinfo.find('duration').text)
|
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for filename in videoinfo.findall('filename'):
|
for filename in videoinfo.findall('filename'):
|
||||||
mobj = re.search(r'(?P<url>rtmpe://(?:[^/]+/){2})(?P<play_path>.+)', filename.text)
|
mobj = re.search(r'(?P<url>rtmpe://(?:[^/]+/){2})(?P<play_path>.+)', filename.text)
|
||||||
|
Loading…
Reference in New Issue
Block a user