aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornosoop <nosoop@users.noreply.github.com>2022-10-28 11:30:33 -0700
committerGitHub <noreply@github.com>2022-10-29 00:00:33 +0530
commit9da6612b0fc3a86b3aa207dd9f9d9379c6a62b92 (patch)
tree240681a1863e52973094e0f42317d1590c1f0383
parente63faa101cf7b9bf9f899cabb74ce03c7f893572 (diff)
downloadhypervideo-pre-9da6612b0fc3a86b3aa207dd9f9d9379c6a62b92.tar.lz
hypervideo-pre-9da6612b0fc3a86b3aa207dd9f9d9379c6a62b92.tar.xz
hypervideo-pre-9da6612b0fc3a86b3aa207dd9f9d9379c6a62b92.zip
[extractor/youtube] Fix `duration` for premieres (#5382)
Closes #5378 Authored by: nosoop
-rw-r--r--yt_dlp/extractor/youtube.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 719a151c4..77a8b93f3 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -3787,10 +3787,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
return self.playlist_result(
entries, video_id, video_title, video_description)
- duration = int_or_none(
- get_first(video_details, 'lengthSeconds')
- or get_first(microformats, 'lengthSeconds')
- or parse_duration(search_meta('duration'))) or None
+ duration = (int_or_none(get_first(video_details, 'lengthSeconds'))
+ or int_or_none(get_first(microformats, 'lengthSeconds'))
+ or parse_duration(search_meta('duration')) or None)
live_broadcast_details, live_status, streaming_data, formats, automatic_captions = \
self._list_formats(video_id, microformats, video_details, player_responses, player_url, duration)