diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-11-18 12:24:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 12:24:39 +0100 |
commit | 2fcb3f949bbde7f5380acc68dc6b1f938dec12bc (patch) | |
tree | 035bd400b4057a744b29a0ebee96579bfbf429f6 /g4f/Provider/npm/node_modules/funcaptcha/lib/api.js | |
parent | ~ | g4f `v-0.1.8.5` (diff) | |
parent | Add AiChatOnline, ChatgptDemoAi, ChatgptNext Providers (diff) | |
download | gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.gz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.bz2 gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.lz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.xz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.zst gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/npm/node_modules/funcaptcha/lib/api.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/g4f/Provider/npm/node_modules/funcaptcha/lib/api.js b/g4f/Provider/npm/node_modules/funcaptcha/lib/api.js deleted file mode 100644 index b1cee39c..00000000 --- a/g4f/Provider/npm/node_modules/funcaptcha/lib/api.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getToken = void 0; -const http_1 = require("./http"); -const util_1 = require("./util"); -async function getToken(options) { - options = { - surl: "https://client-api.arkoselabs.com", - data: {}, - ...options, - }; - if (!options.headers) - options.headers = { "User-Agent": util_1.default.DEFAULT_USER_AGENT }; - else if (!Object.keys(options.headers).map(v => v.toLowerCase()).includes("user-agent")) - options.headers["User-Agent"] = util_1.default.DEFAULT_USER_AGENT; - options.headers["Accept-Language"] = "en-US,en;q=0.9"; - options.headers["Sec-Fetch-Site"] = "same-origin"; - options.headers["Accept"] = "*/*"; - options.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"; - options.headers["sec-fetch-mode"] = "cors"; - if (options.site) { - options.headers["Origin"] = options.surl; - options.headers["Referer"] = `${options.surl}/v2/${options.pkey}/1.5.5/enforcement.fbfc14b0d793c6ef8359e0e4b4a91f67.html`; - } - let ua = options.headers[Object.keys(options.headers).find(v => v.toLowerCase() == "user-agent")]; - let res = await (0, http_1.default)(options.surl, { - method: "POST", - path: "/fc/gt2/public_key/" + options.pkey, - body: util_1.default.constructFormData({ - bda: util_1.default.getBda(ua, options), - public_key: options.pkey, - site: options.site ? new URL(options.site).origin : undefined, - userbrowser: ua, - capi_version: "1.5.5", - capi_mode: "inline", - style_theme: "default", - rnd: Math.random().toString(), - ...Object.fromEntries(Object.keys(options.data).map(v => ["data[" + v + "]", options.data[v]])), - language: options.language || "en", - }), - headers: options.headers, - }, options.proxy); - return JSON.parse(res.body.toString()); -} -exports.getToken = getToken; |