Closed hldr4 closed 1 year ago
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 curl-cffi
installation reliable?
If it does not work, you may need to compile and install curl-impersonate first.
Is
curl-cffi
installation reliable?
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 io.StringIO
or something similar, i mean you probably don't need a regular file
to do this, it's stupid to write into a file then read from a file in hard disk
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.