acheong08 / EdgeGPT

Reverse engineered API of Microsoft's Bing Chat AI
The Unlicense
8.07k stars 908 forks source link

[Bug]: Exception: CaptchaChallenge: User needs to solve CAPTCHA to continue. #586

Open a37836323 opened 1 year ago

a37836323 commented 1 year ago

Is there an existing issue for this?

What happened?

After using it 30 times, it prompts this, what should I do?

Steps to reproduce the problem

  1. After using it 30 times, it prompts this, what should I do?

What should have happened?

After using it 30 times, it prompts this, what should I do?

Version where the problem happens

3.9

What Python version are you running this with?

3.9

What is your operating system ?

Linux

Command Line Arguments

no

Console logs

Traceback (most recent call last):
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/www/wwwroot/ceshi701/EdgeGPT/bbb.py", line 31, in chat
    responses = loop.run_until_complete(get_responses())
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/www/wwwroot/ceshi701/EdgeGPT/bbb.py", line 18, in get_responses
    async for final, response in bot.ask_stream(prompt=question, conversation_style=ConversationStyle.creative):
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/EdgeGPT/EdgeGPT.py", line 185, in ask_stream
    async for response in self.chat_hub.ask_stream(
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/EdgeGPT/chathub.py", line 197, in ask_stream
    raise Exception(
Exception: CaptchaChallenge: User needs to solve CAPTCHA to continue.
[2023-07-02 01:31:19,185] ERROR in app: Exception on /chat [POST]
Traceback (most recent call last):
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/www/wwwroot/ceshi701/EdgeGPT/bbb.py", line 31, in chat
    responses = loop.run_until_complete(get_responses())
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/www/wwwroot/ceshi701/EdgeGPT/bbb.py", line 18, in get_responses
    async for final, response in bot.ask_stream(prompt=question, conversation_style=ConversationStyle.creative):
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/EdgeGPT/EdgeGPT.py", line 185, in ask_stream
    async for response in self.chat_hub.ask_stream(
  File "/www/wwwroot/ceshi701/EdgeGPT/7815696ecbf1c96e6894b779456d330e_venv/lib/python3.9/site-packages/EdgeGPT/chathub.py", line 197, in ask_stream
    raise Exception(
Exception: CaptchaChallenge: User needs to solve CAPTCHA to continue.

Additional information

ok

Dima-369 commented 1 year ago

Guys, I found out that bing shows this captcha when it asks user to solve it. Any clues on how to solve it using python, Anyone??

Hah, I just tried it with Google Bard (see https://github.com/dsdanielpark/Bard-API), but it doesn't get them right 😄

image

Meshwa428 commented 1 year ago

Hah, I just tried it with Google Bard (see https://github.com/dsdanielpark/Bard-API), but it doesn't get them right 😄

It isn't that great, but it seems pretty accurate. Bard is good at images i think. Thanks for the solution👍

ahmed0x77 commented 1 year ago

i got the same problem "solve CAPTCHA to continue"

peteh commented 1 year ago

Same for me. I can also not easily solve it by logging in with the browser

OmarHedeya95 commented 1 year ago

Fix it with

def getCookies(url):
    import browser_cookie3
    browsers = [
        # browser_cookie3.chrome,
        # browser_cookie3.chromium,
        # browser_cookie3.opera,
        # browser_cookie3.opera_gx,
        # browser_cookie3.brave,
        browser_cookie3.edge,
        # browser_cookie3.vivaldi,
        # browser_cookie3.firefox,
        # browser_cookie3.librewolf,
        # browser_cookie3.safari,
    ]
    for browser_fn in browsers:
        # if browser isn't installed browser_cookie3 raises exception
        # hence we need to ignore it and try to find the right one
        try:
            cookies = []
            cj = browser_fn(domain_name=url)
            for cookie in cj:
                cookies.append(cookie.__dict__)
            return cookies
        except:
            continue

and

bot = EdgeGPT.Chatbot(cookies=getCookies('.bing.com'))

This works! Thanks a lot! Sometimes you need to open Bing and have one chat but then works perfectly

Meshwa428 commented 1 year ago

Guys i found this captcha element, if some one can fix it with this, i think we can get a basic idea of what the captcha is

<iframe src="https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/turnstile/if/ov2/av0/rcv0/0/6t8cg/0x4AAAAAAADptsa1Vbw0CGbV/light/normal" allow="cross-origin-isolated; fullscreen" sandbox="allow-same-origin allow-scripts allow-popups" id="cf-chl-widget-6t8cg" tabindex="0" title="Widget containing a Cloudflare security challenge" style="border: none; overflow: hidden; width: 300px; height: 65px;"></iframe>

here is another one which helped me out

https://www.bing.com/turing/captcha/challenge?q=&amp;iframeid=local-gen-0aaf3956-9a53-23a1-c31c-da23e5c056fe