-
-
Notifications
You must be signed in to change notification settings - Fork 527
Always include "__Secure-1PSIDTS" to avoid the "SNlM0e value not found" error. #254
Conversation
It seems that it doesn't need the whole cookies. But it always needs |
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
- | Google Bard API Key | b1aa195 | func_test.ipynb | View secret |
- | Generic High Entropy Secret | b1aa195 | bardapi/core_async.py | View secret |
- | Generic High Entropy Secret | b1aa195 | bardapi/core_async.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-cookie-bard Hello. Thank you very much for your wonderful contribution. Regarding the cookie values, I have confirmed that in some regions, it is necessary to use two or three or more cookies. This has been addressed through Multi-cookies Bard. (Especially, users in China and Japan have reported this) Generally, in most regions, accounts, and countries, a single cookie value is sufficient for a normal response, so I need to be a bit more cautious in accepting this PR. (The current code enforces the use of two cookie values) Therefore, I will give this PR further consideration. Thank you for your ideas and work. |
OK. Then, for token from browser, I think that it should get the 3 cookies if it exists, not just |
Thank you once again for your feedback. I will check to ensure that auto cookies can refresh three cookies. Also, please reconfirm if the issue you raised cannot be solved with multi-cookie bard as described here: https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-cookie-bard As shown in the example, assigning three cookies to a session object and passing it to bard should make it possible to use the Bard class with the intended functionality of using three cookie values. Looking forward to your feedback. Thank you. |
I welcome the overall code refactoring and new features. However, please make sure to conduct QA. Before making a PR, please check the entire functionality by adding it to https://github.com/dsdanielpark/Bard-API/blob/main/func_test.ipynb. Due to various reasons, I couldn't implement test mocking code. I also welcome anyone who can provide test mocking and refactoring. But please keep the existing method names and examples. While I aim to accept PRs as quickly as possible, they may be rejected if QA is not correct.
BARD-API Pull Request Template
Please provide the necessary information as succinctly as possible. I appreciate it if you write it in an easy-to-read format as I don't have much time to dedicate to maintaining this package.
Description
Always include
__Secure-1PSIDTS
to avoid the "SNlM0e value not found" error.If it uses
__Secure-1PSID
only, it will soon meet theSNlM0e value not found
.If it uses
__Secure-1PSID
and__Secure-1PSIDTS
together, it won't.Related Issue
#155
Motivation and Context
#155
I meet the
SNlM0e value not found
just after a few minutes. The__Secure-1PSID
is not changed yet in the browser. But the Bard-API reports the problem. I found that using__Secure-1PSID
and__Secure-1PSIDTS
together will avoid this problem.And also, I found some limitation of browser_cookie3.
I have cookies for .google.com.hk. But it filter the cookies by
like
sql. So the .google.com.hk and .google.com cookies are both in the results. The .google.com.hk cookie will override the .google.com cookie. It may cause the Bard API use the wrong values from .google.com.hk.The problem comes from browser_cookie3. So this problem I can't find a way to fix it unless I delete the .google.com.hk cookies.
How Has This Been Tested?
I tested the sync version. It's working.
But the async version is not tested.
Because I found some problem even with the orignal one.
Thank you once again to all the contributors. Your efforts are greatly appreciated!