From 17d14e05f750faf2aa48a6b26e6608d20452f16d Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 23:29:41 +0300 Subject: [PATCH] fix premiere live chat They have isLiveContent = false so just check if the live chat renderer continuation exists --- youtube_dl/extractor/youtube.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index b91745d9d..47cc45910 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -2002,13 +2002,12 @@ class YoutubeIE(YoutubeBaseInfoExtractor): is_live = bool_or_none(video_details.get('isLive')) has_live_chat_replay = False - is_live_content = bool_or_none(video_details.get('isLiveContent')) - if not is_live and is_live_content: + if not is_live: yt_initial_data = self._get_yt_initial_data(video_id, video_webpage) try: yt_initial_data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] has_live_chat_replay = True - except (KeyError, IndexError): + except (KeyError, IndexError, TypeError): pass # Check for "rental" videos