Closed a-sajjad72 closed 1 day ago
My bad, I oversighted the Warning which shows PermissionError
. This is due to the LockProfileCookieDatabase
feature in Chromium based browsers. The work around is to close the browser then run it will work fine. But need to close the running browser everytime when the program should be run.
What would I suggest to save the cookies values in a file so that it can be used for the next time without retrieving them from the browser.
EDIT: I tired it but this issue occurs gemini_webapi.exceptions.AuthError: Failed to initialize client. SECURE_1PSIDTS could get expired frequently, please make sure cookie values are up to date.
The below-mentioned is only the automated way I guess.
@HanaokaYuzu What do you think about the shadowcopy
as discussed here? There is also PR for that but not pushed yet.
Actually the current mechanism does exactly what you suggested: when client is successfully initialized, the valid cookie value will be stored to a local file and keeps updating in background when client is running. Later every time the client tries to initialize, the stored cookie will be used even if browser_cookie3 raises an error.
If your client initialized successfully but browser_cookie3 raised an error, it shouldn't affect the client's functionality and can be ignored (or even uninstalled)
Actually the current mechanism does exactly what you suggested: when client is successfully initialized, the valid cookie value will be stored to a local file and keeps updating in background when client is running. Later every time the client tries to initialize, the stored cookie will be used even if browser_cookie3 raises an error.
If your client initialized successfully but browser_cookie3 raised an error, it shouldn't affect the client's functionality and can be ignored (or even uninstalled)
but the client not inialize when the chromium browsers are running. it failed to get the cookie files. the client only successfully initialized when the browser is closed successfully. This behaviour is happened when gemini_webapi.GeminiClient()
used instead of providing cookie values manually.
Implemented an enhancement in v1.6.1. Now after a successful initialization, GeminiClient()
should automatically use cached cookies regardless of whether cookie values are passed manually. Note that you may still need to quit browser for the first time.
I am experiencing issues while initiating a connection to Gemini using
GeminiClient()
. I had tried it on two machines with two different browsers.It gives error of
ValueError: Failed to load cookies from local browser. Please pass cookie values manually.
By passing the values manually it works like a charm.I am not sure whether I post this issue here or on
browser-cookie3
repo. I will give you more details if you need any information to resolve this issue. Thank You 😃Warm Regards, Sajjad Ali
Traceback