1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-23 00:07:49 +00:00

[youtube:live] Improve live detection (closes #15365)

This commit is contained in:
Sergey M․ 2018-01-20 17:57:20 +07:00
parent 7d5406216a
commit e7f3529f68
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -2530,10 +2530,11 @@ class YoutubeLiveIE(YoutubeBaseInfoExtractor):
webpage = self._download_webpage(url, channel_id, fatal=False) webpage = self._download_webpage(url, channel_id, fatal=False)
if webpage: if webpage:
page_type = self._og_search_property( page_type = self._og_search_property(
'type', webpage, 'page type', default=None) 'type', webpage, 'page type', default='')
video_id = self._html_search_meta( video_id = self._html_search_meta(
'videoId', webpage, 'video id', default=None) 'videoId', webpage, 'video id', default=None)
if page_type == 'video' and video_id and re.match(r'^[0-9A-Za-z_-]{11}$', video_id): if page_type.startswith('video') and video_id and re.match(
r'^[0-9A-Za-z_-]{11}$', video_id):
return self.url_result(video_id, YoutubeIE.ie_key()) return self.url_result(video_id, YoutubeIE.ie_key())
return self.url_result(base_url) return self.url_result(base_url)