mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
Update bym.js (#735)
* feat: new bing (WIP) * fix: update CopilotAIClient.js * fix: gemini强制调用tool;real at * feat: add bym support
This commit is contained in:
parent
5f6c4e5abb
commit
26444df2a2
9 changed files with 599 additions and 30 deletions
|
|
@ -95,27 +95,27 @@ export default class SydneyAIClient {
|
|||
fetchOptions.headers.cookie = this.opts.cookies
|
||||
}
|
||||
// let hash = md5(this.opts.cookies || this.opts.userToken)
|
||||
let hash = crypto.createHash('md5').update(this.opts.cookies || this.opts.userToken).digest('hex')
|
||||
let proTag = await redis.get('CHATGPT:COPILOT_PRO_TAG:' + hash)
|
||||
if (!proTag) {
|
||||
let indexContentRes = await fetch('https://www.bing.com/chat', {
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0',
|
||||
Cookie: `_U=${this.opts.userToken}`
|
||||
}
|
||||
})
|
||||
let indexContent = await indexContentRes.text()
|
||||
if (indexContent?.includes('b_proTag')) {
|
||||
proTag = 'true'
|
||||
} else {
|
||||
proTag = 'false'
|
||||
}
|
||||
await redis.set('CHATGPT:COPILOT_PRO_TAG:' + hash, proTag, { EX: 7200 })
|
||||
}
|
||||
if (proTag === 'true') {
|
||||
logger.info('当前账户为copilot pro用户')
|
||||
this.pro = true
|
||||
}
|
||||
// let hash = crypto.createHash('md5').update(this.opts.cookies || this.opts.userToken).digest('hex')
|
||||
// let proTag = await redis.get('CHATGPT:COPILOT_PRO_TAG:' + hash)
|
||||
// if (!proTag) {
|
||||
// let indexContentRes = await fetch('https://www.bing.com/chat', {
|
||||
// headers: {
|
||||
// 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0',
|
||||
// Cookie: `_U=${this.opts.userToken}`
|
||||
// }
|
||||
// })
|
||||
// let indexContent = await indexContentRes.text()
|
||||
// if (indexContent?.includes('b_proTag')) {
|
||||
// proTag = 'true'
|
||||
// } else {
|
||||
// proTag = 'false'
|
||||
// }
|
||||
// await redis.set('CHATGPT:COPILOT_PRO_TAG:' + hash, proTag, { EX: 7200 })
|
||||
// }
|
||||
// if (proTag === 'true') {
|
||||
// logger.info('当前账户为copilot pro用户')
|
||||
// this.pro = true
|
||||
// }
|
||||
} else {
|
||||
fetchOptions.headers.cookie = initCk
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue