Metadata-Version: 2.4
Name: ocacaptcha
Version: 0.2.62
Summary: This library for solving TikTok captcha via OCA captcha service
Home-page: https://gist.github.com/OneClickActionOfficial/02c480ac0083d3989702a37bcb930a6c
Author: OCA
Author-email: oneclickactionsoft@gmail.com
Keywords: tiktok,captcha,puzzle,slide,3d,two the same shapes,2 objects,rotate,whirl,edata,circle,automation,python,selenium,playwright,nodriver,tiktok captcha,icon,tiktok slide,tiktok whirl,tiktok 3d,tiktok icon,geetest,geetest icon,datadome,slider,audio
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13.1
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: selenium
Requires-Dist: playwright
Requires-Dist: nodriver
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# TikTok Captcha Solver (`ocacaptcha`)

Automate TikTok captcha solving using **Selenium**, **Playwright**, **Nodriver**, or directly via **HTTP API** (without launching a browser).

---

## 🚀 Features

- ⚡ **Direct API Mode (`oca_solve_captcha_api`)**: Solve captchas fast using raw HTTP requests (`requests`) with zero browser overhead.
- 🌐 **Browser Integration (`oca_solve_captcha`)**: Built-in support for **Selenium**, **Playwright**, and **Nodriver**.
- 🧩 **Supported Captcha Types**: `tiktokWhirl`, `tiktokSlide`, `tiktok3D`, `tiktokIcon`, and `tiktokAllInOne`.
- 🔄 **Automatic Retries**: Built-in retry handling and parameter validation.

---

## 📦 Prerequisites & Installation

Choose the installation path depending on how you plan to use the library:

### Option 1: Direct API Mode (Lightweight, No Browser)
```bash
pip install requests ocacaptcha

```

### Option 2: Browser Automation Mode

* **For Selenium:**
```bash
pip install selenium ocacaptcha

```


*(Make sure to download [ChromeDriver](https://googlechromelabs.github.io/chrome-for-testing/#stable) matching your Chrome version).*
* **For Playwright:**
```bash
pip install playwright ocacaptcha
playwright install

```


* **For Nodriver:**
```bash
pip install nodriver ocacaptcha

```



---

## 💻 Usage Examples

### 1. Direct API Mode (Without Browser)

Use `oca_solve_captcha_api` when you don't need browser rendering:

```python
from ocacaptcha import oca_solve_captcha_api

def main():
    user_api_key = "YOUR_API_KEY_HERE"
    action_type = "tiktokAllInOne"
    captcha_img_width = 348
    captcha_img_height = 217
    encrypt_data = "YOUR_ENCRYPTED_CAPTCHA_DATA"
    number_captcha_attempts = 10

    print("[*] Solving captcha via Direct API...")

    response = oca_solve_captcha_api(
        user_api_key=user_api_key,
        action_type=action_type,
        encrypt_data=encrypt_data,
        captcha_img_width=captcha_img_width,
        captcha_img_height=captcha_img_height,
        number_captcha_attempts=number_captcha_attempts
    )

    if response:
        print("[+] Success!")
        print(response)
    else:
        print("[!] Captcha solving failed.")

if __name__ == "__main__":
    main()

```

### 2. Browser Automation Mode (Selenium Example)

Use `oca_solve_captcha` when interacting with an open browser instance:

```python
from selenium import webdriver
from ocacaptcha import oca_solve_captcha

driver = webdriver.Chrome()
driver.get("[https://www.tiktok.com/login](https://www.tiktok.com/login)")

result = oca_solve_captcha(
    driver=driver,
    user_api_key="YOUR_API_KEY_HERE",
    action_type="tiktokAllInOne",
    number_captcha_attempts=10,
    wait_captcha_seconds=5,
    solve_captcha_speed="fast"
)

```

👉 More examples can be found in this [GitHub Gist](https://gist.github.com/OneClickActionOfficial/02c480ac0083d3989702a37bcb930a6c).

---

## 🔑 Obtaining an OCA API Key

To get an API key, follow these steps in our [Telegram Bot](https://t.me/OneClickActionBot):

1. Open the bot and send the `/start` command.
2. Select your preferred language (**English** or **Russian**).
3. Navigate to **Another services** / **Другие услуги**.
4. Select **Captcha** / **Капча** to generate your API key.
5. Copy your **API key** and make sure you have sufficient balance.

---

## 🛠 Dependencies

* `requests`
* `selenium` *(optional)*
* `playwright` *(optional)*
* `nodriver` *(optional)*

---

## 📬 Contact & Support

For questions, issues, or business inquiries:

* **Admin**: OCA Admin
* **Email**: oneclickactionsoft@gmail.com *(Business purposes only)*
* **GitHub**: [One Click Action](https://github.com/OneClickActionOfficial)
* **Telegram**: [One Click Action Community](https://t.me/+70DIlIc543U4NGQy)
* **Discord**: [OCA Server](https://discord.com/invite/YyDx3SJNCh)
* **YouTube**: [OCA Channel](https://www.youtube.com/@ocasoft)
