The guide on the relay: one guide for every screen
Design agreed 2026-10-02. Not built yet.
Today every Apple TV and the Mac app fetch the TV Guide themselves, channel by channel, every ten minutes. Each IPTV channel asks its provider's guide on every server, three tries each, before falling back to epg.pw (and only for channels matched to it by hand). On 2026-10-02:
- Trex's guide is broken on every server, though the account works:
get_simple_data_tableanswers 520 or drops the connection,get_short_epg404, onvpn.uhdp.topandtv.wd.uhdp.top; the country servers (es,gr,it) turn the login away (403) for everything. - Strong has guides for its UK channels (222 listings for Sky Atlantic) but none for its US ones (Nickelodeon, VH1, WBTS NBC Boston), on all four servers.
So guides are slow, mostly missing for US channels, and every screen pays for it.
Strong's guide times were late by its server's UTC offset (found 2026-10-12
on BBC 1, BBC 2 and ITV 1 against epgshare01): a listing's start text is the
server's own clock (server_info.timezone, Europe/Amsterdam), and its
start_timestamp is that text read as UTC, so Bargain Hunt (12:15 UK) was
listed at 14:15. XtreamAPI.decodeListings now takes such a listing at its
start in the server's zone: only when the timestamp is exactly the text read
as UTC and the zone isn't UTC, so panels with true timestamps are untouched.
The zone is asked for once a day per login (ServerClock). It follows the
clocks changing, where a fixed offset would not.
Decisions #
- The relay builds one guide for the whole lineup. Antenna Tower
(originally the Manager relay, see history/manager-relay.md)
fetches every source, picks each channel's guide, and serves the result. A screen
asks once and gets everything;
If-None-Matchgets a 304 when nothing changed. - Best source wins, per channel; no merging. In order: the provider's own guide for any of the channel's feeds, then the guide sources in the order set in the Manager. The first with listings for the next few hours is the channel's guide. Merging sources was turned down: their times rarely line up, so it makes overlaps and doubled shows.
- Cheap. Free sources (epgshare01 and epg.pw, which the app already uses; EPG.lat once its coverage is checked; iptv-org's grabber, self-run, later), plus Schedules Direct ($35/yr) for US channels. Nothing else paid.
- Schedules Direct comes through EpGo. EpGo is on Schedules Direct's approved software list. It downloads the lineup into an XMLTV file and the relay reads that file like any other source; Rabbit Ears never calls Schedules Direct itself. The lineup is Comcast Xfinity Boston (02155) for now: the Boston locals and the national cable networks.
- EpGo runs wherever the relay runs. The Manager starts it once a day on
the Mac with "Run the relay on this Mac" on. Its config and Schedules Direct
login are set up once per Mac by you (
epgo -configure), so the password never passes through the app. - Tower first, R2 as the backup. Screens ask Antenna Tower. (An earlier draft proposed private CloudKit as the offline backup before R2 settings sync replaced iCloud.)
- Broken sources are skipped for a while. A source that fails on every server (Trex's guide now) isn't asked again for an hour, so a channel goes straight to the next source.
- Matching: the rules shortlist, Jev picks, you fix. Each source names
channels its own way ("US| NICKELODEON HD" is "NICKHD" in Schedules Direct,
"Nickelodeon.us" in epgshare01). For each channel and source the rules
shortlist up to five candidates by the provider's guide id, the call sign
and the name. Jev picks one or "none", as it does for sports (see
SportJudge): agreeing with the rules, it's used; sure (0.75) of another, it waits in review; with nothing from the rules, it's used alone only when very sure (0.9). The Manager lists every channel with its guide and where it came from, flags the ones with none or in review, and a fix there is kept. Answers are kept too: only new or changed channels are asked again. - Screens fall back to fetching for themselves when neither Antenna Tower nor a cached copy has a guide, as today.
Matching, borrowing from Dispatcharr (2026-10-12) #
Compared against Dispatcharr's
epg_matching.py. Its ideas are used; its code is not (AGPL-3.0), so this is
our own implementation.
- Built (
ExternalGuide.Matcher): after the call sign and an exact tidied name, a fuzzy name score (ratio, the same measure as RapidFuzz's: twice the longest common subsequence over both lengths). Accepted at 90 with a clear runner-up (5 points); otherwise refused. Names that differ in a number or in East/West are never candidates, which Dispatcharr's scoring allows.candidates(_:)returns the shortlist (70 and up) for Jev to pick from, per decision 8. - Eastern feed over Pacific: epg.pw lists most cable channels twice ("TNT HD" and "TNT HD (Pacific)"), which the exact match used to refuse as two it could be. The plain name wins over a bracketed one ("ESPN2 HD" over "ESPN2 (Alternate)"). That's the Eastern feed, right for Boston; a Pacific viewer would need the other, so this wants a timezone setting if that ever matters. East is the default feed and is dropped from names like HD, so "HBO" finds "HBO East" (it had found "HBO (Pacific)"); "(US)" is not another feed; epg.pw's "4K" entries are left out; and a name that is all region and generic words ("USA Network") keeps its USA. Run over the 196 IPTV names on the dial (2026-10-12): 107 matched as before, 27 new or corrected matches, none wrong that I could see. Still unmatched because epg.pw names them differently, for aliases or Jev: Fox Sports 1 ("FS1 Fox Sports 1 HD"), Nat Geo, C-SPAN, MTV ("MTV - Music Television HD"), NESN. epg.pw has no HGTV, Law & Order or UK channels at all.
- Not built yet: an exact stage on the provider's own guide id (and Gracenote station id) before any name matching, and source priority and a region bias (+15 for the preferred region's suffix, −15 for another's), which only matter once there's more than epg.pw's US list.
- Kept from ours: refusing ambiguity, bare network names (CBS, NBC…) never matched by name, and a hand-removed match staying removed. Dispatcharr has none of these: its next run overwrites a hand-set guide.
Later #
- EPG.lat and iptv-org as sources, once checked against the lineup.
- Xfinity's lineup plus Boston over-the-air, for antenna subchannels.
- EpGo on the homelab, in Docker, independent of either Mac.
Phin Tech docs
Rabbit Ears Manager in the store →