aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-10-14 07:41:53 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-10-14 07:41:53 +0530
commit6678a4f0b3074f41f02e968d1d48d7c64e48ef07 (patch)
tree43391a895b58a4346482fd38538f996357d636d6
parentd51b2816e33860f3e2a86bda431e31e48cb2e020 (diff)
downloadhypervideo-pre-6678a4f0b3074f41f02e968d1d48d7c64e48ef07.tar.lz
hypervideo-pre-6678a4f0b3074f41f02e968d1d48d7c64e48ef07.tar.xz
hypervideo-pre-6678a4f0b3074f41f02e968d1d48d7c64e48ef07.zip
[extractor/youtube] Fix live_status
Bug in 4d37720a0c5f1c9c4768ea20b0f943277f55bc12
-rw-r--r--yt_dlp/extractor/youtube.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 73c37ac90..857c9670c 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -3684,17 +3684,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
is_live = get_first(live_broadcast_details, 'isLiveNow')
live_content = get_first(video_details, 'isLiveContent')
is_upcoming = get_first(video_details, 'isUpcoming')
- if is_live is None and is_upcoming or live_content is False:
- is_live = False
- if is_upcoming is None and (live_content or is_live):
- is_upcoming = False
post_live = get_first(video_details, 'isPostLiveDvr')
live_status = ('post_live' if post_live
else 'is_live' if is_live
else 'is_upcoming' if is_upcoming
- else None if None in (is_live, is_upcoming, live_content)
- else 'was_live' if live_content else 'not_live')
-
+ else 'was_live' if live_content
+ else 'not_live' if False in (is_live, live_content)
+ else None)
streaming_data = traverse_obj(player_responses, (..., 'streamingData'), default=[])
*formats, subtitles = self._extract_formats_and_subtitles(streaming_data, video_id, player_url, live_status, duration)