4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.zap2xmlrc
|
||||||
|
|
||||||
|
config/
|
||||||
|
xmltv/
|
||||||
@@ -1,20 +1,57 @@
|
|||||||
|
# Basic settings
|
||||||
|
# start: Number of days to offset from today for the start date (default: 0, cmd: -s)
|
||||||
start=0
|
start=0
|
||||||
|
# days: Number of days of program data to fetch (default: 7, cmd: -d)
|
||||||
days=7
|
days=7
|
||||||
ncdays=0
|
# retries: Number of connection retries before failure (default: 3, max: 20, cmd: -r)
|
||||||
ncsdays=0
|
|
||||||
ncmday=-1
|
|
||||||
retries=3
|
retries=3
|
||||||
user=user
|
|
||||||
pass=password
|
# Authentication
|
||||||
|
# user: Username/email for Zap2it account (default: empty, cmd: -u)
|
||||||
|
user=myemail@example.com
|
||||||
|
# pass: Password for Zap2it account (default: empty, cmd: -p)
|
||||||
|
pass=mypassword
|
||||||
|
|
||||||
|
# Cache settings
|
||||||
|
# cache: Directory to store cached data files (default: cache, cmd: -c)
|
||||||
cache=/config/cache
|
cache=/config/cache
|
||||||
icon=/config/icons
|
# ncdays: Number of days from the end to not cache (default: 0, cmd: -n)
|
||||||
trailer=/config/trailers
|
ncdays=0
|
||||||
lang=en
|
# ncsdays: Number of days from the start to not cache (default: 0, cmd: -N)
|
||||||
proxy=http://localhost:8080
|
ncsdays=0
|
||||||
|
# ncmday: Specific day number to not cache, 1-based relative to start (default: -1, cmd: -B)
|
||||||
|
ncmday=-1
|
||||||
|
|
||||||
|
# Output settings
|
||||||
|
# outfile: Output XML file path (default: xmltv.xml or xtvd.xml, cmd: -o)
|
||||||
outfile=/xmltv/xmltv.xml
|
outfile=/xmltv/xmltv.xml
|
||||||
outformat=xmltv (or 'xtvd')
|
# outformat: Output format - xmltv or xtvd (default: xmltv, cmd: -x forces xtvd)
|
||||||
lineuptype=type (xtvd only - Cable/CableDigital/Satellite/LocalBroadcast)
|
outformat=xmltv
|
||||||
lineupname=name (xtvd only)
|
|
||||||
lineuplocation=location (xtvd only)
|
# Language
|
||||||
|
# lang: Language code for program data (default: en, cmd: -l)
|
||||||
|
lang=en
|
||||||
|
|
||||||
|
# Media directories
|
||||||
|
# icon: Directory to store channel icons (default: disabled, cmd: -i)
|
||||||
|
icon=/config/icons
|
||||||
|
# trailer: Directory to store movie trailers (default: disabled, cmd: -t)
|
||||||
|
trailer=/config/trailers
|
||||||
|
|
||||||
|
# Network
|
||||||
|
# proxy: HTTP proxy server URL (default: none, cmd: -P)
|
||||||
|
proxy=http://localhost:8080
|
||||||
|
|
||||||
|
# XTVD format settings (only used when outformat=xtvd)
|
||||||
|
# lineuptype: Type of lineup - Cable/CableDigital/Satellite/LocalBroadcast (default: none)
|
||||||
|
lineuptype=Cable
|
||||||
|
# lineupname: Name of the lineup (default: none)
|
||||||
|
lineupname=My Cable Provider
|
||||||
|
# lineuplocation: Location of the lineup (default: none)
|
||||||
|
lineuplocation=New York, NY
|
||||||
|
|
||||||
|
# Alternative authentication (TV Guide)
|
||||||
|
# lineupid: Lineup ID for TV Guide, alternative to username/password (default: none, cmd: -Y)
|
||||||
lineupid=X:80000
|
lineupid=X:80000
|
||||||
|
# postalcode: Postal code for TV Guide lineup lookup (default: none, cmd: -Z)
|
||||||
postalcode=01010
|
postalcode=01010
|
||||||
|
|||||||
81
README.md
81
README.md
@@ -4,12 +4,12 @@ See [zap2xml](https://web.archive.org/web/20200426004001/zap2xml.awardspace.info
|
|||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
| Tag | Description |
|
| Tag | Description |
|
||||||
|---|---|
|
| ------- | ----------------------- |
|
||||||
| latest | Stable zap2xml releases |
|
| latest | Stable zap2xml releases |
|
||||||
| nightly | HEAD zap2xml release |
|
| nightly | HEAD zap2xml release |
|
||||||
|
|
||||||
### Compose
|
### docker-compose (recommended)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -19,11 +19,72 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
OPT_ARGS: >-
|
OPT_ARGS: >-
|
||||||
-I -D -C /config/.zap2xmlrc -o /xmltv/xmltv.xml
|
-I -D -C /config/.zap2xmlrc -o /xmltv/xmltv.xml
|
||||||
SLEEPTIME: 43200 # 12 hours in seconds
|
TZ: America/New_York # Consider using your timezone
|
||||||
TZ: America/New_York
|
|
||||||
USER_AGENT: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" # Optional: customize user agent
|
|
||||||
volumes:
|
volumes:
|
||||||
- /path/to/appdata/zap2xml:/config
|
- /path/to/zap2xml/config:/config
|
||||||
- /path/to/appdata/xmltv:/xmltv # nice for mapping other drives to this that may use xmltv.xml
|
- /path/to/xmltv:/xmltv # nice for mapping other drives to this that may use xmltv.xml
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Optional environment variables
|
||||||
|
|
||||||
|
| Variable | Description | Type | Default |
|
||||||
|
| ------------ | ---------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `USER_AGENT` | Custom user agent string for HTTP requests. | String | `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36` |
|
||||||
|
| `SLEEPTIME` | Number of seconds to sleep between runs (useful for scheduling in Docker or cron). | Integer | `43200` |
|
||||||
|
| `TZ` | Timezone for program times (affects output XML and Perl's time calculations). | String | System default |
|
||||||
|
|
||||||
|
### Optional run configurations
|
||||||
|
|
||||||
|
| Option | Type | Default | Description | Config File | Command Line |
|
||||||
|
| ---------------- | --------- | ----------- | ------------------------------------------------------ | ----------------------------- | ------------ |
|
||||||
|
| `start` | Integer | `0` | Number of days to offset from today for the start date | `start=1` | `-s` |
|
||||||
|
| `days` | Integer | `7` | Number of days of program data to fetch | `days=14` | `-d` |
|
||||||
|
| `retries` | Integer | `3` | Number of connection retries before failure (max 20) | `retries=5` | `-r` |
|
||||||
|
| `user` | String | (empty) | Username/email for Zap2it account | `user=myemail@example.com` | `-u` |
|
||||||
|
| `pass` | String | (empty) | Password for Zap2it account | `pass=mypassword` | `-p` |
|
||||||
|
| `cache` | Directory | `cache` | Directory to store cached data files | `cache=/config/cache` | `-c` |
|
||||||
|
| `ncdays` | Integer | `0` | Number of days from the end to not cache | `ncdays=2` | `-n` |
|
||||||
|
| `ncsdays` | Integer | `0` | Number of days from the start to not cache | `ncsdays=1` | `-N` |
|
||||||
|
| `ncmday` | Integer | `-1` | Specific day number to not cache (1-based) | `ncmday=3` | `-B` |
|
||||||
|
| `outfile` | File path | `xmltv.xml` | Output XML file path | `outfile=/xmltv/xmltv.xml` | `-o` |
|
||||||
|
| `outformat` | String | `xmltv` | Output format (xmltv/xtvd) | `outformat=xtvd` | `-x` |
|
||||||
|
| `lang` | String | `en` | Language code for program data | `lang=es` | `-l` |
|
||||||
|
| `icon` | Directory | (disabled) | Directory to store channel icons | `icon=/config/icons` | `-i` |
|
||||||
|
| `trailer` | Directory | (disabled) | Directory to store movie trailers | `trailer=/config/trailers` | `-t` |
|
||||||
|
| `proxy` | URL | (none) | HTTP proxy server URL | `proxy=http://localhost:8080` | `-P` |
|
||||||
|
| `lineuptype` | String | (none) | Type of lineup (XTVD only) | `lineuptype=Cable` | - |
|
||||||
|
| `lineupname` | String | (none) | Name of the lineup (XTVD only) | `lineupname=My Provider` | - |
|
||||||
|
| `lineuplocation` | String | (none) | Location of the lineup (XTVD only) | `lineuplocation=New York, NY` | - |
|
||||||
|
| `lineupid` | String | (none) | Lineup ID for TV Guide | `lineupid=X:80000` | `-Y` |
|
||||||
|
| `postalcode` | String | (none) | Postal code for TV Guide | `postalcode=01010` | `-Z` |
|
||||||
|
| `shiftMinutes` | Integer | `0` | Offset program times by minutes | - | `-m` |
|
||||||
|
| `sleeptime` | Integer | `0` | Sleep between requests (seconds) | - | `-S` |
|
||||||
|
| `allChan` | Boolean | `false` | Output all channels (not just favorites) | - | `-a` |
|
||||||
|
| `outputXTVD` | Boolean | `false` | Force XTVD output format | - | `-x` |
|
||||||
|
| `includeDetails` | Boolean | `false` | Include program details (extra requests) | - | `-D` |
|
||||||
|
| `includeIcons` | Boolean | `false` | Include program icons (extra requests) | - | `-I` |
|
||||||
|
| `retainOrder` | Boolean | `false` | Retain website channel order | - | `-b` |
|
||||||
|
| `quiet` | Boolean | `false` | Quiet mode (no status output) | - | `-q` |
|
||||||
|
| `wait` | Boolean | `false` | Wait on exit (require keypress) | - | `-w` |
|
||||||
|
| `hexEncode` | Boolean | `false` | Hex encode HTML entities | - | `-e` |
|
||||||
|
| `utf8` | Boolean | `false` | UTF-8 encoding (default: ISO-8859-1) | - | `-U` |
|
||||||
|
| `liveTag` | Boolean | `false` | Output `<live />` tag | - | `-L` |
|
||||||
|
| `noTBA` | Boolean | `false` | Don't cache files with "TBA" titles | - | `-T` |
|
||||||
|
| `channelFirst` | Boolean | `false` | Output channel names first | - | `-F` |
|
||||||
|
| `oldStyle` | Boolean | `false` | Use old tv_grab_na style channel IDs | - | `-O` |
|
||||||
|
| `appendFlags` | String | (none) | Append flags to program titles | - | `-A` |
|
||||||
|
| `copyYear` | Boolean | `false` | Copy movie_year to sub-title tags | - | `-M` |
|
||||||
|
| `addSeries` | Boolean | `false` | Add "series" category to non-movies | - | `-j` |
|
||||||
|
| `includeXMLTV` | File | (none) | Include XMLTV file in output | - | `-J` |
|
||||||
|
| `useTVGuide` | Boolean | `false` | Use tvguide.com instead of gracenote.com | - | `-z` |
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- Configuration file values can be overridden by command line options
|
||||||
|
- The configuration file supports comments (lines starting with `#`)
|
||||||
|
- Empty lines are ignored
|
||||||
|
- Values are trimmed of leading/trailing whitespace
|
||||||
|
- Boolean options (like `outformat=xtvd`) are case-insensitive
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
while :
|
while true; do
|
||||||
do
|
|
||||||
DATE=$(date)
|
DATE=$(date)
|
||||||
eval /opt/zap2xml.pl "$OPT_ARGS"
|
eval /opt/zap2xml.pl "$OPT_ARGS"
|
||||||
echo "Last run time: $DATE"
|
echo "Last run time: $DATE"
|
||||||
|
|||||||
Reference in New Issue
Block a user