-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Experimental pure Python Cloudflare bypass #1382
Conversation
uses the curl-cffi module for tls fingerprint spoofing and writes content_callback to a temp file as a workaround for the aforementioned module not supporting streamed requests
the official endpoint can only be bypassed with tls spoofing on some IPs
This is good. Removing the need for a proxy server has pretty high demand but I could never figure out how to do it in Python. Is
|
I cannot speak for everyone, but it works without any additional setup on my Windows PC and remote Linux server |
Um there are conflicts now. I'll merge right after they are resolved. Will be on the next release 6.0.0 |
I'll make the changes myself. Merging |
did you try |
I'll look into this. There are streaming issues with file due to buffers |
Been playing around with this to avoid using the GO proxy method for TLS spoofing. It uses
curl-cffi
module to spoof the TLS fingerprint (I set chrome110). But, since that module doesn't support stream=True on requests, a workaround is to writecontent_callback
to a temp file, then read from it, then delete. For async it is the same principle, just uses AsyncSession instead.Works well enough from my various tests, but can never be 100% sure. For example, the following outputs every task result correctly with no parts missing or any weirdness like that.
So this change allows to use the official
https://chat.openai.com/backend-api/conversation
endpoint without having to spin up a local proxy or using a bypass site, but only on those IPs where the CF challenge isn't triggered for whatever reason.