Metadata-Version: 2.4
Name: dramaapi
Version: 0.1.0
Summary: Python client for DramaAPI: search 20+ short-drama platforms (DramaBox, ReelShort, ShortMax, GoodShort…), list episodes and get stream URLs.
Author: DramaAPI
License-Expression: MIT
Project-URL: Homepage, https://dramaapi.live
Project-URL: Documentation, https://dramaapi.live/docs
Project-URL: Source, https://github.com/DramaAPI/dramaapi
Project-URL: Issues, https://github.com/DramaAPI/dramaapi/issues
Keywords: drama,short-drama,api,reelshort,dramabox,shortmax,goodshort,streaming,hls
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Video
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# dramaapi (Python)

Python client for [DramaAPI](https://dramaapi.live): one REST API for 20+ short-drama platforms (DramaBox, ReelShort, ShortMax, GoodShort, DramaWave, MoboReels and more). No dependencies beyond the standard library.

```bash
pip install dramaapi
```

```python
from dramaapi import DramaAPI, DramaAPIError

api = DramaAPI("YOUR_KEY")          # or set DRAMAAPI_KEY

hit = api.search("billionaire", lang="en")["results"][0]
print(hit["title"], hit["provider"], hit["totalEpisodes"])

for ep in api.iter_episodes(hit["provider"], hit["id"]):
    print(ep["number"], ep["title"])

try:
    play = api.play(hit["provider"], hit["id"], 1)
    print(play["format"], play["streamUrl"])
    for sub in play.get("subtitles", []):
        print(sub["language"], sub["url"])
except DramaAPIError as e:
    print(e.code, e.message)        # 503: episode not playable on the source
```

| Method | Endpoint |
|---|---|
| `status()` | `GET /api/status` |
| `providers()` | `GET /api/providers` |
| `search(keyword, provider=None, lang=None, page=1, limit=20)` | `GET /api/v1/search` |
| `home(provider, lang=None, page=1, limit=20)` | `GET /{provider}/api/v1/home` |
| `detail(provider, series_id)` | `GET /{provider}/api/v1/detail/{id}` |
| `episodes(provider, series_id, page=1, limit=100)` | `GET /{provider}/api/v1/episodes/{id}` |
| `iter_episodes(provider, series_id)` | pages through every episode |
| `play(provider, series_id, episode)` | `GET /{provider}/api/v1/play/{id}/{ep}` |

Errors raise `DramaAPIError` with `.code` (401 bad key, 404 unknown series, 429 quota used, 503 not playable). Stream URLs are often signed for about an hour, so call `play()` again rather than storing them.

Free 3-day key: https://dramaapi.live/register · Full reference: https://dramaapi.live/docs

MIT licensed.
