Metadata-Version: 2.4
Name: BROKENXAPI
Version: 2.0.6
Summary: Official async Python SDK and CLI for BrokenX YouTube API
Author-email: Mr Broken <brokenxnetwork@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Mr Broken
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/mrxbroken011/BROKENXAPI
Project-URL: Repository, https://github.com/mrxbroken011/BROKENXAPI
Project-URL: Documentation, https://brokenxapi-docs.vercel.app
Project-URL: Issues, https://github.com/mrxbroken011/BROKENXAPI/issues
Keywords: brokenx,youtube,api,async,sdk,cli,aiohttp,telegram
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Multimedia :: Video
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: AsyncIO
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.8.0
Dynamic: license-file

# BROKENXAPI

**BROKENXAPI** is a high-performance asynchronous **Python SDK and CLI** that enables developers to search and download YouTube audio or video through a remote backend API.

It is built for **automation tools**, **Telegram bots**, and **production systems** where reliability, speed, and a clean developer experience are critical.

The SDK abstracts authentication and networking, while the CLI provides a fast and simple way to interact with the API directly from the terminal.

---

---

## Installation

Install via pip:

```bash
pip install BROKENXAPI
````

---

## Authentication

BROKENXAPI requires an API key for all requests.

### Environment Variable (Recommended)

**Linux / macOS**

```bash
export YTKEY="BROKENXAPI-XXXX"
```

**Windows**

```bat
set YTKEY=BROKENXAPI-XXXX
```

---

## Python SDK Usage

```python
import asyncio
from brokenxapi import BrokenXAPI

async def main():
    async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
        # Search YouTube
        search = await api.search("moosetape", video=False)
        video_id = search["video_id"]

        # Download audio
        audio = await api.download(video_id, "audio")
        print(audio["telegram_url"])

asyncio.run(main())
```

---

## Download Video (SDK)

```python
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
    video = await api.download("VIDEO_ID", "video")
    print(video["telegram_url"])
```

---

## CLI Usage

Authenticate once:

```bash
brokenx auth BROKENXAPI-XXXX
```

Check installed version:

```bash
brokenx -v
```

Search YouTube:

```bash
brokenx search "moosetape"
```

Download audio:

```bash
brokenx download VIDEO_ID
```

Download video:

```bash
brokenx download VIDEO_ID -v
```

---

## Notes

* Python **3.8+** is required
* An API key is mandatory for all requests
* All responses are returned as JSON-compatible dictionaries
* Download responses include a **Telegram-ready file URL**

---

## License

© 2025 **MR Broken**
All rights reserved.

---
