Socket
Socket
Sign inDemoInstall

tiktok-captcha-solver

Package Overview
Dependencies
9
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tiktok-captcha-solver

This package integrates with Selenium or Playwright to solve any TikTok captcha in one line of code.


Maintainers
1

Readme

TikTok Captcha Solver API

This project is the SadCaptcha TikTok Captcha Solver API client. The purpose is to make integrating SadCaptcha into your Selenium, Playwright, or Async Playwright app as simple as one line of code.

Instructions for integrating with Selenium, Playwright, and Async Playwright are described below in their respective sections.

Requirements

  • Python >= 3.10
  • If using Selenium - Selenium properly installed and in PATH
  • If using Playwright - Playwright must be properly installed with playwright install

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 SeleniumSolver 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 Playwright.

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 PlaywrightSolver 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 playwright.

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, api_key)
    sadcaptcha.solve_captcha_if_present()

That's it!

Async Playwright Client

Import the package, set up the AsyncPlaywrightSolver 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 async playwright.

import asyncio
from tiktok_captcha_solver import AsyncPlaywrightSolver
from playwright.async_api import Page, async_playwright

api_key = "YOUR_API_KEY_HERE"

async def main()
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()
        
        # Playwright code that causes a TikTok captcha...

        sadcaptcha = AsyncPlaywrightSolver(page, api_key)
        await sadcaptcha.solve_captcha_if_present()

asyncio.run(main())

That's it!

API Client

If you are not using Selenium or Playwright, 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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc