From f8b5b7c5bb62416922364c104e175338845720d7 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 14 Sep 2021 19:49:05 +0700 Subject: [PATCH] fixing cookie consent issue for EU countries --- tubearchivist/home/src/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index.py b/tubearchivist/home/src/index.py index 517df18..a4baeff 100644 --- a/tubearchivist/home/src/index.py +++ b/tubearchivist/home/src/index.py @@ -63,7 +63,10 @@ class YoutubeChannel: """ scrape channel page for additional infos """ channel_id = self.channel_id url = f'https://www.youtube.com/channel/{channel_id}/about?hl=en' - response = requests.get(url) + cookies = { + 'CONSENT': 'YES+xxxxxxxxxxxxxxxxxxxxxxxxxxx' + } + response = requests.get(url, cookies=cookies) if response.ok: channel_page = response.text else: