-
-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Authentication (with Cloudflare) #69
Comments
I get the same message above. Also can't login with the Chromium browser. Cloudflare seems to be hell bent on blocking. |
Same for me. I thoguht it was me having a wrong token but it seems it's CF |
Got the same with @galligan above. Dumping the HTML response from OpenAI and got something like this which seems to be a ddos protection system. |
https://github.com/acheong08/ChatGPT/wiki/Setup it seems like CloudFlare protection was added and
Some good examples https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/acheong08/ChatGPT%24+file:%5Esrc/revChatGPT/revChatGPT%5C.py+cf_clearance&patternType=regexp&sm=1 |
I've been working within my own fork to try getting things working, but it appears that just by simply adding |
I think use python undetected_chromedriver is a good way to solve the problem. But exactly how to write the code, I'm not sure. |
I don't feel that's an efficient approach, you'd be better off writing the rest of the bot in Python too if you take that route. This library is pure Go so far, and the implementation already has an existing method of pulling tokens using Playwright to pop open a web browser and automate pulling it after you've manually logged in with the browser instance. That browser instance could be leveraged to automate pulling the CloudFlare cookies in similar ways to how other clients are doing it (such as the node.js and Python clients), but in the end this still relies on a working implementation of the Even then, without using the web browser to automate pulling the cookies, using a predefined session token cookie and CloudFlare clearance cookie should suffice for the manner I'm using my fork of the ChatGPT package in. The way I'm using the underlying package isn't any different to how the Telegram bot is interacting with it, so once it can actually connect to ChatGPT again with the appropriate environment, then it'll be possible to start automating the pulling of cookies again using the web browser in the same way it already is. |
So, any work around so far? |
any solution based on openai API? |
This is what I am exploring on my side as well, just don't have enough time.
|
he uses a generated api key from openai, not the session token from browser cookies. or is there no difference? https://github.com/fxchen/SlackGPT/blob/main/functions/gpt_request.ts
|
The different seems to be that the model available via OpenAI official API is only GPT-3.5 https://beta.openai.com/docs/models/overview and there is a lack of "context keeping" when using the API vs ChatGPT. With ChatGPT, you could ask a chain of questions:
and the context is kept on the 3rd question. But when I attempt to use the API with
|
Any work around so far? |
Facing the same issue |
Ah so the path of using the However, the prompt size is limited at 4000(input and output inclusive) for free account. It's essentially counted per "token" https://openai.com/api/pricing/. So the richer the context, the longer the input prompt, the more expensive it is to use. With a free account, you probably want to set max_tokens to no more than 1000 tokens and leave 3000 tokens for the output?
|
API usage is too expensive. And only 18$ is free. So we need to find a way to permanently access it for free.
|
maybe thinking outside the box here but maybe we could use FlareSolverr to get around the cloudflare issue. https://github.com/FlareSolverr/FlareSolverr If I get a bit of spare time next week I'll look to see if i can offer a pull request to integrate this as an option.
|
Use this head to avoid robot detection
|
May be SET VAR_NAME= |
so after i have set the environment, i just run the initial from @peacecwz ? |
You change the URL to where you're hosting it and then just run this repo I think |
another dumb question @acheong08 where do i get the token or puid from? is it the chatgpt api token? |
Cookie |
erm @acheong08 where do i change the url? and i followed this repo (https://github.com/peacecwz/chatgpt-telegram) to set up to use chatgpt bot for telegram. For your repo, is it possible?
|
I see that this repo uses Playwright. You'll need to remove that code and just replace all the chat.openai.com with your bypass server (For example, mine is bypass.churchless.tech) |
@acheong08 i have managed to get it to run, but when i tried the bot on my telegram, i get this error though *Error: Couldn't get access token: unauthorized" Do u have any idea which access token it is talking about? |
@acheong08 so i used the token above and i go run make.go for your repo, and i get error failed to refresh puid cookie Can i verify the steps i need to do.
is that correct? |
Did you set |
You need to fork their repos and make some changes |
@acheong08 yup i made the changes already. Is it puid or access token? |
PUID for the proxy and access token for both |
Ah where do i get the PUID? |
Cookies of plus account |
|
Im sorry. I think im still confused. So i would need a plus account for this to work? |
One plus account for many free accounts to use without cloudflare |
You can actually just set the URL to my public proxy |
You don't have to host it yourself. It just has rate limits of 5 requests / 10 seconds |
So with yours i do not need the PUID? |
yes since I'm sharing my own PUID |
@acheong08 ok so do I need to change the url link on the main.go file to this: https://bypass.churchless.tech/api/conversation? How about headers? those are https://chat.openai.com/chat And also where can i get the PUID of your public proxy? Anw, really appreciate alot for this help! |
It injects it automatically. You don't need to worry about it
Yes and remove all the puppeteer stuff unless used for login
Ignore them. Don't need to touch it |
i followed the above @acheong08, i got the 405 Method Not Allowed and failed to refresh puid cookie |
I mean you don't need to run my repo. Just modify the code of this repo |
ah, but im still getting the unauthorised error when i run this repo with the edits to your proxy
|
Is your access token correct? |
I would think so. I coppird the access token part from the link u gave me. |
The text was updated successfully, but these errors were encountered: