Browse Source

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

master-ytdl-org
Sergey M․ 7 years ago
parent
commit
e7f3529f68
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      youtube_dl/extractor/youtube.py

+ 3
- 2
youtube_dl/extractor/youtube.py View File

@ -2530,10 +2530,11 @@ class YoutubeLiveIE(YoutubeBaseInfoExtractor):
webpage = self._download_webpage(url, channel_id, fatal=False)
if webpage:
page_type = self._og_search_property(
'type', webpage, 'page type', default=None)
'type', webpage, 'page type', default='')
video_id = self._html_search_meta(
'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(base_url)


Loading…
Cancel
Save