Python client library for Ministra/Stalker STB portals
Project description
stb-reader
Python client library for Ministra/Stalker STB portals. Retrieve live-TV channels, VOD content, series, episodes, and stream URLs with simple method calls.
Installation
pip install stb-reader
Requires Python 3.11+ and has a single runtime dependency: requests.
Quick start
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
genres = client.live_tv.get_genres()
channels = client.live_tv.get_channels(genre_id="*", page=1)
stream_url = client.live_tv.get_stream_url(channels.items[0].cmd)
# VOD
categories = client.vod.get_categories()
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,
)
API reference
STBClient(base_url, mac, serial, lang, timezone, portal_path)
| Parameter | Default | Description |
|---|---|---|
base_url |
required | Portal base URL |
mac |
required | Device MAC address |
serial |
"000000000000" |
Device serial |
lang |
"en" |
Portal language |
timezone |
"Europe/London" |
Portal timezone |
portal_path |
"stalker_portal/c/portal.php" |
Path to portal PHP endpoint |
client.live_tv
| Method | Returns | Description |
|---|---|---|
get_genres() |
list[Genre] |
All channel genres |
get_channels(genre_id, page, sort, hd, fav) |
PagedResult[Channel] |
Paginated channel list |
get_stream_url(cmd) |
str |
Resolved stream URL for a channel cmd |
get_stream_url_by_id(channel_id) |
str |
Resolved stream URL by channel ID |
client.vod
| Method | Returns | Description |
|---|---|---|
get_categories() |
list[Category] |
All VOD categories |
get_content(category_id, page, sort, fav) |
PagedResult[Content] |
Paginated VOD content |
get_seasons(series_id) |
list[Season] |
Seasons for a series |
get_episodes(series_id, season_id) |
list[Episode] |
All episodes in a season |
get_episode_files(series_id, season_id, episode_id) |
list[EpisodeFile] |
Quality variants for an episode |
get_stream_url(cmd) |
str |
Resolved stream URL for a VOD cmd |
get_stream_url_by_content_id(content_id) |
str |
Stream URL for a movie by ID |
get_stream_url_by_first_file(series_id, season_id, episode_id) |
str |
Stream URL for first file of an episode |
get_stream_url_by_file_id(series_id, season_id, episode_id, file_id) |
str |
Stream URL for a specific file |
Exceptions
All exceptions are importable from stb_reader:
| Exception | Raised when |
|---|---|
STBError |
Base class for all library errors |
AuthError |
Authentication / token failure |
StreamError |
Portal rejects a stream request |
NotFoundError |
Requested item not found |
Documentation
Full guides are in docs/guide/:
- Getting started — installation, configuration, first call
- Authentication — token lifecycle, auto-reauth, error handling
- Live TV — genres, channels, stream URLs
- VOD — Movies — categories, content listing, movie streams
- Series — seasons, episodes, quality selection
- Pagination —
PagedResult, fetch-all-pages pattern - Error handling — all exceptions, recovery patterns
- API reference — complete method, model, and exception reference
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stb_reader-0.1.0.tar.gz.
File metadata
- Download URL: stb_reader-0.1.0.tar.gz
- Upload date:
- Size: 146.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b401f3a02f4ded2b5064dec0e7dd334ab95089b951193606b8e073176114485
|
|
| MD5 |
916ded1a77f30797707df04b0c6a5269
|
|
| BLAKE2b-256 |
fc26945747445546bc6c85a62d89bc119578afcdc63fdefc8f2b70e464c42d22
|
File details
Details for the file stb_reader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stb_reader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d328d3f92d3f9a13002fefb630f8bc30cefb21109f5642a189151ac6ed157cf
|
|
| MD5 |
2ccc526168f761a149986aa3fad34e35
|
|
| BLAKE2b-256 |
51176737c4e9c13b05d864800ce3ec289e78aaf737b9f2054e1a860664b997c8
|