Zap2xml
📺 Automate TV guides to XMLTV
Install / Use
/learn @jef/Zap2xmlREADME
zap2xml
Automate TV guides to XMLTV format. Easy to use, up-to-date. See below for getting started.
I also somewhat maintain a version of the original in the historical-perl branch if you're interested in that.
How to use
Node.js
npm i && npm run build && node dist/index.js
See Command line arguments for configuration options.
Docker
| Tag | Description | | ------- | ----------------------- | | latest | Stable zap2xml releases | | nightly | HEAD zap2xml release |
docker-compose
services:
zap2xml:
container_name: zap2xml
image: ghcr.io/jef/zap2xml:latest
environment:
OUTPUT_FILE: /xmltv/xmltv.xml
volumes:
- ./xmltv:/xmltv
restart: unless-stopped
See Environment variables for configuration options.
Configuration
Environment variables
| Variable | Description | Default |
| ------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| LINEUP_ID | Lineup ID; Read more in the Wiki | USA-lineupId-DEFAULT (Attenna) |
| TIMESPAN | Timespan in hours (up to 360 = 15 days, default: 6) | 6 |
| PREF | User Preferences, comma separated list. m for showing music, p for showing pay-per-view, h for showing HD | (empty) |
| COUNTRY | Country code (default: USA) | USA |
| POSTAL_CODE | Postal code of where shows are available. | 30309 |
| USER_AGENT | Custom user agent string for HTTP requests. | Uses random if not specified |
| TZ | Timezone | System default |
| SLEEP_TIME | Sleep time before next run in seconds (default: 21600, Only used with Docker.) | 21600 |
| OUTPUT_FILE | Output file name (default: xmltv.xml) | xmltv.xml |
Command line arguments
| Argument | Description | Default |
| -------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| --lineupId | Lineup ID; Read more in the Wiki | USA-lineupId-DEFAULT (Attenna) |
| --timespan | Timespan in hours (up to 360 = 15 days, default: 6) | 6 |
| --pref | User Preferences, comma separated list. m for showing music, p for showing pay-per-view, h for showing HD | (empty) |
| --country | Country code (default: USA) | USA |
| --postalCode | Postal code of where shows are available. | 30309 |
| --userAgent | Custom user agent string for HTTP requests. | Uses random if not specified |
| --timezone | Timezone | System default |
| --outputFile | Output file name (default: xmltv.xml) | xmltv.xml |
Setup and running in intervals
Running natively
You can run zap2xml natively on your system. It is recommended to use a task scheduler to run it in intervals.
Here are some links to get you started on your machine:
- Linux and Raspberry Pi: https://github.com/jef/zap2xml/wiki/Running-on-Linux-and-Raspberry-Pi
- macOS: https://github.com/jef/zap2xml/wiki/Running-on-macOS
- Windows: https://github.com/jef/zap2xml/wiki/Running-on-Windows
If you want to run zap2xml in intervals, you can use a task scheduler like cron on Linux or the Task Scheduler on Windows. Each of the wiki pages above has a section on how to set up zap2xml to run in intervals.
Running in Docker
You can run zap2xml in a Docker container. The SLEEP_TIME environment variable can be used to set the interval between runs. The default is 21600 seconds (6 hours).
FAQ
How do I get my Lineup ID?
Visit https://github.com/jef/zap2xml/wiki/Retrieving-Lineup-ID
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
