2017-10-16 02:40:08 +00:00
|
|
|
import requests
|
|
|
|
|
|
|
|
from .config import create_tast_url, get_result_url, app_key
|
|
|
|
#TODO from .errors import AntiCaptchaError
|
|
|
|
|
|
|
|
|
|
|
|
class NoCaptchaTask:
|
|
|
|
"""
|
|
|
|
TODO
|
|
|
|
"""
|
2017-10-22 09:21:54 +00:00
|
|
|
# Добавить прокси адрес
|
|
|
|
def __init__(self, anticaptcha_key, website_url, website_key, proxy_type="http", sleep_time=5, **kwargs):
|
2017-10-16 02:40:08 +00:00
|
|
|
"""
|
|
|
|
TODO
|
|
|
|
:params
|
|
|
|
return:
|
|
|
|
"""
|
|
|
|
self.ANTIKAPTCHA_KEY = anticaptcha_key
|
|
|
|
self.sleep_time = sleep_time
|
2017-10-22 09:21:54 +00:00
|
|
|
self.website_url = website_url
|
|
|
|
self.website_key = website_key
|
|
|
|
self.proxy_type = proxy_type
|
2017-10-16 02:40:08 +00:00
|
|
|
#TODO заполнить пайлоад для решения рекапчи
|
2017-10-22 09:21:54 +00:00
|
|
|
self.task_payload = {"clientKey": self.ANTIKAPTCHA_KEY,
|
|
|
|
"task":
|
|
|
|
{
|
|
|
|
"type": "NoCaptchaTask",
|
|
|
|
"website_url": self.website_url,
|
|
|
|
"website_key": self.website_key,
|
|
|
|
"proxy_type": self.proxy_type,
|
|
|
|
"proxy_adress": "",
|
|
|
|
"proxy_login": "",
|
|
|
|
"proxy_password": ""
|
|
|
|
}}
|
2017-10-16 02:40:08 +00:00
|
|
|
|
|
|
|
if kwargs:
|
|
|
|
for key in kwargs:
|
|
|
|
self.task_payload['task'].update(kwars) # is it error?
|
|
|
|
|
|
|
|
|
|
|
|
def captcha_handler(self):
|
|
|
|
#TODO
|