Skip to content

Getting Started

After you installed this package, the next step is to import the package into your code and start using the functions.

# For Anti Captcha, use:
from botcity.plugins.captcha import BotAntiCaptchaPlugin

# For Death By Captcha, use:
from botcity.plugins.captcha import BotDeathByCaptchaPlugin

As a demonstration of the library, let's build a simple example together that will do something cool .

Step 1 of Example

To make the example we will...

# Instantiate the plugin (AntiCaptcha)
antiCaptcha = BotAntiCaptchaPlugin(API_KEY)

# Death By Captcha version
deathByCaptcha = BotDeathByCaptchaPlugin(USERNAME, PASSWORD)

...

Step 2 of Example

# AntiCaptcha
antiCaptcha.solve_text("captcha_ms.jpeg")


# Death By Captcha
deathByCaptcha.solve("captcha_ms.jpeg")

...

Complete code

Let's take a look into the complete code:

# Imports
from botcity.plugins.captcha import BotAntiCaptchaPlugin
from botcity.plugins.captcha import BotDeathByCaptchaPlugin

# AntiCaptcha Text
anti_captcha = BotAntiCaptchaPlugin("API_KEY")
print(anti_captcha.solve_text("captcha_ms.jpeg"))

# AntiCaptcha ReCaptcha
url = 'https://www.google.com/recaptcha/api2/demo'
captcha_id = '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-'
print(anti_captcha.solve_re(url, captcha_id))

# Death By Captcha
death_by_captcha = BotDeathByCaptchaPlugin("USERNAME", "PASSWORD")
print(death_by_captcha.solve("captcha.jpg"))

Pro Tip

This plugin allows you to use method chaining where applicable (methods auth and report):

# Let's suppose the API solves the captcha incorrectly
dbc.solve("captcha.jpg")
incorrect_captcha = True

# Tries again
if incorrect_captcha:
    dbc.report().solve("captcha.jpg")

Next Steps

Check our examples and experiment with the API. Let us know where it can be improved.

Have fun automating!

Back to top