mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-25 04:40:09 +09:00
Early extraction of duration metadata via playlist thumbnail overlay
Early gathering of item video durations from playlist metadata, prior to downloading individual item metadata pages, so that video duration values are (e.g.) shown in `--flat-playlist` or `--simulate`, and/or can be used as a download filtering criterion.
This commit is contained in:
parent
a803582717
commit
6a09bcde7c
@ -316,8 +316,12 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
description = try_get(
|
||||
renderer, lambda x: x['descriptionSnippet']['runs'][0]['text'],
|
||||
compat_str)
|
||||
duration = parse_duration(try_get(
|
||||
renderer, lambda x: x['lengthText']['simpleText'], compat_str))
|
||||
duration_text = try_get(
|
||||
renderer,
|
||||
(lambda x: x['lengthText']['simpleText'],
|
||||
lambda x: x['thumbnailOverlays'][0]['thumbnailOverlayTimeStatusRenderer']['text']['simpleText']),
|
||||
compat_str)
|
||||
duration = parse_duration(duration_text)
|
||||
view_count_text = try_get(
|
||||
renderer, lambda x: x['viewCountText']['simpleText'], compat_str) or ''
|
||||
view_count = str_to_int(self._search_regex(
|
||||
|
Loading…
Reference in New Issue
Block a user