easyplaytv-service/…/providers/my5_vod.py — My5 catalogue
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.
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
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).
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.
My5's own genre names → addon display labels. Used inside
list_genres.
Helpers
gzip-aware JSON fetch.
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
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).
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).
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).
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.
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.