Skip to main content

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/:

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

stb_reader-0.2.0.tar.gz (101.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stb_reader-0.2.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file stb_reader-0.2.0.tar.gz.

File metadata

  • Download URL: stb_reader-0.2.0.tar.gz
  • Upload date:
  • Size: 101.4 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

Hashes for stb_reader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f58f76b3e2855342237dfa1ef6a821f6df6530976d762bdcacd6eb2c2fa29a0
MD5 64dc4a6820c269582e7ebec93d850538
BLAKE2b-256 86aefa7f68b86246bf0960fee271fca9e2b17e85083e2f0c26026eace21d2ea5

See more details on using hashes here.

File details

Details for the file stb_reader-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: stb_reader-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 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

Hashes for stb_reader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6796c74b0b113191447d8ad03fea84d770af0363f328d0e469128223094c45e7
MD5 1f02ad1c9593b386d4407f057aacec7f
BLAKE2b-256 c65673c3d1f7ca11906d065b051d738e2e933ab978c829d364142950a0f20ee7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page