Skip to content

Commit 1b2b524

Browse files
committed
Refresh tasks definition
1 parent f9f1b89 commit 1b2b524

13 files changed

Lines changed: 223 additions & 811 deletions

File tree

examples/antigate.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from os import environ
2+
from re import TEMPLATE
3+
4+
from python_anticaptcha import AnticaptchaClient
5+
from python_anticaptcha.tasks import AntiGateTask, AntiGateTaskProxyless
6+
import json
7+
8+
api_key = environ["KEY"]
9+
10+
URL = "https://anti-captcha.com/tutorials/v2-textarea"
11+
12+
TEMPLATE_NAME = "CloudFlare cookies for a proxy"
13+
14+
VARIABLES = {}
15+
16+
17+
def process():
18+
client = AnticaptchaClient(api_key)
19+
task = AntiGateTaskProxyless(
20+
website_url=URL,
21+
template_name=TEMPLATE_NAME,
22+
variables=VARIABLES,
23+
)
24+
job = client.createTaskSmee(task)
25+
solution = job.get_solution()
26+
return solution
27+
28+
29+
if __name__ == "__main__":
30+
print("Website URL: " + URL)
31+
solution = process()
32+
print("Result: " + json.dumps(solution, indent=4))

examples/custom_dot.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

examples/custom_moderation.py

Lines changed: 0 additions & 72 deletions
This file was deleted.

examples/square.png

-379 KB
Binary file not shown.

examples/squarenet.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/squarenet_validator.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

python_anticaptcha/__init__.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
from .base import AnticaptchaClient
22
from pkg_resources import get_distribution, DistributionNotFound
33
from .tasks import (
4-
NoCaptchaTask,
54
NoCaptchaTaskProxylessTask,
6-
FunCaptchaTask,
5+
RecaptchaV2TaskProxyless,
6+
NoCaptchaTask,
7+
RecaptchaV2Task,
78
FunCaptchaProxylessTask,
9+
FunCaptchaTask,
10+
ImageToTextTask,
811
RecaptchaV3TaskProxyless,
9-
HCaptchaTask,
1012
HCaptchaTaskProxyless,
11-
SquareNetTask,
12-
ImageToTextTask,
13-
CustomCaptchaTask,
13+
HCaptchaTask,
14+
RecaptchaV2EnterpriseTaskProxyless,
15+
RecaptchaV2EnterpriseTask,
16+
GeeTestTaskProxyless,
17+
GeeTestTask,
18+
AntiGateTaskProxyless,
19+
AntiGateTask
1420
)
1521
from .exceptions import AnticaptchaException
16-
from .fields import (
17-
SimpleText,
18-
Image,
19-
WebLink,
20-
TextInput,
21-
Textarea,
22-
Checkbox,
23-
Select,
24-
Radio,
25-
ImageUpload,
26-
)
2722

2823
AnticatpchaException = AnticaptchaException
2924

python_anticaptcha/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def check_is_ready(self):
3030
def get_solution_response(self): # Recaptcha
3131
return self._last_result["solution"]["gRecaptchaResponse"]
3232

33+
def get_solution(self):
34+
return self._last_result["solution"]
35+
3336
def get_token_response(self): # Funcaptcha
3437
return self._last_result["solution"]["token"]
3538

0 commit comments

Comments
 (0)