Skip to content
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

OpenAI升级了wss连接检查,导致403 #26

Closed
yuanzhanghu opened this issue Apr 27, 2024 · 6 comments
Closed

OpenAI升级了wss连接检查,导致403 #26

yuanzhanghu opened this issue Apr 27, 2024 · 6 comments

Comments

@yuanzhanghu
Copy link
Contributor

wscat --connect wss://chatgpt-async-webps-prod-southcentralus-5.chatgpt.com/client/hubs/conversations?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL2NoYXRncHQtYXN5bmMtd2VicHMtcHJvZC1zb3V0aGNlbnRyYWx1cy01LndlYnB1YnN1Yi5henVyZS5jb20vY2xpZW50L2h1YnMvY29udmVyc2F0aW9ucyIsImlhdCI6MTcxNDE4NDY2NSwiZXhwIjoxNzE0MTg4MjY1LCJzdWIiOiJ1c2VyLVNFR2JVZE53eW93VjRKS2tKSnR3MHUycSIsInJvbGUiOlsid2VicHVic3ViLmpvaW5MZWF2ZUdyb3VwLnVzZXItU0VHYlVkTnd5b3dWNEpLa0pKdHcwdTJxIl0sIndlYnB1YnN1Yi5ncm91cCI6WyJ1c2VyLVNFR2JVZE53eW93VjRKS2tKSnR3MHUycSJdfQ.lbHLjqxv6b2zGqGEHlX2vhtyz2QeSL_2ra20pVL9g3A
error: Unexpected server response: 403

使用curl_cffi websocket都不能解决:
curl_cffi.curl.CurlError: Failed to perform, curl: (22) Refused WebSockets upgrade: 403. See https://curl.se/libcurl/c/libcurl-errors.html first for more details.

看来需要进一步研究为什么导致403。

@yuanzhanghu
Copy link
Contributor Author

抓包看,应该和__cf_bm相关:
This cookie is part of Cloudflare’s Bot Management service and is used to distinguish human visitors from bots. It helps manage incoming traffic that matches criteria associated with bots, and is also used to mitigate DDoS attacks and abusive bots, especially for website forms like login pages and search functions. This cookie usually has a very short lifetime to ensure it only affects the traffic session it was intended for.

@lanqian528
Copy link
Owner

进交流群说吧https://t.me/chat2api

@yuanzhanghu
Copy link
Contributor Author

这个应该还是JA3 TLS fingerprint的问题。 但是curl_cffi的websocket不好用。

@yuanzhanghu
Copy link
Contributor Author

鉴于 curl_cffi的websocket有问题, 准备新建一个chatgpt websocket的专用api, 以便后续我们可以使用async 的wss generator。
目前开发中:
https://github.com/yuanzhanghu/gpt_wss_api

@lanqian528
Copy link
Owner

大佬牛逼

@lanqian528
Copy link
Owner

貌似不再403了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants