Skip to main content

Python 3 Anti-Captcha service library with AIO module.

Project description

python3-anticaptcha

PyPI version Python versions Build Status Build Status Code Climate Codacy Badge

Python 3.6 library for Anti-Captcha service.

Application in AppCenter.

Tested on UNIX based OS.

Библиотека предназначена для разрабаотчиков ПО и служит для облегчения работы с API сервиса AntiCaptcha.

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

По всем вопросам можете писать в Telegram чат.

With any questions, please contact us in Telegram.


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

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.cloud/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'
# Фильтр, по которому отбирается работник с нужным минимальным score.
# возможные варианты - 0.3, 0.5, 0.7
MIN_SCORE=0.3
# Значение параметра action, которое передается виджетом рекапчи в гугл.
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 = ''
# Ссылка на страницу с капчёй
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 = ""
# Возвращается строка c балансом. Balance info.
user_answer = AntiCaptchaControl.AntiCaptchaControl(anticaptcha_key = ANTICAPTCHA_KEY).get_balance()

print(user_answer)
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. Clon repo;
  2.  export anticaptcha_key=SERVICE_KEY
     pip install pytest pytest-asyncio requests_mock
     pytest tests
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python3-anticaptcha-1.6.2.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

python3_anticaptcha-1.6.2-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file python3-anticaptcha-1.6.2.tar.gz.

File metadata

  • Download URL: python3-anticaptcha-1.6.2.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for python3-anticaptcha-1.6.2.tar.gz
Algorithm Hash digest
SHA256 1e71a5cc10643799c28acc2771cec6f467bb7713edc51e8db570972deb4de05f
MD5 875cc75427bd73713accb78f2bebc28d
BLAKE2b-256 78ad615272f5c90eed8f53107b62b764deb47f7bed00f8fbba7020b4a02e8b39

See more details on using hashes here.

File details

Details for the file python3_anticaptcha-1.6.2-py3-none-any.whl.

File metadata

  • Download URL: python3_anticaptcha-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for python3_anticaptcha-1.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc4d399468622b2d04a9e451ae7f5d5a9c85575a288ea6262215e6fc812867da
MD5 83f25ad4dff5e4ef10a803bb74e612e1
BLAKE2b-256 1adf2dd699a82ef9948a42141d0b1ddb6cac1bc92d9c537aa88864c93e39fa97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page