From c78ff5654b7ded310e5e647e7052712d7870e5f7 Mon Sep 17 00:00:00 2001 From: alperensert <63921520+alperensert@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:01:46 +0300 Subject: [PATCH] feat: add amazon waf task support --- capmonster_python/__init__.py | 1 + capmonster_python/aws_waf.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 capmonster_python/aws_waf.py diff --git a/capmonster_python/__init__.py b/capmonster_python/__init__.py index f209fd1..74caf5b 100644 --- a/capmonster_python/__init__.py +++ b/capmonster_python/__init__.py @@ -10,3 +10,4 @@ from .datadome import DataDomeTask from .turnstile import TurnstileTask from .tendi import TenDITask +from .aws_waf import AmazonWafTask diff --git a/capmonster_python/aws_waf.py b/capmonster_python/aws_waf.py new file mode 100644 index 0000000..144a9bf --- /dev/null +++ b/capmonster_python/aws_waf.py @@ -0,0 +1,22 @@ +from .capmonster import Capmonster + +class AmazonWafTask(Capmonster): + def __init__(self, client_key): + super(AmazonWafTask, self).__init__(client_key) + + def create_task(self, website_url: str, website_key: str, challenge_script: str, captcha_script: str, + context: str, iv: str, cookieSolution: bool = False): + data = { + "clientKey": self._client_key, + "task": { + "type": "AmazonTaskProxyless", + "websiteURL": website_url, + "websiteKey": website_key, + "challengeScript": challenge_script, + "captchaScript": captcha_script, + "context": context, + "iv": iv, + "cookieSolution": cookieSolution + } + } + return self._make_request("createTask", data).get("taskId") \ No newline at end of file