UNLOCK API

Tencent Captcha解決API

Tencent CaptchaのタスクをAPIに送ると、コードがページに送信する回答が返ってきます。ページURLとTencentのapp id。受け取るもの: ticketとrandstrの値。

概要

1,000件あたりの料金
$1.30 (1タスク $0.0013)
createTaskのtype
TencentTaskProxyless, TencentTask
in.phpのmethod
tencent
送信するもの
ページURLとTencentのapp id
受け取るもの
ticketとrandstrの値

値の見つけ方

app id(CaptchaAppId)はページ内のTencentCaptcha呼び出しにあります。

createTaskとgetTaskResult

タスクを作成し、約5秒待ってから、statusがreadyになるまで5秒ごとに結果を確認します。タスクが失敗した場合はAPIがエラーを返し、料金は残高に戻ります。

import time, requests

API = "https://unlock-api.com"
KEY = "YOUR_API_KEY"

task = requests.post(f"{API}/createTask", json={
    "clientKey": KEY,
    "task": {
      "type": "TencentTaskProxyless",
      "websiteURL": "https://example.com/login",
      "appId": "190014885"
    }
}).json()
if task["errorId"]:
    raise SystemExit(task["errorCode"])

for _ in range(60):   # 60 x 5 s = the 5 minute task limit
    time.sleep(5)
    r = requests.post(f"{API}/getTaskResult", json={"clientKey": KEY, "taskId": task["taskId"]}).json()
    if r["errorId"]:
        raise SystemExit(f"{r['errorCode']}: {r.get('errorDescription', '')}")   # failed tasks are refunded
    if r["status"] == "ready":
        print(r["solution"])
        break
else:
    raise SystemExit("timed out")

in.phpとres.php

従来のフォームAPIで同じタスクを送ります。json=1を付けるとJSONで応答し、付けない場合はOK|1001のようなプレーンテキストで応答します。

curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&method=tencent&appId=APP_ID&pageurl=https://example.com/login&json=1"
# {"status":1,"request":"1001"}

curl -s "https://unlock-api.com/res.php?key=YOUR_API_KEY&action=get&id=1001&json=1"
# {"status":0,"request":"CAPCHA_NOT_READY"}  then  {"status":1,"request":"ANSWER"}

APIリファレンス全文: すべてのパラメータとsolutionオブジェクト