EvanZhouDev / bard-ai

A lightweight library to access Google Bard.
https://www.npmjs.com/package/bard-ai
GNU General Public License v3.0
117 stars 31 forks source link

🐛 [BUG]: The API is identified as a robot after some requests #49

Closed MarwanRadwan7 closed 1 year ago

MarwanRadwan7 commented 1 year ago

Prerequisites

Bug Description

I am making an application based in bard AI and after some requests it gave me this error : Error creating channel: Error: Could not get Google Bard. from the init function as the website identifies the api as a robot and when I try to open the website from the browser it gives me a captcha.

Reproduction Steps

const cookies = process.env.BARD_COOKIE;
await Bard.init(cookies);
const conversation = new Bard.Chat();
const response = await conversation.ask(question);
const userData = await conversation.export();

Other information

No response

Occurance Rate

I can reproduce this bug 50% of the time.

EvanZhouDev commented 1 year ago

To be honest, not much I can do about that. Try with the new __Secure-#PSIDTS cookie in bard-ai v2

MarwanRadwan7 commented 1 year ago

Ok, I will give it a try. And also, thank you for the nice documentation.

EvanZhouDev commented 1 year ago

Hope it works! 😅

EvanZhouDev commented 1 year ago

Any updates? Closing otherwise...