capmonster-python docs
Proxy and User Agent
Proxy and User Agent
You can use proxy and user agent in supported tasks.
Supported task list
- Recaptcha v2
- Fun captcha
- HCaptcha
- GeeTest
- Turnstile
For GeeTest and HCaptcha, proxies with IP authorization are not yet supported.
For others, if the proxy is authorized by IP, then be sure to add 116.203.55.208 to the white list.
ReCaptcha v2 Usage
recap_v2_proxy.py
from capmonster_python import RecaptchaV2Task
capmonster = RecaptchaV2Task("API_KEY")capmonster.set_proxy("http", "8.8.8.8", 8080)capmonster.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")task_id = capmonster.create_task("website_url", "website_key")result = capmonster.join_task_result(task_id)print(result.get("gRecaptchaResponse"))
FunCaptcha Usage
funcap_proxy.py
from capmonster_python import FuncaptchaTask
capmonster = FuncaptchaTask("API_KEY")capmonster.set_proxy("http", "8.8.8.8", 8080)capmonster.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")task_id = capmonster.create_task("website_url", "website_public_key")result = capmonster.join_task_result(task_id)print(result.get("token"))
HCaptcha Usage
hcap_proxy.py
from capmonster_python import HCaptchaTask
capmonster = HCaptchaTask("API_KEY")capmonster.set_proxy("http", "8.8.8.8", 8080)capmonster.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")task_id = capmonster.create_task("website_url", "website_key")result = capmonster.join_task_result(task_id)print(result.get("gRecaptchaResponse"))
GeeTest Usage
geetest_proxy.py
from capmonster_python import GeeTestTask
capmonster = GeeTestTask("API_KEY")capmonster.set_proxy("http", "8.8.8.8", 8080)capmonster.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")task_id = capmonster.create_task("website_url", "gt", "challenge")result= capmonster.join_task_result(task_id)print(result.get("challenge"))print(result.get("seccode"))print(result.get("validate"))
Turnstile Usage
turnstile_proxy.py
from capmonster_python import TurnstileTask
capmonster = TurnstileTask("API_KEY")capmonster.set_proxy("http", "8.8.8.8", 8080)capmonster.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")task_id = capmonster.create_task("website_url", "website_key")result = capmonster.join_task_result(task_id)print(result.get("token"))