acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28.03k stars 4.48k forks source link

"Captcha detected" hampers logging #36

Closed reycn closed 1 year ago

reycn commented 1 year ago
Logging in...
Captcha detected
Error refreshing session
can only concatenate str (not "NoneType") to str
...

Expected behavior for the difficulty in resolving captcha issue?

image
acheong08 commented 1 year ago

I haven't figured out how to do captcha yet. If you know how, could you make a pull request?

If not, perhaps you could write some better error handling for this library. I am currently a bit busy and won't be able to dedicate too much time to this until Wednesday.

reycn commented 1 year ago

Do you @rawandahmad698 have any suggestions?

acheong08 commented 1 year ago

Right now, the best fastest way to do this is to simply wrap the email/password in try except and make it return error on captcha detection. This can then be caught and alerted to the user

rawandahmad698 commented 1 year ago

The original code waits on the user to solve the captcha and then submit it. Unfortunately this is removed on this repo. Check out the original version of PyChatGPT.

The concatenation error is present because auth.access_token is initially None. Since the option to solve the captcha manually is removed, the script returns and you can't str + None

acheong08 commented 1 year ago

The reason I removed it was to allow for use in libraries. Is there a way to do it without having to write to disk and opening an image?

rawandahmad698 commented 1 year ago

It's a simple svg converted to png with a increased 300% dpi for better visibility. It's very small in size and gets overwritten on subsequent disk writes. So the user can view, write the words and proceed. I can look into removing the png file when it's done.

acheong08 commented 1 year ago

The issue is that you cannot open a png file on a server which most implementations of this library uses. I'm unsure of how to detect this and alert the user to use tokens accordingly

rawandahmad698 commented 1 year ago

That's interesting. People can explore & purchase clean proxies. At MeshMonitors we use https://webshare.io proxies.

  1. A clean IP with no suspicious activity passes their bot detection check.

  2. In a use case (GPTChat for Discord) the user could show the captcha as a discord attachment.

I really can't know what all of the use cases are. But training a custom ML to solve the captcha is fairly straightforward. Unfortunately i do not have the time, and money to proceed with it.

acheong08 commented 1 year ago

But training a custom ML to solve the captcha is fairly straightforward. Unfortunately i do not have the time, and money to proceed with it.

Same here

I'll just wrap it in try except and alert the user that Captcha isn't supported and to use session tokens instead

rawandahmad698 commented 1 year ago

I have 14 stars on my own repo. Add my repo on your github page (🫣) and with 100 or more stars I will do more research and possibly find a solution.

The reason I want 100 or more is that I want to know that the hours spent on it is worth it. In a way of giving back to the community

acheong08 commented 1 year ago

I have 14 stars on my own repo. Add my repo on your github page (🫣) and with 100 or more stars I will do more research and possibly find a solution.

The reason I want 100 or more is that I want to know that the hours spent on it is worth it. In a way of giving back to the community

Totally agree. I will put it up top as a better alternative for CLI use.

acheong08 commented 1 year ago

Closing as not planned

acheong08 commented 1 year ago

@rawandahmad698 Added right up at the top. I wish you luck

rawandahmad698 commented 1 year ago

Wow, thank you sir. I appreciate that. Open source is ❤️