实现微信公众号被动返回接口的ChatGPT
具有微信公众号被动回复用户消息功能的 ChatGPTBot 实现
$(Token) 替换为你的微信公众号 Tokencf_clearance 获取 config.jsonchat.openai.com 里 Cookie 中的 __Secure-next-auth.session-token/weChatGPTGOOS=linux GOARCH=amd64 GOARM= GOMIPS= \
CGO_ENABLED=0 \
go build -trimpath -o ./dist/weChatGPT \
-ldflags "-X 'main.wxToken=$(Token)' -w -s -buildid="config.json 文件请放置与可执行文件同一目录下cf_clearance 可用于绕过 Cloudflare 的防火墙,但请保证获取 cf_clearance 时的 UA 与 IP 与项目实际运行时一致config.json 中填入本机访问 chat.openai.com 时的 session-token、UA 与 cf_clearance,运行后通过 curl 127.0.0.1:7458/healthCheck 进行可用性检查cf_clearance在服务器上安装vvanglro/cf-clearance
pip install --upgrade cf-clearance该项目需要playwright的支持,最新版Ubuntu镜像貌似是自带的(较老的Ubuntu版本需要自行安装),但还需要装一些依赖内容:
playwright install
sudo apt-get install libatk1.0-0 libatk-bridge2.0-0 libcups2 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2安装xvfb
sudo apt-get install xvfb然后在服务器上创建一个get_cf.py脚本,内容如下:
…在 get_cf.py 所在目录下执行
xvfb-run python3 get_cf.py > config.json将 get_cf.py 所在目录下的 config.json 文件复制至项目所在目录下
这其实是一篇没什么用的README由于微信公众号的 5s限制 ,虽然本项目已经通过技术将这个限制提升至了 15s, 但绝大多数情况下通过逆向得到的ChatGPT接口的相应速率都超过了这个时间限制。
故本 Bot 几乎无法正常工作,可能以后等 ChatGPT 的正式接口出来,会重构本项目的代码。
No open issues yet, or sync has not completed.