Skip to content

Commit fb446b4

Browse files
committed
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
1 parent 94ed3fe commit fb446b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chat_downloader/sites/youtube.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ def _initialize_consent(self):
13661366
if self.get_cookie_value('__Secure-3PSID'):
13671367
return
13681368
socs = self.get_cookie_value('SOCS')
1369-
if socs and not socs.value.startswith('CAA'): # not consented
1369+
if socs and not str(socs).startswith('CAA'): # not consented
13701370
return
13711371
self.set_cookie_value('.youtube.com', 'SOCS', 'CAI', secure=True) # accept all (required for mixes)
13721372

0 commit comments

Comments
 (0)