temu-captcha-solver


Nametemu-captcha-solver JSON
Version 0.0.9 PyPI version JSON
download
home_pageNone
SummaryThis package integrates with Selenium or Playwright to solve any Temu captcha in one line of code.
upload_time2024-10-27 11:58:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords temu captcha solver selenium playwright
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Temu Captcha Solver API
This project is the [SadCaptcha Temu Captcha Solver](https://www.sadcaptcha.com/temu-captcha-solver?ref=temughclientrepo) 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.

The end goal of this tool is to solve every single Temu captcha. 
Currently we are able to solve the arced slide and the puzzle slide:

<div align="center">
    <img src="https://sadcaptcha.b-cdn.net/arced-slide-temu-captcha.png" width="200px" height="150px" alt="TikTok Captcha Solver">
    <img src="https://sadcaptcha.b-cdn.net/temu-puzzle.webp" width="200px" height="150px" alt="TikTok Captcha Solver">
</div>

The Arced Slide challenge is the one where there is a puzzle piece that travels in an unpredictable trajectory, and there are two possible locations where the solution may be.
The puzzle slide is unique in that the pieces relocate after you drag the slider.
    
## Requirements
- Python >= 3.10
- **If using Selenium** - Selenium properly installed and in `PATH`
- **If using Playwright** - Playwright must be properly installed with `playwright install`
- **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 temu-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.

```py
from temu_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)

# Selenium code that causes a Temu captcha...

sadcaptcha.solve_captcha_if_present(retries=5)
```

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 temu_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 Temu captcha...

    sadcaptcha = PlaywrightSolver(page, api_key)
    sadcaptcha.solve_captcha_if_present(retries=5)
```
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 temu_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 Temu captcha...

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

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.

## 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(retries=5)

# 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(retries=5)
```

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "temu-captcha-solver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "temu, captcha, solver, selenium, playwright",
    "author": null,
    "author_email": "Toughdata LLC <greg@toughdata.net>",
    "download_url": "https://files.pythonhosted.org/packages/71/c2/153b63891567915f32c53dc4f72ce857fe457a216023e13ed97e96254616/temu_captcha_solver-0.0.9.tar.gz",
    "platform": null,
    "description": "# Temu Captcha Solver API\nThis project is the [SadCaptcha Temu Captcha Solver](https://www.sadcaptcha.com/temu-captcha-solver?ref=temughclientrepo) 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.\n\nThe end goal of this tool is to solve every single Temu captcha. \nCurrently we are able to solve the arced slide and the puzzle slide:\n\n<div align=\"center\">\n    <img src=\"https://sadcaptcha.b-cdn.net/arced-slide-temu-captcha.png\" width=\"200px\" height=\"150px\" alt=\"TikTok Captcha Solver\">\n    <img src=\"https://sadcaptcha.b-cdn.net/temu-puzzle.webp\" width=\"200px\" height=\"150px\" alt=\"TikTok Captcha Solver\">\n</div>\n\nThe Arced Slide challenge is the one where there is a puzzle piece that travels in an unpredictable trajectory, and there are two possible locations where the solution may be.\nThe puzzle slide is unique in that the pieces relocate after you drag the slider.\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- **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 temu-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 Playwright.\n\n```py\nfrom temu_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(driver, api_key)\n\n# Selenium code that causes a Temu captcha...\n\nsadcaptcha.solve_captcha_if_present(retries=5)\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 temu_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 Temu captcha...\n\n    sadcaptcha = PlaywrightSolver(page, api_key)\n    sadcaptcha.solve_captcha_if_present(retries=5)\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 temu_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 Temu captcha...\n\n        sadcaptcha = AsyncPlaywrightSolver(page, api_key)\n        await sadcaptcha.solve_captcha_if_present(retries=5)\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## 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(retries=5)\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(retries=5)\n```\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 Temu captcha in one line of code.",
    "version": "0.0.9",
    "project_urls": {
        "Homepage": "https://www.sadcaptcha.com",
        "Source": "https://github.com/gbiz123/temu-captcha-solver/"
    },
    "split_keywords": [
        "temu",
        " captcha",
        " solver",
        " selenium",
        " playwright"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2c1aaac95ded6e46f54e0a99e4213a0adf39a37e6d0ac10c521749700a57b1b",
                "md5": "24d88ed3d57e94f71ba55e4f0ee384bb",
                "sha256": "e7a4e352acf4b7e41a824ccd59c5d146f201c9d210f1a0dabcb6eb9a49dec323"
            },
            "downloads": -1,
            "filename": "temu_captcha_solver-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "24d88ed3d57e94f71ba55e4f0ee384bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 23144,
            "upload_time": "2024-10-27T11:58:29",
            "upload_time_iso_8601": "2024-10-27T11:58:29.762786Z",
            "url": "https://files.pythonhosted.org/packages/b2/c1/aaac95ded6e46f54e0a99e4213a0adf39a37e6d0ac10c521749700a57b1b/temu_captcha_solver-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71c2153b63891567915f32c53dc4f72ce857fe457a216023e13ed97e96254616",
                "md5": "fa970969239260176a90901ae501bc29",
                "sha256": "470eb688e7e9195244069a131179507d26cc3fcb2d7d5b7ed044a622ceea144a"
            },
            "downloads": -1,
            "filename": "temu_captcha_solver-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "fa970969239260176a90901ae501bc29",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15198,
            "upload_time": "2024-10-27T11:58:31",
            "upload_time_iso_8601": "2024-10-27T11:58:31.261944Z",
            "url": "https://files.pythonhosted.org/packages/71/c2/153b63891567915f32c53dc4f72ce857fe457a216023e13ed97e96254616/temu_captcha_solver-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-27 11:58:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gbiz123",
    "github_project": "temu-captcha-solver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "temu-captcha-solver"
}
        
Elapsed time: 0.40281s