tubearchivist / browser-extension

Tube Archivist Companion for your Browser
GNU General Public License v3.0
150 stars 19 forks source link

Cookie sync fails #4

Closed hugalafutro closed 2 years ago

hugalafutro commented 2 years ago

Hi, trying to auto import cookie with extension yields validated: undefined

screenshot: image

logs from tubearchivist host:

cookie preview:

# Netscape HTTP Cookie File
# https://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file! Do not edit.

.youtube.com    TRUE    /       TRUE    [some numbers]      NID     [long-ass string]
cookie: activated and stored in Redis
validating cookie
cookie file is invalid
cookie validation failed, exiting...
cookie: revoked
cookie: {'cookie_import': 'fail', 'cookie_validated': False}
[pid: 46|app: 0|req: 81/81] 192.168.1.163 () {50 vars in 864 bytes} [Mon Jul 25 18:12:05 2022] PUT /api/cookie/ => generated 61 bytes in 23 msecs (HTTP/1.1 400) 9 headers in 357 bytes (1 switches on core 0)

I've no idea why TA says the cookie is invalid. I could try the manual import if you think that would make a difference, although I do not actually need the cookie functionality, I just wanted to test if the automatic cookie import works.

bbilly1 commented 2 years ago

Could it be that you aren't logged in to your google account? I had that once, maybe log out and back in there before you try again. Otherwise, you might want to give the manual import a go.

hugalafutro commented 2 years ago

I am logged in to 3 google accounts in gmail and 1 of those 3 on youtube. Could the multiple accounts be an issue? I'll give the manual import a go when I get home from work.

edit: also both the pc I access TA from and the vm TA runs inside are running behind mullvad vpn, both of them through different endpoint if that's of relevance?

bbilly1 commented 2 years ago

Yeah I can see how this will become a problem. I'm guessing that this will mangle all three together, then everything gets confused.

It works fine though with my multi accout container, but probably only with one google accout.

hugalafutro commented 2 years ago

When trying the manual export with the extension from the wiki it shows all these when I am on youtube and exports all those into file named youtube.com_cookies.txt. The first one is the one that gets sent by the extension and rejected and I'm not really sure which of the other ones to try. Or is it supposed to be all of them and rename the file to cookies.google.txt as in wiki example?

image

bbilly1 commented 2 years ago

Not sure, if and how this could be untangled. I'd say, best approach might be to log in to one google account on a clean browser, export the cookie the manual way, and import it into Tube Archivist.

Then you can still use the the browser extension for the rest of the functionality.

hugalafutro commented 2 years ago

I tried vivaldi on a windows 11 vm and chrome portable in which I never signed into any google account, and even before logging to youtube the cookies.txt extension already shows about 5 cookies on youtube, and after logging in about as many as in the pic above. Don't worry about it too much though, haven't come across a vid that'd need it, just was trying to be prepared in case I will.

bbilly1 commented 2 years ago

that will work. you will get cookies from most websites, even if you are not logged in. in my case, it shows 140 cookies for YouTube.com

Jerrk commented 2 years ago

Chromium v. 106.0.5249.119 i'm also getting this issue even after clearing all cookies and only being logged into one account.

logs:

cookie preview:

# Netscape HTTP Cookie File
# https://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file! Do not edit.

.youtube.com    TRUE    /       TRUE    0       YSC     MjBRkw0M1KA
.youtube.com    TRUE    /       FALSE   1700702052      CONSENT PENDING+243
consent.youtube.com     TRUE    /       FALSE   1668734053      OTZ     6730634_48_52_123900_48_436380
.youtub
cookie: activated and stored in Redis
validating cookie
cookie file is invalid
cookie validation failed, exiting...
cookie: revoked
cookie: {'cookie_import': 'fail', 'cookie_validated': False}
[pid: 38|app: 0|req: 136/136] 192.168.1.100 () {50 vars in 848 bytes} [Wed Oct 19 03:18:34 2022] PUT /api/cookie/ => generated 61 bytes in 56 msecs (HTTP/1.1 400) 9 headers in 357 bytes (1 switches on core 0)

I did a bit more testing and it appears to start working when i remove the cookie for consent.youtube.com

if that helps at all