Skip to content

captcha_proxy ​

反向代理滑块页面发往腾讯验证服务的请求,由后端转发到 t.captcha.qq.com,并自动使用节点代理与登录会话 cookie。

调用方式 ​

js
const result = await api.captcha_proxy(
  self_id,
  url,
  method,
  headers,
  body,
)

参数 ​

参数类型必填说明
self_idnumber是在线 Bot QQ 号
urlstring是目标请求地址(t.captcha.qq.com 下的路径)
methodstring否HTTP 方法,默认 GET
headersobject否需要透传的请求头,键值均为字符串
bodystring否请求体,默认空

返回值 ​

js
{
  status: 200,
  headers: { 'content-type': 'application/json' },
  result: 'BASE64_ENCODED_BODY',
}

result 为响应体的 base64 编码;headers 仅包含响应头的首个取值。

示例 ​

js
const resp = await api.captcha_proxy(
  123456789,
  'https://t.captcha.qq.com/cap_union_new_verify',
  'GET',
  { Referer: 'https://example.com/' },
)
const body = Buffer.from(resp.result, 'base64').toString('utf-8')

萌卡 · 自托管 QQ 机器人框架