This package integrates with Selenium or Playwright to solve any TikTok captcha in one line of code.
Project description
TikTok Captcha Solver API
This project is the SadCaptcha TikTok Captcha Solver API client. The purpose is to make integrating SadCaptcha into your Selenium or Playwright app as simple as one line of code.
Instructions for integrating with Selenium and Playwright are described below in their respective sections.
Requirements
- Python >= 3.10
- Selenium properly installed and in
PATH
Installation
This project can be installed with pip
. Just run the following command:
pip install tiktok-captcha-solver
Selenium Client
Import the package, set up the SadCaptcha class, and call it whenever you need. This turns the entire captcha detection, solution, retry, and verification process into a single line of code. It is the recommended method if you are using Selenium.
from tiktok_captcha_solver import SeleniumSolver
import undetected_chromedriver as uc
driver = uc.Chrome(headless=False)
api_key = "YOUR_API_KEY_HERE"
sadcaptcha = SeleniumSolver(driver, api_key)
# Selenium code that causes a TikTok captcha...
sadcaptcha.solve_captcha_if_present()
That's it!
Playwright Client
Import the package, set up the SadCaptcha class, and call it whenever you need. This turns the entire captcha detection, solution, retry, and verification process into a single line of code. It is the recommended method if you are using Selenium.
from tiktok_captcha_solver import PlaywrightSolver
from playwright.sync_api import Page, sync_playwright
api_key = "YOUR_API_KEY_HERE"
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
# Playwright code that causes a TikTok captcha...
sadcaptcha = PlaywrightSolver(page, os.environ["API_KEY"])
sadcaptcha.solve_captcha_if_present()
That's it!
API Client
If you are not using Selenium, you can still import and use the API client to help you make calls to SadCaptcha
from tiktok_captcha_solver import ApiClient
api_key = "YOUR_API_KEY_HERE"
client = ApiClient(api_key)
# Rotate
res = client.rotate("base64 encoded outer", "base64 encoded inner")
# Puzzle
res = client.puzzle("base64 encoded puzzle", "base64 encoded piece")
# Shapes
res = client.shapes("base64 encoded shapes image")
Contact
- Homepage: https://www.sadcaptcha.com/
- Email: info@toughdata.net
- Telegram @toughdata
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tiktok_captcha_solver-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e00af7e84e83b5bd4bd0ef5e53833a60566652cd0f06e9c581cf9b2ee807e3d |
|
MD5 | c290bca0b2aa06138c73b9329d267b44 |
|
BLAKE2b-256 | 6d07ecab8d71fa7199a6d2cb6251a9e2c8fcf44c050316134ac9cdfd3b2a3517 |
Hashes for tiktok_captcha_solver-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce586f57c667892a7326e2b4c86398c3ac89a99725731c3fafdea019fb4c43ee |
|
MD5 | f22d56fa15cc3d4214207c0c8f2e1663 |
|
BLAKE2b-256 | ec5bbe44eff1a9fed8aaa3bfd84336024359d6c3c9b103be32330f8e34bf8d70 |