This script converts TV listings from Zap2It into the XMLTV format, which can be used with media applications like Jellyfin and Emby.
It is written in Go and can be run on Windows, macOS, and Linux without any dependencies. It can be run as a daemon to automatically update the listings every X days.
- Fetch TV listings from Zap2It.
- Convert listings to XMLTV format.
- Customize output with configuration.
- Run as a daemon to automatically update listings.
Download the release for your platform from the releases page.
or build from source:
git clone https://github.com/spf13/zap2itxmltv.git
go build -o zap2itxmltv
./zap2itxmltv [options]
Either put it in a cron job or just use -d to run it as a daemon.
Example to update every 5 days:
./zap2itxmltv -d -i 5 -o tvschedule/guide.xmltv
-
-c, --configfile
Path to the configuration file. Default: ./zap2itconfig.ini -
-o, --outputfile
Path to the output XMLTV file. Default: xmlguide.xmltv -
-l, --language
Language code for the guide data. Default: en -
-f, --findid
Find headendID and lineupID for your region. -
-d, --daemon
Run the script as a daemon. Fetches listings every X days (default: 7). -
-i, --interval
Interval in days to fetch listings when running as a daemon. Default: 7
Create a zap2itconfig.ini file with the following content:
[creds]
username: USERNAME
password: PASSWORD
[prefs]
country: USA
zipCode: ZIPCODE
historicalGuideDays: 14
lang: en
[lineup]
headendId: lineupId
lineupId: USA-lineupId-DEFAULT
device: -
To use this script, you'll need a Zap2It account, your headendID, lineupID and device. Here's how to get them:
- Sign up for a free account at Zap2It.
- Add your username, password, and zipCode to the configuration file.
- Run the script with the
-f
option to find your headendID and lineupID.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.