mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
feat: 必应验证码另一个解决方案
This commit is contained in:
parent
51f786bd44
commit
12a94d8086
4 changed files with 68 additions and 45 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import fetch from 'node-fetch'
|
||||
|
||||
// this file is deprecated
|
||||
|
||||
import { Config } from './config.js'
|
||||
import {Config} from './config.js'
|
||||
import HttpsProxyAgent from 'https-proxy-agent'
|
||||
|
||||
const newFetch = (url, options = {}) => {
|
||||
const defaultOptions = Config.proxy
|
||||
? {
|
||||
|
|
@ -60,3 +60,27 @@ export async function solveCaptcha (id, regionId, text, token) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function solveCaptchaOneShot (token) {
|
||||
if (!token) {
|
||||
throw new Error('no token')
|
||||
}
|
||||
let solveUrl = Config.bingCaptchaOneShotUrl
|
||||
if (!solveUrl) {
|
||||
throw new Error('no captcha source')
|
||||
}
|
||||
let result = await fetch(solveUrl, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
_U: token
|
||||
}
|
||||
})
|
||||
if (result.status === 200) {
|
||||
return await result.json()
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
error: result.statusText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ const defaultConfig = {
|
|||
serpSource: 'ikechan8370',
|
||||
extraUrl: 'https://cpe.ikechan8370.com',
|
||||
smartMode: false,
|
||||
bingCaptchaOneShotUrl: 'http://bingcaptcha.ikechan8370.com/bing',
|
||||
version: 'v2.7.3'
|
||||
}
|
||||
const _path = process.cwd()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue