mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: bing captcha fix(不建议升级)
This commit is contained in:
parent
521914bb5b
commit
ef57259e8a
2 changed files with 82 additions and 49 deletions
28
apps/chat.js
28
apps/chat.js
|
|
@ -1676,6 +1676,16 @@ export class chatgpt extends plugin {
|
|||
let { id, image } = await createCaptcha(e, bingToken)
|
||||
e.bingCaptchaId = id
|
||||
e.token = bingToken
|
||||
const {
|
||||
conversationSignature,
|
||||
conversationId,
|
||||
clientId
|
||||
} = error?.data
|
||||
e.bingConversation = {
|
||||
conversationSignature,
|
||||
conversationId,
|
||||
clientId
|
||||
}
|
||||
return {
|
||||
text: '请崽60秒内输入下面图片以通过必应人机验证',
|
||||
image,
|
||||
|
|
@ -2330,7 +2340,23 @@ export class chatgpt extends plugin {
|
|||
let text = this.e.msg
|
||||
let solveResult = await solveCaptcha(id, text, e.token)
|
||||
if (solveResult.result) {
|
||||
await e.reply('验证码已通过')
|
||||
const cacheOptions = {
|
||||
namespace: Config.toneStyle,
|
||||
store: new KeyvFile({ filename: 'chatgpt:bing:temp.json' })
|
||||
}
|
||||
const bingAIClient = new SydneyAIClient({
|
||||
userToken: e.token, // "_U" cookie from bing.com
|
||||
debug: false,
|
||||
cache: cacheOptions,
|
||||
user: e.sender.user_id,
|
||||
proxy: Config.proxy
|
||||
})
|
||||
let response = await bingAIClient.sendMessage('hello', e.bingConversation)
|
||||
if (response.response) {
|
||||
await e.reply('验证码已通过')
|
||||
} else {
|
||||
await e.reply('验证码正确,但账户未解决验证码')
|
||||
}
|
||||
} else {
|
||||
await e.reply('验证码失败:' + JSON.stringify(solveResult.detail))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue