Python library for AntiCaptcha.
Go to file
Andrei f3671c4bdf Update test.yml 2022-12-14 12:18:13 +03:00
.github Update test.yml 2022-12-14 12:18:13 +03:00
anticaptcha_examples Update version and fix codestyle + tests 2020-11-11 00:47:23 +03:00
files Create AntiCaptcha.png 2022-11-05 18:06:06 +03:00
python3_anticaptcha Update base.py 2022-12-14 01:03:07 +03:00
tests added tests and other improve 2022-12-14 01:16:52 +03:00
.coveragerc Update .coveragerc 2022-12-14 01:33:04 +03:00
.gitignore Update depends logic. Upd lib version. 2021-01-03 01:55:52 +03:00
.isort.cfg Add isort config file 2020-02-14 16:51:05 +03:00
.travis.yml Update .travis.yml 2020-11-11 01:01:15 +03:00
CODE_OF_CONDUCT.md Initial commit 2017-10-11 21:36:36 +03:00
CONTRIBUTING.md upd readme 2022-10-28 05:46:07 +03:00
ISSUE_TEMPLATE.md upd readme 2022-10-28 05:46:07 +03:00
LICENSE Create LICENSE 2021-06-02 19:48:55 +03:00
MANIFEST.in Add manifest. Update setup.py 2019-02-14 14:03:43 +03:00
Makefile added tests and other improve 2022-12-14 01:16:52 +03:00
README.md Update README.md 2022-12-14 01:19:22 +03:00
_config.yml Set theme jekyll-theme-leap-day 2019-10-03 19:42:23 +03:00
codecov.yml Add codecov badge 2019-07-16 22:32:56 +03:00
pyproject.toml Update version and fix codestyle + tests 2020-11-11 00:47:23 +03:00
requirements.style.txt Updated project structure 2022-12-13 19:14:13 +03:00
requirements.test.txt upd 2022-12-14 01:11:38 +03:00
requirements.txt Updated project structure 2022-12-13 19:14:13 +03:00
setup.py Updated project structure 2022-12-13 19:14:13 +03:00

README.md

python3-anticaptcha

AntiCaptcha

PyPI version Python versions Downloads

Code Climate Codacy Badge codecov

Python 3.7+ library for Anti-Captcha service.

Tested on UNIX based OS.

The library is intended for software developers and is used to work with the Anti-Captcha service API.


Application in AppCenter.

If you have any questions, please send a message to the Telegram chat room.

Or email python-captcha@pm.me


How to install? Как установить?

pip

pip install python3-anticaptcha

Source

git clone https://github.com/AndreiDrang/python3-anticaptcha.git
cd python3-anticaptcha
python setup.py install

Присутствуют примеры работы с библиотекой.

Full examples you can find here.


At the moment the following methods are implemented:

На данный момент реализованы следующие методы:

0.Manual result handler.
from python3_anticaptcha import CustomResultHandler
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = "your_key"
# Task ID to get result
TASK_ID = 123456
# This module is used to obtain the result of solving the task in "manual" mode
custom_result = CustomResultHandler.CustomResultHandler(
    anticaptcha_key=ANTICAPTCHA_KEY
)

user_answer = custom_result.task_handler(task_id=TASK_ID)
print(user_answer)
1. Image to text captcha.
from python3_anticaptcha import ImageToTextTask
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# Link to captcha image.
image_link = "https://pythoncaptcha.tech/static/image/common_image_example/800070.png"
# Get string for solve captcha, and some other info.
user_answer = ImageToTextTask.ImageToTextTask(anticaptcha_key = ANTICAPTCHA_KEY).\
                captcha_handler(captcha_link=image_link)

print(user_answer)
2. ReCaptcha v2.
3. ReCaptcha v2 Proxyless. + Selenium example
from python3_anticaptcha import NoCaptchaTaskProxyless
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# G-ReCaptcha ключ сайта. Website google key.
SITE_KEY = '6LeuMjIUAAAAAODtAglF13UiJys0y05EjZugej6b'
# Page url.
PAGE_URL = 'https://www.google.com/recaptcha/intro/android.html'
# Get string for solve captcha, and other info.
user_answer = NoCaptchaTaskProxyless.NoCaptchaTaskProxyless(anticaptcha_key = ANTICAPTCHA_KEY)\
                .captcha_handler(websiteURL=PAGE_URL,
                                 websiteKey=SITE_KEY)

print(user_answer)
4. ReCaptcha v3 Proxyless.
from python3_anticaptcha import ReCaptchaV3TaskProxyless
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# G-ReCaptcha - website google key.
SITE_KEY = '6LeuMjIUAAAAAODtAglF13UiJys0y05EjZugej6b'
# Page url.
PAGE_URL = 'https://some_link'
# The filter by which the employee with the required minimum score is selected.
# possible options - 0.3, 0.5, 0.7
MIN_SCORE=0.3
# The value of the `action` parameter, which is passed by the recaptcha widget to google.
PAGE_ACTION='login'
# Get string for solve captcha, and other info.
user_answer = ReCaptchaV3TaskProxyless.ReCaptchaV3TaskProxyless(anticaptcha_key = ANTICAPTCHA_KEY)\
                .captcha_handler(websiteURL=PAGE_URL,
                                 websiteKey=SITE_KEY,
                                 minScore=MIN_SCORE,
                                 pageAction=PAGE_ACTION
                                )

print(user_answer)
5. Fun Captcha.
6. Fun Captcha Proxyless.
from python3_anticaptcha import FunCaptchaTask
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# G-ReCaptcha site key
SITE_KEY = ''
# Link to the page with captcha
PAGE_URL = ''
# Get full data for solve captcha.
user_answer = FunCaptchaTask.FunCaptchaTask(anticaptcha_key=ANTICAPTCHA_KEY,
                                            proxyType="http",
                                            proxyAddress="8.8.8.8",
                                            proxyPort=8080)\
                .captcha_handler(websiteURL=PAGE_URL,
                                 websitePublicKey=SITE_KEY)

print(user_answer)
7. Account management module.
from python3_anticaptcha import AntiCaptchaControl
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# Balance info
result = AntiCaptchaControl.AntiCaptchaControl(anticaptcha_key = ANTICAPTCHA_KEY).get_balance()
# Submitting a complaint about incorrectly resolved captcha images
result = AntiCaptchaControl.AntiCaptchaControl(anticaptcha_key = ANTICAPTCHA_KEY).complaint_on_result(
    reported_id=543212, captcha_type="image"
)
# Submitting a complaint about incorrectly resolved ReCaptcha
result = AntiCaptchaControl.AntiCaptchaControl(anticaptcha_key = ANTICAPTCHA_KEY).complaint_on_result(
    reported_id=5432134, captcha_type="recaptcha"
)
# Giving information about loading the queue, depending on the queue ID
result = AntiCaptchaControl.AntiCaptchaControl(anticaptcha_key = ANTICAPTCHA_KEY).get_queue_status(queue_id=1)
8. Custom Captcha.
from python3_anticaptcha import CustomCaptchaTask
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# ссылка на изображение
imageUrl = "https://files.anti-captcha.com/26/41f/c23/7c50ff19.jpg"
# минимальный пример использования модуля
my_custom_task = CustomCaptchaTask.CustomCaptchaTask(anticaptcha_key=ANTICAPTCHA_KEY).\
                    captcha_handler(imageUrl=imageUrl)
print(my_custom_task)
9. Gee Test.
10. Gee Test Proxyless.
from python3_anticaptcha import GeeTestTaskProxyless
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
# обязательные параметры
websiteURL = "http:\/\/mywebsite.com\/geetest\/test.php"
gt = "874703612e5cac182812a00e273aad0d"
challenge = "a559b82bca2c500101a1c8a4f4204742"
# пример работы с GeeTestTask без прокси
result = GeeTestTaskProxyless.GeeTestTaskProxyless(anticaptcha_key=ANTICAPTCHA_KEY,
                                                   websiteURL=websiteURL,
                                                   gt=gt).\
            captcha_handler(challenge=challenge)

print(result)
11. HCaptcha.
12. HCaptcha Proxyless.
from python3_anticaptcha import HCaptchaTaskProxyless
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = ""
WEB_URL = "https://dashboard.hcaptcha.com/signup"
SITE_KEY = "00000000-0000-0000-0000-000000000000"

result = HCaptchaTaskProxyless.HCaptchaTaskProxyless(anticaptcha_key=ANTICAPTCHA_KEY).\
            captcha_handler(websiteURL=WEB_URL, websiteKey=SITE_KEY)

print(result)

Кроме того, для тестирования различных типов капчи предоставляется специальный сайт, на котором собраны все имеющиеся типы капчи, с удобной системой тестирования ваших скриптов.

Some examples you can test with our web-site.


For tests:

  1. Clone repository
  2.  export anticaptcha_key=SERVICE_KEY
     make test