acheong08 / Bard

Python SDK/API for reverse engineered Google Bard
MIT License
1.42k stars 178 forks source link

'NoneType' object has no attribute 'group' #11

Closed zenorochaV1 closed 1 year ago

zenorochaV1 commented 1 year ago

'NoneType' object has no attribute 'group'

chokychou commented 1 year ago

same issue

chokychou commented 1 year ago

@zenorochaV1 mine resolved by double checking copied __Secure-1PSID. Please check yours

venuv commented 1 year ago

thx @chokychou .. the trailing '.' is part of the cookie id if that helps others

HANiFLY commented 1 year ago

GOT the same Nonetype problem even the value of "BARD_TOKEN" is with the trailing '.'

Somioni commented 1 year ago

I found what's wrong.

Function: __get_snlm0e It gives "None" instead of token, and then "None" instead of re.search in library. And "None" instead of re.search dont have group

Pls fix, im too lazy to look into whole code to remake it

HANiFLY commented 1 year ago

__get_snlm0e

could you tell me what is expected to return from __get_snlm0e?

HANiFLY commented 1 year ago

could you tell me what is expected to return from function __get_snlm0eļ¼Ÿ

---Original--- From: @.> Date: Sat, Apr 8, 2023 01:35 AM To: @.>; Cc: @.**@.>; Subject: Re: [acheong08/Bard] 'NoneType' object has no attribute 'group'(Issue #11)

I found what's wrong.

Function: __get_snlm0e It gives "None" instead of token, and then "None" instead of re.search in library. And "None" instead of re.search dont have group

Pls fix, im too lazy to look into whole code to remake it

ā€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

tekemperor commented 1 year ago

Not the author, but I looked at the code. It appears __get_snlm0e() returns a string found in a call to https://bard.google.com/ that you can only get if your cookie is valid. If the string is not there, the regex will fail to find it and return None instead of the string.

This all points to the token not being valid. There are a few different cookies that have the same prefix. Are you sure you have the value of __Secure-1PSID and not __Secure-1PSIDCC for your BARD_TOKEN?

Ai-Austin commented 1 year ago

What is causing this issue is you are trying to paste the token in the quotes of the boiler plate code. If you are not using a system variable and want to paste it straight in the code: Delete the os.environ and make the token a string with your token.

cameronj86 commented 1 year ago

ā˜šŸ¾ When I put my session cookie in quotations (copying the info in the readme) in bash, it became functional again, thanks

jauyzed commented 1 year ago

Although the error was gone after converting to string but it returned nothing for the question; just an empty prompt