Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

11th of December changes #3

Merged
merged 20 commits into from
Mar 16, 2023
Merged

11th of December changes #3

merged 20 commits into from
Mar 16, 2023

Conversation

Maxuss
Copy link
Owner

@Maxuss Maxuss commented Dec 13, 2022

Since the 11th of December, ChatGPT now has an extra cloudflare protection. This pull request will implement an authentication backend a single embedded browser-based authentication method.

More authentication methods will be added later

@Maxuss Maxuss added the bug Something isn't working label Dec 13, 2022
@Maxuss
Copy link
Owner Author

Maxuss commented Dec 13, 2022

Due to the fact that ChatGPT servers are pretty much dead right now, I can't really test the implementation. We will have to wait.

@Maxuss
Copy link
Owner Author

Maxuss commented Dec 14, 2022

It seems that both fantoccini and rust_headless_chrome are being detected by Cloudflare. I will look more in depth at how puppeteer can sneak behind it. Current workaround (the .js scripts in ./src/auth/simple/evade/) does not seem to work.

@Kixunil
Copy link

Kixunil commented Jan 3, 2023

Wouldn't it be possible to just copy all the cookies from browser or something along those lines?

@Maxuss
Copy link
Owner Author

Maxuss commented Jan 7, 2023

Wouldn't it be possible to just copy all the cookies from browser or something along those lines?

That would require users to login to chatgpt manually every 2 hours, and it is not always possible. The API client would also need to use the same user agent as the browser used to login, which is also impossible without extra hassle on user side. I could extract cookies and user agent from the browser cache but that poses as a security risk, and I have no idea how you would operate a browser on a server.

I am looking for other ways to login to ChatGPT. Projects like https://github.com/transitive-bullshit/chatgpt-api or https://github.com/acheong08/ChatGPT use puppeteer or selenium respectively, which I couldn't really get to work with Rust (maybe I am doing something the wrong way though). Interesting thing I've found is https://github.com/PawanOsman/ChatGPT.Net but it uses a closed-source proxy, so I can not guarantee 100% security when using it. Moreover, I am not even sure I can get the permission to use this proxy.

Another solution could be hosting a local server from a separate language (e.g. https://github.com/ChatGPT-Hackers/ChatGPT-API-server), and connecting to it, but I haven't really looked into that, and I want my API to work out of the box.

@Maxuss
Copy link
Owner Author

Maxuss commented Jan 7, 2023

I have found another selenium frontend, built on top of fantoccini: https://github.com/stevepryde/thirtyfour, but I have yet to test it.

@Kixunil
Copy link

Kixunil commented Jan 7, 2023

I would happily incur that extra hassle to not have to run the browser or other weird hacks.

@Maxuss
Copy link
Owner Author

Maxuss commented Jan 7, 2023

I'll add that as an alternative/placeholder login method then

@Kixunil
Copy link

Kixunil commented Jan 7, 2023

Thanks!

@CPlusPatch
Copy link

Can't wait for this to work again! Great work @Maxuss !

@Maxuss
Copy link
Owner Author

Maxuss commented Jan 15, 2023

Thanks, I am trying to find methods other than browser one when I have free time. The cloudflare cookie seems to be fully patched, I can't get it to work, even after copying all cookies from browser + user agent + same ip. Hopefully OpenAI releases an actual API soon

@MavenRain
Copy link

Thanks, I am trying to find methods other than browser one when I have free time. The cloudflare cookie seems to be fully patched, I can't get it to work, even after copying all cookies from browser + user agent + same ip. Hopefully OpenAI releases an actual API soon

You mean this? https://github.com/64bit/async-openai

@Maxuss
Copy link
Owner Author

Maxuss commented Jan 25, 2023

You mean this? https://github.com/64bit/async-openai

Yeah, I think OpenAI will release a REST API as they did with DALL-E 2 and GPT-3 models at some point.

@Maxuss
Copy link
Owner Author

Maxuss commented Feb 4, 2023

Apparently we can finally use official API
https://github.com/transitive-bullshit/chatgpt-api/

This is great, I will work on it when I have time next week

@Maxuss
Copy link
Owner Author

Maxuss commented Mar 1, 2023

Official API is finally here 🎉

https://openai.com/blog/introducing-chatgpt-and-whisper-apis

@Maxuss
Copy link
Owner Author

Maxuss commented Mar 14, 2023

Pretty much only docs and some more testing left, will be able to finish it tomorrow

@Maxuss Maxuss merged commit 45fbe8c into master Mar 16, 2023
@Maxuss Maxuss mentioned this pull request Mar 16, 2023
@Maxuss Maxuss deleted the auth branch March 22, 2023 14:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants