未验证 提交 f6745c49 编写于 作者: K krichbanana 提交者: GitHub

[Youtube] Choose correct Live chat API for upcoming streams (#460)

Authored by: krichbanana
上级 109dd3b2
......@@ -2604,6 +2604,7 @@ def feed_entry(name):
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 @@ def process_language(container, base_url, lang_code, sub_name, query):
'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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册