HUB
Sign inSign up

nekkron/hdhomerun-xmltv

By nekkron

•Updated 7 days ago

Queries an HDHomeRun and writes an XMLTV guide file you can import into anything that reads XMLTV.

Image
Integration & delivery
0

276

nekkron/hdhomerun-xmltv repository overview

⁠hdhomerun-xmltv

A tiny Docker container that queries your local HDHomeRun and writes an XMLTV guide file you can import into Jellyfin, Emby, Kodi, TVHeadend, NextPVR, Channels DVR, or anything else that reads XMLTV.

  • Pure Python standard library, small Alpine image, works on amd64 / arm64 / armv7
  • Refreshes on a schedule and writes the file atomically (apps never read a half-written file)
  • Keeps the last good file if a refresh fails
  • Optional built-in web server so apps can use a URL instead of a file path

⁠Quick start

# edit HD_IP and TZ in docker-compose.yml, then:
docker compose up -d --build
docker compose logs -f

Your guide appears at ./guide/guide.xml (and at http://<docker-host>:8080/guide.xml).

Without compose:

docker build -t hdhomerun-xmltv .
docker run -d --name hdhomerun-xmltv --restart unless-stopped \
  -e HD_IP=192.168.1.50 -e TZ=America/New_York \
  -v /path/to/guide:/data -p 8080:8080 \
  hdhomerun-xmltv

⁠Environment variables

VariableDefaultDescription
HD_IP(required)IP or hostname of the HDHomeRun. Several devices: comma-separated (192.168.1.50,192.168.1.51).
TZUTCIANA timezone, e.g. Europe/Rome. Used for log timestamps and for programme times when building from the JSON guide.
OUTPUT_DIR/dataWhere the file is saved. Mount a host folder here.
OUTPUT_FILEguide.xmlFile name inside OUTPUT_DIR.
REFRESH_HOURS12How often to rebuild the guide.
GUIDE_MODEautoauto = official XMLTV, fall back to JSON; xmltv = official only; json = JSON guide only.
GUIDE_DAYS3Days of guide to build in JSON mode (1-14).
HTTP_PORT8080Built-in web server port. 0 disables it.
WRITE_GZIPfalseAlso write guide.xml.gz.
FILTER_TO_LINEUPtrueJSON mode: only include channels that are in the tuner's lineup.
XMLTV_LANGenLanguage code on titles and descriptions.
RUN_ONCEfalseWrite the file once and exit (handy with host cron).

⁠Where the guide data comes from

  1. The container asks your HDHomeRun for its DeviceAuth (http://<HD_IP>/discover.json).
  2. Official feed (preferred): https://api.hdhomerun.com/api/xmltv returns 14 days of XMLTV. SiliconDust documents this as requiring an HDHomeRun DVR subscription.
  3. Fallback: if the official feed is refused, the container reads the JSON guide API (/api/guide) and converts it to XMLTV itself. SiliconDust asks that this API not be used for bulk downloads, so the default is 3 days, fetched in 24-hour chunks with a pause between.

The container needs outbound internet access to api.hdhomerun.com plus LAN access to the device. It does not need host networking.

⁠Using the file

Jellyfin: Dashboard > Live TV > TV Guide Data Providers > Add > XMLTV, then set File or URL to /path/inside/jellyfin/guide.xml or http://<docker-host>:8080/guide.xml. Then map channels (the numbers and names should auto-match).

Emby: Settings > Live TV > Add guide data provider > XMLTV, same File or URL options.

Others: point the XMLTV/EPG setting at the same URL or file.

Channel IDs in the JSON-built guide are the HDHomeRun guide numbers (e.g. 3.1), and each channel also carries display names for the callsign and for "number callsign".

⁠Troubleshooting

  • cannot query HDHomeRun: check HD_IP and that the container can reach it (docker exec hdhomerun-xmltv wget -qO- http://<HD_IP>/discover.json).
  • Falls back to JSON every time: the official feed is refused, usually because the device isn't on an HDHomeRun DVR subscription.
  • Wrong times: set TZ to an IANA name (America/Chicago, not CST).
  • Permission errors on the volume: set user: "UID:GID" in compose to match the folder owner.
  • Container health: docker ps shows unhealthy if no fresh file was written for roughly two refresh intervals.

⁠Multi-arch build (optional)

docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t yourname/hdhomerun-xmltv --push .

Tag summary

Content type

Image

Digest

sha256:1bb130027…

Size

17.2 MB

Last updated

7 days ago

docker pull nekkron/hdhomerun-xmltv