fixing cookie consent issue for EU countries

This commit is contained in:
simon 2021-09-14 19:49:05 +07:00
parent 33e0f826c9
commit f8b5b7c5bb

View File

@ -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: