Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix youtube cookie consent check (#238) #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix youtube cookie consent check (#238)
before this fix, python 3.11 would fail like this:
AttributeError: 'str' object has no attribute 'value'

assuming that socs.value is the correct way to retrieve the value in
some versions of python, avoid the issue by casting to string
9001 committed Feb 7, 2024
commit fb446b49825ffd4a94d56f3c3138cd0dea5e1ec2
2 changes: 1 addition & 1 deletion chat_downloader/sites/youtube.py
Original file line number Diff line number Diff line change
@@ -1366,7 +1366,7 @@ def _initialize_consent(self):
if self.get_cookie_value('__Secure-3PSID'):
return
socs = self.get_cookie_value('SOCS')
if socs and not socs.value.startswith('CAA'): # not consented
if socs and not str(socs).startswith('CAA'): # not consented
return
self.set_cookie_value('.youtube.com', 'SOCS', 'CAI', secure=True) # accept all (required for mixes)