Disclaimer: This documentation is provided for convenience and may contain errors. Always verify information against the official Kodi and provider documentation. Report issues.
Fastmail
Home / Files / my5_vod.py

easyplaytv-service/…/providers/my5_vod.py — My5 catalogue

Also ships in the video addon — this page documents the runtime copy

The full catalogue scraper ships in the shared runtime at easyplaytv-service/src/easyplaytv_service/vod_sync/providers/my5_vod.py (and the vendored copy inside service.easyplaytv). The video addon keeps a smaller resources/lib/my5_vod.py (list_seasons / list_episodes only) used directly by the addon's browse screens; the functions below with line numbers refer to the runtime copy.

Path easyplaytv-service/src/easyplaytv_service/vod_sync/providers/my5_vod.py Lines 149 Type catalogue scraper (clean JSON API) ← called by library_sync.py via _provider_module("my5_vod"), providers/__init__.py → calls corona.channel5.com JSON endpoints

Role

Queries Channel 5's "Corona" API — a public JSON REST endpoint that backs the my5.tv website. The simplest of all the addon's catalogue scrapers: pure JSON, no HTML scraping, no auth.

Constants

CORONA_URL = "https://corona.channel5.com/" · URL_GENRES · URL_SHOWS · URL_SEASONS · URL_EPISODES · lines 13-17

Endpoint roots. URL_SHOWS = CORONA_URL + "shows/search.json"; URL_SEASONS = CORONA_URL + "shows/%s/seasons.json" (one substitution for f_name); URL_EPISODES = CORONA_URL + "shows/%s/seasons/%s/episodes.json" (two substitutions: f_name and season_number).

SHOW_PARAMS = {"platform": "my5desktop", "friendly": "1"} · line 21

Query-string params applied to every API call. platform is the same id my5.py's Cassie uses (my5desktopng is the equivalent platform ID over there; the corona API uses the shorter form here). friendly=1 asks for "friendly" string ids per show (the f_name slugs the resolver uses) instead of opaque GUIDs.

GENRE_LABELS = {"Film":"Films", "Drama":"Drama", "Entertainment":"Entertainment", "Documentary":"Documentaries", "Sport":"Sport", "Soap":"Soaps", "milkshake!":"Kids"} · lines 23-28

My5's own genre names → addon display labels. Used inside list_genres.

Helpers

_api_get(url, params=None) · line 34

gzip-aware JSON fetch.

_safe_url_part(s) · line 89

URL-encodes a path segment for inclusion in a My5 API URL. f_names and season numbers occasionally contain stray whitespace, slashes, or non-ASCII characters (e.g. "milkshake" shows with Latin-1 characters) — this helper strips and percent-encodes them so the resulting URL has no spaces or unreserved chars.

Listing functions

list_genres() · line 46

Returns genre dicts from the clean My5 list, with labels mapped via GENRE_LABELS. Filters to entries that are plain strings — some entries come back as objects and we skip those (older My5 entries with deprecated metadata).

list_shows(genre_id, offset=0, limit=40) → tuple[shows, total_entries] · line 58

The search endpoint with offset/limit pagination. Returns the show list plus the total number of entries in the genre (so the caller knows when to stop iterating). Each show dict has f_name, title, image, description, standalone — the standalone flag indicating single-episode programmes (films).

list_seasons(f_name) · line 67

Lists the seasons for a show f_name. Strips stray whitespace from each season number (some My5 entries carry "2 " with a trailing space which produces malformed URLs like /seasons/2 /episodes.json and crash with "URL can't contain control characters"). Normalizes to integer when possible. Returns a synthetic "Season 1" entry if no seasons are returned (covers standalone shows that don't expose a season explicitly).

list_episodes(f_name, season_number) · line 93

The per-season episode list. Each episode dict includes episode_id (the GUID starting with "C" that my5.py:_fetch_cassie needs), f_name (sometimes an alternate id — passed through to the resolver as a fallback identifier), title, image, episode_number, series_number.

get_standalone_episode_id(f_name) · line 120

For standalone movies (a f_name that's actually a single-episode programme rather than a series) — finds the GUID that my5.py needs to make the Cassie call. Walks the seasons/episodes lists under the hood. Used by my5.resolve_vod when standalone=True.