ra83205/google-bard-api

Failing to get response

Opened this issue · 4 comments

When running it seems form me it's failing at this functionality.
def __get_snlm0e(self): resp = self.session.get(url="https://bard.google.com/", timeout=10) # Find "SNlM0e":"<ID>" if resp.status_code != 200: raise Exception("Could not get Google Bard") print(resp.text) exit(0) SNlM0e = re.search(r"SNlM0e\":\"(.*?)\"", resp.text).group(1) return SNlM0e
For some reason he cannot finds the SNlM0e in the response text

To retrieve the SNlM0e value from Bard, you must include an additional cookie in the request. Specifically, you need to send the key-value pair for __Secure-1PSIDTS in the request. You can place this key-value pair just below the entry for __Secure-1PSID.

WebAI to API

Bard Cookie

Thanks for sharing that .
Did you managed to make it an container ?
I've done an implementation here
https://github.com/Amm1rr/WebAI-to-API/pull/18/files/207911c1af3c49f686bd45b6988980a76e469af4

Yeah sure, thanks for the pull request. I will review it and provide feedback this week.