From 83b20a970d9f3401eaab6f520d099b599f250d5d Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 23 Mar 2021 17:53:36 +0530 Subject: [PATCH] [youtube_live_chat] fix bug when trying to set cookies Closes #194 --- yt_dlp/downloader/youtube_live_chat.py | 3 +-- yt_dlp/extractor/youtube.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/downloader/youtube_live_chat.py b/yt_dlp/downloader/youtube_live_chat.py index 8e173d8b5..a6c13335e 100644 --- a/yt_dlp/downloader/youtube_live_chat.py +++ b/yt_dlp/downloader/youtube_live_chat.py @@ -79,8 +79,7 @@ class YoutubeLiveChatReplayFD(FragmentFD): self._prepare_and_start_frag_download(ctx) - success, raw_fragment = dl_fragment( - 'https://www.youtube.com/watch?v={}'.format(video_id)) + success, raw_fragment = dl_fragment(info_dict['url']) if not success: return False try: diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 6c93517d4..57300114d 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2150,6 +2150,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): # This will error if there is no livechat initial_data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] info['subtitles']['live_chat'] = [{ + '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_replay',