aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-01-20 17:57:20 +0700
committerSergey M․ <dstftw@gmail.com>2018-01-20 17:57:20 +0700
commite7f3529f68ee7c8ca78366d37f851cb31fa00f31 (patch)
tree4c78f54a19a348ab8bdfc3b9048142379b025e0a
parent7d5406216ae061d11815a8e8a97ad6617eeaab38 (diff)
[youtube:live] Improve live detection (closes #15365)
-rw-r--r--youtube_dl/extractor/youtube.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index a01ec1436..f698a5627 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -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)