aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrichbanana <77071421+krichbanana@users.noreply.github.com>2021-07-01 20:29:29 -0400
committerGitHub <noreply@github.com>2021-07-02 05:59:29 +0530
commitf6745c4980415f7a0cf2c13866055c2935eab461 (patch)
tree2ebda5e13cf619da53c0e0d1c09acb617ddbfbc0
parent109dd3b23741710346cd9ba3a26e719693a02d50 (diff)
downloadhypervideo-pre-f6745c4980415f7a0cf2c13866055c2935eab461.tar.lz
hypervideo-pre-f6745c4980415f7a0cf2c13866055c2935eab461.tar.xz
hypervideo-pre-f6745c4980415f7a0cf2c13866055c2935eab461.zip
[Youtube] Choose correct Live chat API for upcoming streams (#460)
Authored by: krichbanana
-rw-r--r--yt_dlp/extractor/youtube.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 8ecc34a89..1233cc399 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -2604,6 +2604,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
or microformat.get('lengthSeconds')) \
or parse_duration(search_meta('duration'))
is_live = video_details.get('isLive')
+ is_upcoming = video_details.get('isUpcoming')
owner_profile_url = microformat.get('ownerProfileUrl')
info = {
@@ -2729,7 +2730,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'url': 'https://www.youtube.com/watch?v=%s' % video_id, # url is needed to set cookies
'video_id': video_id,
'ext': 'json',
- 'protocol': 'youtube_live_chat' if is_live else 'youtube_live_chat_replay',
+ 'protocol': 'youtube_live_chat' if is_live or is_upcoming else 'youtube_live_chat_replay',
}]
except (KeyError, IndexError, TypeError):
pass