Metadata-Version: 2.4
Name: stb-reader
Version: 0.2.3
Summary: Python client library for Ministra/Stalker STB portals
Project-URL: Homepage, https://github.com/shubhsheth/stb-reader
Project-URL: Repository, https://github.com/shubhsheth/stb-reader
Author: shubhsheth
License: MIT License
        
        Copyright (c) 2024 shubhsheth
        
        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.
License-File: LICENSE
Keywords: iptv,ministra,portal,stalker,stb
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: click
Requires-Dist: requests
Provides-Extra: test
Requires-Dist: httpx; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: responses; extra == 'test'
Requires-Dist: twine; extra == 'test'
Description-Content-Type: text/markdown

# stb-reader

Python client library and CLI for [Ministra/Stalker](https://ministra.com/) STB portals. Browse live TV channels, VOD content, and series, or resolve stream URLs — from Python code or straight from the terminal.

## Install

```bash
pip install stb-reader
```

Requires Python 3.11+.

## Quick start — CLI

```bash
stb init                       # save portal URL and MAC address once
stb live channels              # browse channels
stb stream --type live <cmd>   # get a stream URL
```

See the [CLI reference](docs/guide/cli.md) for all commands.

## Quick start — Python

```python
from stb_reader import STBClient

client = STBClient(
    base_url="http://your-portal.example.com",
    mac="00:1A:79:XX:XX:XX",
)
client.authenticate()

# Live TV
channels = client.live_tv.get_channels(genre_id="*", page=1)
stream_url = client.live_tv.get_stream_url(channels.items[0].cmd)

# VOD
content = client.vod.get_content(category_id="*", page=1)

# Series
seasons = client.vod.get_seasons(series_id="123")
episodes = client.vod.get_episodes(series_id="123", season_id=seasons[0].id)
stream_url = client.vod.get_stream_url_by_first_file(
    series_id="123",
    season_id=seasons[0].id,
    episode_id=episodes[0].id,
)
```

## Documentation

- [CLI reference](docs/guide/cli.md) — `stb` command-line tool
- [Getting started](docs/guide/getting-started.md) — installation, configuration, first call
- [Authentication](docs/guide/authentication.md) — token lifecycle, auto-reauth, error handling
- [Live TV](docs/guide/live-tv.md) — genres, channels, stream URLs
- [VOD — Movies](docs/guide/vod.md) — categories, content listing, movie streams
- [Series](docs/guide/series.md) — seasons, episodes, quality selection
- [Pagination](docs/guide/pagination.md) — `PagedResult`, fetch-all-pages pattern
- [Error handling](docs/guide/error-handling.md) — all exceptions, recovery patterns
- [API reference](docs/guide/api-reference.md) — complete method, model, and exception reference

## License

MIT
