dsdanielpark / Bard-API

The unofficial python package that returns response of Google Bard through cookie value.

Home Page:https://pypi.org/project/bardapi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

M16051997 opened this issue · comments

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.

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.