Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yt-dlp/yt-dlp into ytdlp
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/yt-dlp/yt-dlp:
  [extractor/youtube] Fix `duration` for premieres (#5382)
  • Loading branch information
Lesmiscore committed Oct 29, 2022
2 parents 1dce16f + 9da6612 commit ebfeccd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3820,10 +3820,9 @@ def feed_entry(name):
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)
Expand Down

0 comments on commit ebfeccd

Please sign in to comment.