dsdanielpark / Bard-API

The unofficial python package that returns response of Google Bard through cookie value.
https://pypi.org/project/bardapi/
MIT License
5.33k stars 529 forks source link

Exception: SNlM0e value not found in response. Check __Secure-1PSID value. #247

Closed M16051997 closed 9 months ago

M16051997 commented 9 months ago

import bardapi from bardapi import BardCookies

cookie_dict = { "_Secure_1PSID" : "dwg6d8WgDhQ3HyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTPWBZevFDnmxGkQMQ", "_Secure_1PSIDTS" : "sidts-CjEBPVxjSiEbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxUJikHdi0bl1BS1y-kcgqBtEAA", "_Secure_1PSIDCC" : "ACA-OxOACryanisxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnGi4vCG2-AzXFwCG07bL3JLBk0" }

bard = BardCookies(cookie_dict=cookie_dict)

print(bard.get_answer("Explain about peptide compounds and structures")['content'])

Traceback (most recent call last): File "e:\Object Detection Model\Google_Bard\test.py", line 10, in bard = BardCookies(cookie_dict=cookie_dict) File "D:\Python 3.9\lib\site-packages\bardapi\core_cookies.py", line 53, in init
self.SNlM0e = self._get_snim0e() File "D:\Python 3.9\lib\site-packages\bardapi\core_cookies.py", line 119, in _get_snim0e raise Exception( Exception: SNlM0e value not found in response. Check __Secure-1PSID value.

I given correct _Secure_1PSID Value But still iam getting the Same error for many times.

I am not able to find the solution.

dsdanielpark commented 9 months ago

Please check FAQ , #99 and #155.

Also, I would appreciate it if you could verify the version of your Bard API.

Furthermore, ensure your account can successfully receive responses from the web UI. Try forcibly refreshing the cookie value, or log out, close all browsers, and then log back in to update the cookie value.

If you carefully review the above details, you should be able to resolve the issue. The package has been verified to be functioning normally.

Since this is a duplicate issue, I am closing it.