Jump to content

Bard API

Recommended Posts

Hi fellow delphi,


i'm try to run bardapi via p4d. from this github https://github.com/dsdanielpark/Bard-API


and try to run this example code.

token = 'xxxxxxx'
bard = Bard(token=token)
bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']


when it run in command line it works correctly. but when i run it in the p4d it gives error. 

site-packages\bardapi\core.py", line 154, in _get_snim0e
    raise Exception(
Exception: SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'.

//of course i have change the xxxx to the correct token. 

anyone has any idea how to fix it?.... 


Edited by japri
additional information

Share this post

Link to post



your issue is from here 

snim0e = re.search(r"SNlM0e\":\"(.*?)\"", resp.text)

check your "resp" value and does it fits to regular expression as expected


generally speaking, your problem may have nothing to do with Delphi

anyway, debugging is required on the python side to determine the cause


have you read the Authentification section?


(tools like Postman can also help)

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now