acheong08 / Bard

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

Issue with the chat_data = json.loads(resp.content.splitlines()[3])[0][2] #53

Closed Meshwa428 closed 1 year ago

Meshwa428 commented 1 year ago

from os import environ from Bard import Chatbot

token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" chatbot = Chatbot(token)

chatbot.ask("Hello, how are you?")

when i ran it it always gives this error Traceback (most recent call last):
File "P:\New Model Traning\Bard Jarvis\bard_jarvis.py", line 7, in
chatbot.ask("Hello, how are you?")
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\site-packages\Bard.py", line 83, in ask
return self.loop.run_until_complete(self.async_chatbot.ask(message))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\vandu\AppData\Local\Programs\Python\Python311\Lib\site-packages\Bard.py", line 236, in ask
chat_data = json.loads(resp.content.splitlines()[3])[0][2]


IndexError: list index out of range 
Meshwa428 commented 1 year ago

are you still making this or you are focused on edgeGPT

acheong08 commented 1 year ago

I'm on vacation

acheong08 commented 1 year ago

I'll look into it

acheong08 commented 1 year ago

cant replicate

Meshwa428 commented 1 year ago

No need 😅 I am a beginner and didn't knew that my cookie expired it changed in the browser, so ya now it works fine. Can add something that extracts the __P1SID from chrome and then adds it to the code

acheong08 commented 1 year ago

Automating login would be a nightmare (Google is secure)