mirror of https://github.com/yt-dlp/yt-dlp.git
[youtube:tab] Extract video duration early
Based on: https://github.com/ytdl-org/youtube-dl/pull/29487 by glenn-slayden
This commit is contained in:
parent
052e135029
commit
a353beba83
|
@ -809,7 +809,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||||
video_id = renderer.get('videoId')
|
video_id = renderer.get('videoId')
|
||||||
title = self._get_text(renderer, 'title')
|
title = self._get_text(renderer, 'title')
|
||||||
description = self._get_text(renderer, 'descriptionSnippet')
|
description = self._get_text(renderer, 'descriptionSnippet')
|
||||||
duration = parse_duration(self._get_text(renderer, 'lengthText'))
|
duration = parse_duration(self._get_text(
|
||||||
|
renderer, 'lengthText', ('thumbnailOverlays', ..., 'thumbnailOverlayTimeStatusRenderer', 'text')))
|
||||||
view_count_text = self._get_text(renderer, 'viewCountText') or ''
|
view_count_text = self._get_text(renderer, 'viewCountText') or ''
|
||||||
view_count = str_to_int(self._search_regex(
|
view_count = str_to_int(self._search_regex(
|
||||||
r'^([\d,]+)', re.sub(r'\s', '', view_count_text),
|
r'^([\d,]+)', re.sub(r'\s', '', view_count_text),
|
||||||
|
|
Loading…
Reference in New Issue