gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

Bing Provider Captcha Issues

Open NCCoder2 opened this issue 1 year ago • 4 comments

Whenever I try using the gpt-4 model with Bing, it says, "CaptchaChallenge: User needs to solve CAPTCHA to continue." Anyway to bypass this?

NCCoder2 avatar Oct 01 '23 14:10 NCCoder2

You can solve the Captcha in your Browser. Open the Bing Website and create a new Conversation. A Captcha should be shown. G4F use automatic the Cookies/Session from your Browser.

Try to pass "fake" cookies:

    for response in g4f.ChatCompletion.create(
        model=g4f.models.gpt_35_turbo,
        provider=g4f.Provider.Bing,
        messages=[{"role": "user", "content": "Create me a image with a lion."}],
        stream=True,
        cookies={"Fake": ""}
    ):
        print(response, end="", flush=True)
    print()

Bing then ignores the fake and the browser cookies. Works for me.

hlohaus avatar Oct 02 '23 09:10 hlohaus

It doesn't work on my end...

hilbert-yaa avatar Oct 05 '23 04:10 hilbert-yaa

The fake cookies don't work for me either. I too am getting this issue.

DoxrGitHub avatar Oct 07 '23 22:10 DoxrGitHub

The solution @hlohaus provided works for me.

Try open the developer tools on bing.com in browser and run following js code in the console to get all cookies.

JSON.stringify(document.cookie.split('; ').map(c => c.split('=')).reduce((c, [k, v]) => ({ ...c, [k]: v }), {}))

Then paste the JSON text into the python code to replace {"Fake": ""}

firedfox avatar Oct 09 '23 11:10 firedfox