From 9c3fe2ef809006e69b4fd4ed9ff63e9fe57f5e8d Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 3 Feb 2021 02:22:27 +0530 Subject: [PATCH] [youtube_live_chat] Fix URL Bug introduced by 82e3f6ebda56c84166494e157e0f856467ca5581 :ci skip dl --- youtube_dlc/downloader/youtube_live_chat.py | 9 ++++++--- youtube_dlc/extractor/youtube.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/youtube_dlc/downloader/youtube_live_chat.py b/youtube_dlc/downloader/youtube_live_chat.py index f162aff9c..3887fb371 100644 --- a/youtube_dlc/downloader/youtube_live_chat.py +++ b/youtube_dlc/downloader/youtube_live_chat.py @@ -94,9 +94,12 @@ def download_and_parse_fragment(url, frag_index): frag_index = offset = 0 while continuation_id is not None: frag_index += 1 - url = 'https://www.youtube.com/live_chat_replay?continuation=%s' % continuation_id - if frag_index > 1: - url += '&playerOffsetMs=%d&hidden=false&pbj=1' % max(offset - 5000, 0) + url = ''.join(( + 'https://www.youtube.com/live_chat_replay', + '/get_live_chat_replay' if frag_index > 1 else '', + '?continuation=%s' % continuation_id, + '&playerOffsetMs=%d&hidden=false&pbj=1' % max(offset - 5000, 0) if frag_index > 1 else '')) + print(url) success, continuation_id, offset = download_and_parse_fragment(url, frag_index) if not success: return False diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index 9b7177694..0e6739323 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -3404,7 +3404,7 @@ def _extract_uploader(data): uploader['uploader_url'] = urljoin( 'https://www.youtube.com/', try_get(owner, lambda x: x['navigationEndpoint']['browseEndpoint']['canonicalBaseUrl'], compat_str)) - return {k:v for k, v in uploader.items() if v is not None} + return {k: v for k, v in uploader.items() if v is not None} def _extract_from_tabs(self, item_id, webpage, data, tabs, identity_token): playlist_id = title = description = channel_url = channel_name = channel_id = None