mirror of
https://github.com/HanaokaYuzu/Gemini-API.git
synced 2026-04-12 20:31:03 -06:00
With the RotateCookies API it doesn't return __Secure-1PSIDTS and I see the cookie expire very quickly #97
Labels
No labels
advanced
advanced
bug
dependencies
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
model
pull-request
question
unreproducible
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mirrors/Gemini-API#97
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 @MinhtienBil on GitHub (Nov 5, 2025).
Response cookies: <Cookies[<Cookie __Secure-1PSIDCC=***** for .google.com />]>
⚠️ There is no cookie '__Secure-1PSIDTS' in the response.
2025-11-05 16:12:32.872 | DEBUG | app.Services.gemini.Gemini.src.gemini_webapi.client:start_auto_refresh:221 - Cookies refreshed. New __Secure-1PSIDTS: None
2025-11-05 16:12:33.682 | DEBUG | app.Services.gemini.Gemini.src.gemini_webapi.utils.get_access_token:get_access_token:92 - Skipping loading cached cookies. Cache file not found.
2025-11-05 16:12:33.700 | DEBUG | app.Services.gemini.Gemini.src.gemini_webapi.utils.get_access_token:get_access_token:131 - Skipping loading local browser cookies from firefox. __Secure-1PSID does not match the one provided.
2025-11-05 16:12:33.700 | DEBUG | app.Services.gemini.Gemini.src.gemini_webapi.utils.get_access_token:get_access_token:148 - Skipping loading local browser cookies. Login to gemini.google.com in your browser first.
2025-11-05 16:12:34.238 | DEBUG | app.Services.gemini.Gemini.src.gemini_webapi.utils.get_access_token:get_access_token:186 - Init attempt (1/1) failed. Cookies invalid.
is there any way to avoid this situation where there is an account there is an account there is no cookie response with __Secure-1PSIDTS
@kbykb commented on GitHub (Nov 5, 2025):
我是不会返回 __Secure-1PSIDTS 这个值
@MinhtienBil commented on GitHub (Nov 5, 2025):
So what should I do to keep the cookies from running out? Please give me a solution.
@kbykb commented on GitHub (Nov 5, 2025):
I haven't solved it yet. In fact, I am still in a state of cookie expiration from time to time, and I don't know how to refresh the cookie
@MinhtienBil commented on GitHub (Nov 6, 2025):
If you don't find __Secure-1PSIDTS in API RotateCookies, delete __Secure-1PSIDTS and SID then F5 the page and it will automatically add it.
@kbykb commented on GitHub (Nov 6, 2025):
Sorry, I didn't quite understand. Where exactly should I delete __Secure-1PSIDTS and SID, and where should I press F5? If you're referring to doing this in the browser, how does that relate to me later obtaining __Secure-1PSIDTS in the API?
@kbykb commented on GitHub (Nov 6, 2025):
get_1psidts.py
This is a script I wrote based on the project's code to retrieve __Secure-1PSIDTS. However, when I use it, I can only obtain several other cookies but cannot get a fresh __Secure-1PSIDTS.
@MinhtienBil commented on GitHub (Nov 6, 2025):
You just need to access https://myaccount.google.com/ and F12 after deleting the 1 and 2 in the image and F5 again in the network, you will see it load the API to call google.com/RotateCookies and your account will get __Secure-1PSIDTS
@MinhtienBil commented on GitHub (Nov 6, 2025):
Every time you call google.com/RotateCookies, __Secure-1PSIDTS will no longer exist, so you have to cache or update the original value you passed in.
@kbykb commented on GitHub (Nov 6, 2025):
Hello, I have followed your instructions exactly, but my response headers only contain the following cookies and do not include __Secure-1PSIDTS.
@MinhtienBil commented on GitHub (Nov 6, 2025):
Have you made sure that when you F5 again, the network has loaded the RotateCookies API because when you delete it, it will automatically add __Secure-1PSIDTS again, causing it to not work.
@kbykb commented on GitHub (Nov 6, 2025):
I've also noticed another situation: if I use a fingerprint browser or an incognito browser, deleting the SID and then pressing F5 causes the account to be logged out directly.
@MinhtienBil commented on GitHub (Nov 6, 2025):
@kbykb commented on GitHub (Nov 6, 2025):
Thank you so much! I've noticed a weird phenomenon: the refresh only works successfully when I delete these two cookies in my regular Chrome browser. Other methods, like using an incognito browser or a fingerprint browser, all fail. I can't figure out the reason yet, but at least it's working for now.