tiktok-captcha-solver


Nametiktok-captcha-solver JSON
Version 0.6.2 PyPI version JSON
download
home_pageNone
SummaryThis package integrates with Selenium or Playwright to solve any TikTok captcha in one line of code.
upload_time2024-12-15 02:11:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords tiktok captcha solver selenium rotate puzzle 3d
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TikTok Captcha Solver API
This project is the [SadCaptcha TikTok Captcha Solver](https://www.sadcaptcha.com?ref=ghclientrepo) 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. 
This API also works on mobile devices (Appium, etc.). 

This tool works on both TikTok and Douyin and can solve any of the four captcha challenges pictured below:

<div align="center">
    <img src="https://sadcaptcha.b-cdn.net/tiktok3d.webp" width="100" alt="TikTok Captcha Solver">
    <img src="https://sadcaptcha.b-cdn.net/tiktokrotate.webp" width="100" alt="TikTok Captcha Solver">
    <img src="https://sadcaptcha.b-cdn.net/tiktokpuzzle.webp" width="100" alt="TikTok Captcha Solver">
    <img src="https://sadcaptcha.b-cdn.net/tiktokicon.webp" width="100" alt="TikTok Captcha Solver">
    <br/>
</div>

## Requirements
- Python >= 3.10
- **If using Selenium** - Selenium properly installed and in `PATH`
- **If using Playwright** - Playwright must be properly installed with `playwright install`
- **If using mobile** - Appium and opencv must be properly installed
- **Stealth plugin** - You must use the appropriate `stealth` plugin for whichever browser automation framework you are using.
    - For Selenium, you can use [undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)
    - For Playwright, you can use [playwright-stealth](https://pypi.org/project/playwright-stealth/)

## 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 selenium.

```py
from tiktok_captcha_solver import SeleniumSolver
from selenium_stealth import stealth
import undetected_chromedriver as uc

driver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!
api_key = "YOUR_API_KEY_HERE"
sadcaptcha = SeleniumSolver(
    driver,
    api_key,
    mouse_step_size=1, # Adjust to change mouse speed
    mouse_step_delay_ms=10 # Adjust to change mouse speed
)

# Selenium code that causes a TikTok or Douyin captcha...

sadcaptcha.solve_captcha_if_present()
```

It is crucial that you use `undetected_chromedriver` with the default configuration, instead of the standard Selenium chromedriver.
Failure to use the `undetected_chromedriver` will result in "Verification failed" when attempting to solve the captcha.

## 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.


```py
from tiktok_captcha_solver import PlaywrightSolver
from playwright.sync_api import Page, sync_playwright
from playwright_stealth import stealth_sync, StealthConfig

api_key = "YOUR_API_KEY_HERE"

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)
    stealth_sync(page, config) # Use correct playwright_stealth configuration!
    
    # Playwright code that causes a TikTok or Douyin captcha...

    sadcaptcha = PlaywrightSolver(
        page,
        api_key,
        mouse_step_size=1, # Adjust to change mouse speed
        mouse_step_delay_ms=10 # Adjust to change mouse speed
    )
    sadcaptcha.solve_captcha_if_present()
```
It is crucial that users of the Playwright client also use `playwright-stealth` with the configuration specified above.
Failure to use the `playwright-stealth` plugin will result in "Verification failed" when attempting to solve the captcha.

## 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.



```py
import asyncio
from tiktok_captcha_solver import AsyncPlaywrightSolver
from playwright.async_api import Page, async_playwright
from playwright_stealth import stealth_async, StealthConfig

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()
        config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)
        await stealth_async(page, config) # Use correct playwright_stealth configuration!
        
        # Playwright code that causes a TikTok or Douyin captcha...

        sadcaptcha = AsyncPlaywrightSolver(
            page,
            api_key,
            mouse_step_size=1, # Adjust to change mouse speed
            mouse_step_delay_ms=10 # Adjust to change mouse speed
        )
        await sadcaptcha.solve_captcha_if_present()

asyncio.run(main())
```
It is crucial that users of the Playwright client also use `playwright-stealth` with the stealth configuration specified above.
Failure to use the `playwright-stealth` plugin will result in "Verification failed" when attempting to solve the captcha.

## Mobile (Appium)
Currently there is no premade solver for Mobile/appium, but you can implement the API with relative ease.
The idea is that you take a screenshot using the mobile driver, crop the images, and then send the images to the API.
Once you've done that, you can consume the response.
Here is a working example for Puzzle and Rotate captcha. 
keep in mind, you will need to adjust the `captcha_box` and `offset_x` varaibles according to your particular mobile device.

```py
from PIL import Image, ImageDraw
import base64
import requests

# SOLVING PUZZLE CAPTCHA
BASE_URL = 'https://www.sadcaptcha.com/api/v1'
LICENSE_KEY = ''
puzzle_url = f'{BASE_URL}/puzzle?licenseKey={LICENSE_KEY}'

def solve_puzzle():
    # Screenshot of page
    driver.save_screenshot('puzzle.png')
    full_image = Image.open('puzzle.png')

    # Full puzzle image - adjust box to your device
    captcha_box1 = (165, 1175, 303, 1330)
    captcha_image1 = full_image.crop(captcha_box1)

    # Draw circle over left side to occlude the puzzle piece in the main image
    draw = ImageDraw.Draw(captcha_image1)
    draw.ellipse([(0, 0), (captcha_image1.width / 4, captcha_image1.height)], fill="blue", outline="blue")
    captcha_image1.save('puzzle_screenshot.png')

    # Puzzle piece image - adjust box to your device
    captcha_box2 = (300, 945, 1016, 1475)
    captcha_image2 = full_image.crop(captcha_box2)
    captcha_image2.save('puzzle_screenshot1.png')


    with open('puzzle_screenshot.png', 'rb') as f:
        puzzle = base64.b64encode(f.read()).decode()
    with open('puzzle_screenshot1.png', 'rb') as f:
        piece = base64.b64encode(f.read()).decode()

    data = {
        'puzzleImageB64': puzzle,
        'pieceImageB64': piece
    }

    r = requests.post(puzzle_url, json=data)

    slide_x_proportion = r.json().get('slideXProportion')

    offset_x = 46 + (46 * float(slide_x_proportion))

    driver.swipe(start_x=55, start_y=530, end_x=55 + int(offset_x), end_y=530, duration=1000)
    time.sleep(3)


# SOLVING ROTATE CAPTCHA
BASE_URL = 'https://www.sadcaptcha.com/api/v1'
LICENSE_KEY = ''
rotate_url = f'{BASE_URL}/rotate?licenseKey={LICENSE_KEY}'

def solve_rotate():
    driver.save_screenshot('full_screenshot.png')

    full_image = Image.open('full_screenshot.png')

    captcha_box1 = (415, 1055, 755, 1395)
    captcha_image1 = full_image.crop(captcha_box1)

    mask = Image.new('L', captcha_image1.size, 0)
    draw = ImageDraw.Draw(mask)
    circle_bbox = (0, 0, captcha_image1.size[0], captcha_image1.size[1])
    draw.ellipse(circle_bbox, fill=255)

    captcha_image1.putalpha(mask)
    captcha_image1.save('captcha_image_circular.png')

    captcha_box2 = (318, 958, 852, 1492)
    captcha_image2 = full_image.crop(captcha_box2)

    mask2 = Image.new('L', captcha_image2.size, 0)
    draw = ImageDraw.Draw(mask2)
    draw.ellipse((captcha_box1[0] - captcha_box2[0], captcha_box1[1] - captcha_box2[1],
                  captcha_box1[2] - captcha_box2[0], captcha_box1[3] - captcha_box2[1]), fill=255)

    captcha_image_with_hole = captcha_image2.copy()
    captcha_image_with_hole.paste((0, 0, 0, 0), (0, 0), mask2)
    captcha_image_with_hole.save('captcha_image_with_hole.png')

    with open('captcha_image_with_hole.png', 'rb') as f:
        outer = base64.b64encode(f.read()).decode('utf-8')
    with open('captcha_image_circular.png', 'rb') as f:
        inner = base64.b64encode(f.read()).decode('utf-8')

    data = {
        'outerImageB64': outer,
        'innerImageB64': inner
    }

    r = requests.post(rotate_url, json=data)
    r.raise_for_status()
    response = r.json()
    angle = response.get('angle', 0)

    result = ((286 - 55) * angle) / 360
    start_x = 55
    start_y = 530
    offset_x = result

    driver.swipe(start_x, start_y, start_x + int(offset_x), start_y, duration=1000)
```

## Using Proxies and Custom Headers
SadCaptcha supports using proxies and custom headers such as user agent.
This is useful to avoid detection.
To implement this feature, pass your proxy URL and headers dictionary as a keyword argument to the constructor of the solver.
```py
api_key = "YOUR_API_KEY_HERE"
proxy = "http://username:password@123.0.1.2:80"
headers = {"User-Agent": "Chrome"}

# With Selenium Solver
driver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!
api_key = "YOUR_API_KEY_HERE"
sadcaptcha = SeleniumSolver(driver, api_key, proxy=proxy, headers=headers)

# With Playwright Solver
with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    stealth_sync(page) # Use default playwright_stealth configuration!
    sadcaptcha = PlaywrightSolver(page, api_key, proxy=proxy, headers=headers)
    sadcaptcha.solve_captcha_if_present()

# With Async PlaywrightSolver
async def main()
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()
        await stealth_async(page) # Use default playwright_stealth configuration!
        sadcaptcha = AsyncPlaywrightSolver(page, api_key, headers=headers, proxy=proxy)
        await sadcaptcha.solve_captcha_if_present()
```

## 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
```py
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")

# Icon (Video upload)
res = client.icon("Which of these objects... ?", base64 encoded icon image")
```

## Troubleshooting
### Captcha solved but still says Verification failed?
This common problem is due to your browser settings. 
If using Selenium, you must use `undetected_chromedriver` with the **default** settings.
If you are using Playwright, you must use the `playwright_stealth` package with the **default** settings.
Do not change the user agent, or modify any other browser characteristics as this is easily detected and flagged as suspicious behavior.

## Contact
- Homepage: https://www.sadcaptcha.com/
- Email: greg@sadcaptcha.com
- Telegram @toughdata

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tiktok-captcha-solver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "tiktok, captcha, solver, selenium, rotate, puzzle, 3d",
    "author": null,
    "author_email": "Toughdata LLC <greg@toughdata.net>",
    "download_url": "https://files.pythonhosted.org/packages/f1/44/22f92f1ff5f68ee7c6d16e914e846b497fa018f2dcb999be1f37c30f06a2/tiktok_captcha_solver-0.6.2.tar.gz",
    "platform": null,
    "description": "# TikTok Captcha Solver API\nThis project is the [SadCaptcha TikTok Captcha Solver](https://www.sadcaptcha.com?ref=ghclientrepo) API client.\nThe purpose is to make integrating SadCaptcha into your Selenium, Playwright, or Async Playwright app as simple as one line of code.\nInstructions for integrating with Selenium, Playwright, and Async Playwright are described below in their respective sections. \nThis API also works on mobile devices (Appium, etc.). \n\nThis tool works on both TikTok and Douyin and can solve any of the four captcha challenges pictured below:\n\n<div align=\"center\">\n    <img src=\"https://sadcaptcha.b-cdn.net/tiktok3d.webp\" width=\"100\" alt=\"TikTok Captcha Solver\">\n    <img src=\"https://sadcaptcha.b-cdn.net/tiktokrotate.webp\" width=\"100\" alt=\"TikTok Captcha Solver\">\n    <img src=\"https://sadcaptcha.b-cdn.net/tiktokpuzzle.webp\" width=\"100\" alt=\"TikTok Captcha Solver\">\n    <img src=\"https://sadcaptcha.b-cdn.net/tiktokicon.webp\" width=\"100\" alt=\"TikTok Captcha Solver\">\n    <br/>\n</div>\n\n## Requirements\n- Python >= 3.10\n- **If using Selenium** - Selenium properly installed and in `PATH`\n- **If using Playwright** - Playwright must be properly installed with `playwright install`\n- **If using mobile** - Appium and opencv must be properly installed\n- **Stealth plugin** - You must use the appropriate `stealth` plugin for whichever browser automation framework you are using.\n    - For Selenium, you can use [undetected-chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)\n    - For Playwright, you can use [playwright-stealth](https://pypi.org/project/playwright-stealth/)\n\n## Installation\nThis project can be installed with `pip`. Just run the following command:\n```\npip install tiktok-captcha-solver\n```\n\n## Selenium Client \nImport the package, set up the `SeleniumSolver` class, and call it whenever you need.\nThis turns the entire captcha detection, solution, retry, and verification process into a single line of code.\nIt is the recommended method if you are using selenium.\n\n```py\nfrom tiktok_captcha_solver import SeleniumSolver\nfrom selenium_stealth import stealth\nimport undetected_chromedriver as uc\n\ndriver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!\napi_key = \"YOUR_API_KEY_HERE\"\nsadcaptcha = SeleniumSolver(\n    driver,\n    api_key,\n    mouse_step_size=1, # Adjust to change mouse speed\n    mouse_step_delay_ms=10 # Adjust to change mouse speed\n)\n\n# Selenium code that causes a TikTok or Douyin captcha...\n\nsadcaptcha.solve_captcha_if_present()\n```\n\nIt is crucial that you use `undetected_chromedriver` with the default configuration, instead of the standard Selenium chromedriver.\nFailure to use the `undetected_chromedriver` will result in \"Verification failed\" when attempting to solve the captcha.\n\n## Playwright Client\nImport the package, set up the `PlaywrightSolver` class, and call it whenever you need.\nThis turns the entire captcha detection, solution, retry, and verification process into a single line of code.\nIt is the recommended method if you are using playwright.\n\n\n```py\nfrom tiktok_captcha_solver import PlaywrightSolver\nfrom playwright.sync_api import Page, sync_playwright\nfrom playwright_stealth import stealth_sync, StealthConfig\n\napi_key = \"YOUR_API_KEY_HERE\"\n\nwith sync_playwright() as p:\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)\n    stealth_sync(page, config) # Use correct playwright_stealth configuration!\n    \n    # Playwright code that causes a TikTok or Douyin captcha...\n\n    sadcaptcha = PlaywrightSolver(\n        page,\n        api_key,\n        mouse_step_size=1, # Adjust to change mouse speed\n        mouse_step_delay_ms=10 # Adjust to change mouse speed\n    )\n    sadcaptcha.solve_captcha_if_present()\n```\nIt is crucial that users of the Playwright client also use `playwright-stealth` with the configuration specified above.\nFailure to use the `playwright-stealth` plugin will result in \"Verification failed\" when attempting to solve the captcha.\n\n## Async Playwright Client\nImport the package, set up the `AsyncPlaywrightSolver` class, and call it whenever you need.\nThis turns the entire captcha detection, solution, retry, and verification process into a single line of code.\nIt is the recommended method if you are using async playwright.\n\n\n\n```py\nimport asyncio\nfrom tiktok_captcha_solver import AsyncPlaywrightSolver\nfrom playwright.async_api import Page, async_playwright\nfrom playwright_stealth import stealth_async, StealthConfig\n\napi_key = \"YOUR_API_KEY_HERE\"\n\nasync def main()\n    async with async_playwright() as p:\n        browser = await p.chromium.launch(headless=False)\n        page = await browser.new_page()\n        config = StealthConfig(navigator_languages=False, navigator_vendor=False, navigator_user_agent=False)\n        await stealth_async(page, config) # Use correct playwright_stealth configuration!\n        \n        # Playwright code that causes a TikTok or Douyin captcha...\n\n        sadcaptcha = AsyncPlaywrightSolver(\n            page,\n            api_key,\n            mouse_step_size=1, # Adjust to change mouse speed\n            mouse_step_delay_ms=10 # Adjust to change mouse speed\n        )\n        await sadcaptcha.solve_captcha_if_present()\n\nasyncio.run(main())\n```\nIt is crucial that users of the Playwright client also use `playwright-stealth` with the stealth configuration specified above.\nFailure to use the `playwright-stealth` plugin will result in \"Verification failed\" when attempting to solve the captcha.\n\n## Mobile (Appium)\nCurrently there is no premade solver for Mobile/appium, but you can implement the API with relative ease.\nThe idea is that you take a screenshot using the mobile driver, crop the images, and then send the images to the API.\nOnce you've done that, you can consume the response.\nHere is a working example for Puzzle and Rotate captcha. \nkeep in mind, you will need to adjust the `captcha_box` and `offset_x` varaibles according to your particular mobile device.\n\n```py\nfrom PIL import Image, ImageDraw\nimport base64\nimport requests\n\n# SOLVING PUZZLE CAPTCHA\nBASE_URL = 'https://www.sadcaptcha.com/api/v1'\nLICENSE_KEY = ''\npuzzle_url = f'{BASE_URL}/puzzle?licenseKey={LICENSE_KEY}'\n\ndef solve_puzzle():\n    # Screenshot of page\n    driver.save_screenshot('puzzle.png')\n    full_image = Image.open('puzzle.png')\n\n    # Full puzzle image - adjust box to your device\n    captcha_box1 = (165, 1175, 303, 1330)\n    captcha_image1 = full_image.crop(captcha_box1)\n\n    # Draw circle over left side to occlude the puzzle piece in the main image\n    draw = ImageDraw.Draw(captcha_image1)\n    draw.ellipse([(0, 0), (captcha_image1.width / 4, captcha_image1.height)], fill=\"blue\", outline=\"blue\")\n    captcha_image1.save('puzzle_screenshot.png')\n\n    # Puzzle piece image - adjust box to your device\n    captcha_box2 = (300, 945, 1016, 1475)\n    captcha_image2 = full_image.crop(captcha_box2)\n    captcha_image2.save('puzzle_screenshot1.png')\n\n\n    with open('puzzle_screenshot.png', 'rb') as f:\n        puzzle = base64.b64encode(f.read()).decode()\n    with open('puzzle_screenshot1.png', 'rb') as f:\n        piece = base64.b64encode(f.read()).decode()\n\n    data = {\n        'puzzleImageB64': puzzle,\n        'pieceImageB64': piece\n    }\n\n    r = requests.post(puzzle_url, json=data)\n\n    slide_x_proportion = r.json().get('slideXProportion')\n\n    offset_x = 46 + (46 * float(slide_x_proportion))\n\n    driver.swipe(start_x=55, start_y=530, end_x=55 + int(offset_x), end_y=530, duration=1000)\n    time.sleep(3)\n\n\n# SOLVING ROTATE CAPTCHA\nBASE_URL = 'https://www.sadcaptcha.com/api/v1'\nLICENSE_KEY = ''\nrotate_url = f'{BASE_URL}/rotate?licenseKey={LICENSE_KEY}'\n\ndef solve_rotate():\n    driver.save_screenshot('full_screenshot.png')\n\n    full_image = Image.open('full_screenshot.png')\n\n    captcha_box1 = (415, 1055, 755, 1395)\n    captcha_image1 = full_image.crop(captcha_box1)\n\n    mask = Image.new('L', captcha_image1.size, 0)\n    draw = ImageDraw.Draw(mask)\n    circle_bbox = (0, 0, captcha_image1.size[0], captcha_image1.size[1])\n    draw.ellipse(circle_bbox, fill=255)\n\n    captcha_image1.putalpha(mask)\n    captcha_image1.save('captcha_image_circular.png')\n\n    captcha_box2 = (318, 958, 852, 1492)\n    captcha_image2 = full_image.crop(captcha_box2)\n\n    mask2 = Image.new('L', captcha_image2.size, 0)\n    draw = ImageDraw.Draw(mask2)\n    draw.ellipse((captcha_box1[0] - captcha_box2[0], captcha_box1[1] - captcha_box2[1],\n                  captcha_box1[2] - captcha_box2[0], captcha_box1[3] - captcha_box2[1]), fill=255)\n\n    captcha_image_with_hole = captcha_image2.copy()\n    captcha_image_with_hole.paste((0, 0, 0, 0), (0, 0), mask2)\n    captcha_image_with_hole.save('captcha_image_with_hole.png')\n\n    with open('captcha_image_with_hole.png', 'rb') as f:\n        outer = base64.b64encode(f.read()).decode('utf-8')\n    with open('captcha_image_circular.png', 'rb') as f:\n        inner = base64.b64encode(f.read()).decode('utf-8')\n\n    data = {\n        'outerImageB64': outer,\n        'innerImageB64': inner\n    }\n\n    r = requests.post(rotate_url, json=data)\n    r.raise_for_status()\n    response = r.json()\n    angle = response.get('angle', 0)\n\n    result = ((286 - 55) * angle) / 360\n    start_x = 55\n    start_y = 530\n    offset_x = result\n\n    driver.swipe(start_x, start_y, start_x + int(offset_x), start_y, duration=1000)\n```\n\n## Using Proxies and Custom Headers\nSadCaptcha supports using proxies and custom headers such as user agent.\nThis is useful to avoid detection.\nTo implement this feature, pass your proxy URL and headers dictionary as a keyword argument to the constructor of the solver.\n```py\napi_key = \"YOUR_API_KEY_HERE\"\nproxy = \"http://username:password@123.0.1.2:80\"\nheaders = {\"User-Agent\": \"Chrome\"}\n\n# With Selenium Solver\ndriver = uc.Chrome(headless=False) # Use default undetected_chromedriver configuration!\napi_key = \"YOUR_API_KEY_HERE\"\nsadcaptcha = SeleniumSolver(driver, api_key, proxy=proxy, headers=headers)\n\n# With Playwright Solver\nwith sync_playwright() as p:\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    stealth_sync(page) # Use default playwright_stealth configuration!\n    sadcaptcha = PlaywrightSolver(page, api_key, proxy=proxy, headers=headers)\n    sadcaptcha.solve_captcha_if_present()\n\n# With Async PlaywrightSolver\nasync def main()\n    async with async_playwright() as p:\n        browser = await p.chromium.launch(headless=False)\n        page = await browser.new_page()\n        await stealth_async(page) # Use default playwright_stealth configuration!\n        sadcaptcha = AsyncPlaywrightSolver(page, api_key, headers=headers, proxy=proxy)\n        await sadcaptcha.solve_captcha_if_present()\n```\n\n## API Client\nIf you are not using Selenium or Playwright, you can still import and use the API client to help you make calls to SadCaptcha\n```py\nfrom tiktok_captcha_solver import ApiClient\n\napi_key = \"YOUR_API_KEY_HERE\"\nclient = ApiClient(api_key)\n\n# Rotate\nres = client.rotate(\"base64 encoded outer\", \"base64 encoded inner\")\n\n# Puzzle\nres = client.puzzle(\"base64 encoded puzzle\", \"base64 encoded piece\")\n\n# Shapes\nres = client.shapes(\"base64 encoded shapes image\")\n\n# Icon (Video upload)\nres = client.icon(\"Which of these objects... ?\", base64 encoded icon image\")\n```\n\n## Troubleshooting\n### Captcha solved but still says Verification failed?\nThis common problem is due to your browser settings. \nIf using Selenium, you must use `undetected_chromedriver` with the **default** settings.\nIf you are using Playwright, you must use the `playwright_stealth` package with the **default** settings.\nDo not change the user agent, or modify any other browser characteristics as this is easily detected and flagged as suspicious behavior.\n\n## Contact\n- Homepage: https://www.sadcaptcha.com/\n- Email: greg@sadcaptcha.com\n- Telegram @toughdata\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "This package integrates with Selenium or Playwright to solve any TikTok captcha in one line of code.",
    "version": "0.6.2",
    "project_urls": {
        "Homepage": "https://www.sadcaptcha.com",
        "Source": "https://github.com/gbiz123/tiktok-captcha-solver/"
    },
    "split_keywords": [
        "tiktok",
        " captcha",
        " solver",
        " selenium",
        " rotate",
        " puzzle",
        " 3d"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "313d73a30f03cdd2b738ae0f22eb8c18fb0b6daeb957b414314c85e50b6a245e",
                "md5": "deeaa5f14f9816d332beb7c6ec06ae47",
                "sha256": "819224936d9f4eab7ac9f5dfaab7e8df7a07b27596fb4c494a5029631f870d81"
            },
            "downloads": -1,
            "filename": "tiktok_captcha_solver-0.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "deeaa5f14f9816d332beb7c6ec06ae47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 28616,
            "upload_time": "2024-12-15T02:11:41",
            "upload_time_iso_8601": "2024-12-15T02:11:41.228425Z",
            "url": "https://files.pythonhosted.org/packages/31/3d/73a30f03cdd2b738ae0f22eb8c18fb0b6daeb957b414314c85e50b6a245e/tiktok_captcha_solver-0.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f14422f92f1ff5f68ee7c6d16e914e846b497fa018f2dcb999be1f37c30f06a2",
                "md5": "d5ef316620625d5166c5ad375891aac5",
                "sha256": "e89e31bc21283002f86222fc5e56bc305ea8c563e663f61ad6eaec3bac0d5568"
            },
            "downloads": -1,
            "filename": "tiktok_captcha_solver-0.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d5ef316620625d5166c5ad375891aac5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22679,
            "upload_time": "2024-12-15T02:11:44",
            "upload_time_iso_8601": "2024-12-15T02:11:44.215014Z",
            "url": "https://files.pythonhosted.org/packages/f1/44/22f92f1ff5f68ee7c6d16e914e846b497fa018f2dcb999be1f37c30f06a2/tiktok_captcha_solver-0.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-15 02:11:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gbiz123",
    "github_project": "tiktok-captcha-solver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tiktok-captcha-solver"
}
        
Elapsed time: 0.50276s