mirror of
https://github.com/tubearchivist/browser-extension.git
synced 2026-03-23 20:37:07 +00:00
[GH-ISSUE #22] Cookie import fails with "validated: undefined" #15
Labels
No labels
bug
bug
duplicate
enhancement
help wanted
invalid
not an issue
not an issue
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tubearchivist/archived-browser-extension#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EpicLPer on GitHub (Aug 14, 2023).
Original GitHub issue: https://github.com/tubearchivist/browser-extension/issues/22
Heya,
I just tried importing my cookies and I'm getting the following error inside the browser extension:

In the Inspect tab I get the message
{"message":{"cookie_import":"fail","cookie_validated":false}}, the network tab tells me a400 Bad Requestoccured.Not sure if I'm doing something wrong (again) tho :)
Thanks already!
@bbilly1 commented on GitHub (Aug 17, 2023):
Impossible to say without logs what's happening. Probably means invalid cookie? Sometimes doing this from a blank browser can help, where there has always only been one google account used. Or you can also use the manual import.
@DutchEllie commented on GitHub (Aug 17, 2023):
I have the same issue, have been having it since forever and always just manually added the cookie, very annoying.
This is the log from when I tried to add the cookie using the extension:
It seems to just send bad data, not actually the full cookies file like it needs.
@bbilly1 commented on GitHub (Aug 17, 2023):
A cookie is valid, if TA can access your liked videos playlist, e.g.
https://www.youtube.com/playlist?list=LL. If it can't access that, it's invalid and revoked as you can see in your output.One of these cases of works on my machine. If it doesn't work for you, please provide a fix.
@bbilly1 commented on GitHub (Aug 17, 2023):
Please be nice.
@grantterra commented on GitHub (Sep 3, 2023):
I had the same issue.
I compared the original cookies stored in the browser, and it seems that TubeArchivist did not receive the last 54 characters in the cookie value.
@3urobeat commented on GitHub (Oct 8, 2023):
I'm also experiencing this issue for months now.
It did work as expected back in June and then suddenly failed.
Tubearchivist on my server, as well as the browser extension, are on the newest versions.
I have deleted all my YouTube cookies, did a fresh login - also no success.
I'm using
LibreWolf Firefox 118.0.1-1onLinux 6.5.5-arch1-1Edit: I can confirm the observation by grantterra, the cookie extracted by the extension is too short. After exporting the cookie manually, placing it in the
importdirectory, enabling cookies and reindexing, my playlist it is active again.@clb92 commented on GitHub (Oct 14, 2023):
I'm experiencing this in Chrome, but not in Firefox.
@bbilly1 commented on GitHub (Oct 19, 2023):
and
as well as
you'll see in your log output
cookie preview. so what is logged is only the first 200 characters (I think) from the complete cookie. as that is sensitive data, so this shouldn't be logged completely somewhere...cookie building happens in background.js here: https://github.com/tubearchivist/browser-extension/blob/master/extension/background.js#L209
if anybody wants to investigate further.
@nzp-hu commented on GitHub (Oct 21, 2023):
I have cross-checked the sent data with something generated by the cookies.txt extension and narrowed it down to the "subdomains" field in the buildCookieLine function.
I assume it clashes with
cookie.securein some cases.Changing this to something like
cookie.hostOnly ? 'FALSE' : 'TRUE',seems to resolve the issue for me.Tested based on the cookies.txt cookie builder snippet which has some additional support for
#HttpOnly_as well, which might be useful.They also seem to use
secureinstead ofhttpOnly. Which(, to me,) seems to match the file spec.To test, I overrode the
buildCookieLine()function (while at a break point insendCookies()) with the following modified snippet:If someone could validate it from their side, it would be great. I would really love this functionality. :)
@bbilly1 commented on GitHub (Nov 10, 2023):
Some investigation on the live stream could point towards that we limit our domain selection too much, and that www.youtube.com will get excluded.
notes: https://github.com/Rob--W/cookie-manager/issues/26
some traceback:
@Gentoli commented on GitHub (Mar 1, 2024):
For me, looks like the extension included a cookie from the subdomain
payments.youtube.comand yt-dlp is not happy with that. Removing it from thePOST /api/cookie/works.Because the validation is done by yt-dlp, before https://github.com/tubearchivist/tubearchivist/pull/669 which would log the error in the console, you could try capturing the cookie file sent by the extension from the extension developer console, then testing it with downloading any youtube video with a noop arg like
-F, then it would give error like:@bbilly1 commented on GitHub (Mar 10, 2024):
Interesting, would make sense that I can't reproduce this, I probably won't have any payment subdomain cookies if I didn't make any payments on YT. Will ignoring all subdomains work? Or does this need some other processing?
@Gentoli commented on GitHub (Mar 10, 2024):
Given yt-dlp is rejecting cookies from the subdomains, I think it's safe to remove all subdomains.
@CommanderRedYT commented on GitHub (Mar 26, 2024):
I do not have any cookies on subdomains but it still fails. Both on firefox and chrome and with different accounts
@wolrah commented on GitHub (Mar 27, 2024):
I can confirm that removing the payments.youtube.com cookie solved the problem for me.
@bbilly1 commented on GitHub (May 1, 2024):
Can somebody who can reproduce this check if the linked commit on the https://github.com/tubearchivist/browser-extension/tree/fix-cookie-domain branch fixes that?
This still syncs the cookie correctly for me.
@bbilly1 commented on GitHub (May 11, 2024):
assuming this has been fixed, update to v0.3.0
@ccfman2004 commented on GitHub (Jan 24, 2025):
Seems this issue is back on both Firefox and Chrome. It stopped working on Firefox a few weeks ago but Chrome was working. Now neither are working.