|
1 | 1 | # zap2xml
|
2 | 2 |
|
3 |
| -See [zap2xml](https://web.archive.org/web/20200426004001/zap2xml.awardspace.info/) for original Perl script and guidance for the configuration file. |
| 3 | +See [zap2xml](https://web.archive.org/web/20200426004001/zap2xml.awardspace.info/) for original Perl script and guidance |
| 4 | +for the configuration file. |
4 | 5 |
|
5 |
| -## Docker |
| 6 | +## How to use |
| 7 | + |
| 8 | +### Retrieving your Lineup ID |
| 9 | + |
| 10 | +Visit the [Retrieving Lineup ID](https://github.com/jef/zap2xml/wiki/Retrieving-Lineup-ID) in the Wiki. |
| 11 | + |
| 12 | +### Node.js |
| 13 | + |
| 14 | +```bash |
| 15 | +npm i && npm run dev |
| 16 | +``` |
| 17 | + |
| 18 | +See [Command line arguments](#command-line-arguments) for configuration options. |
| 19 | + |
| 20 | +### Docker |
6 | 21 |
|
7 | 22 | | Tag | Description |
|
8 | 23 | | ------- | ----------------------- |
|
9 | 24 | | latest | Stable zap2xml releases |
|
10 | 25 | | nightly | HEAD zap2xml release |
|
11 | 26 |
|
12 |
| -### docker-compose (recommended) |
| 27 | +#### docker-compose |
13 | 28 |
|
14 | 29 | ```yaml
|
15 | 30 | services:
|
16 | 31 | zap2xml:
|
17 | 32 | container_name: zap2xml
|
18 | 33 | image: ghcr.io/jef/zap2xml:latest
|
19 | 34 | environment:
|
20 |
| - OPT_ARGS: >- |
21 |
| - -I -D -C /config/.zap2xmlrc -o /xmltv/xmltv.xml |
22 |
| - TZ: America/New_York # Consider using your timezone |
| 35 | + OUTPUT_FILE: /xmltv/xmltv.xml |
23 | 36 | volumes:
|
24 |
| - - /path/to/zap2xml/config:/config |
25 |
| - - /path/to/xmltv:/xmltv # nice for mapping other drives to this that may use xmltv.xml |
| 37 | + - ./xmltv:/xmltv |
26 | 38 | restart: unless-stopped
|
27 | 39 | ```
|
28 | 40 |
|
| 41 | +See [Environment variables](#environment-variables) for configuration options. |
| 42 | +
|
29 | 43 | ## Configuration
|
30 | 44 |
|
31 |
| -### Optional environment variables |
32 |
| -
|
33 |
| -| Variable | Description | Type | Default | |
34 |
| -| ------------ | ---------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- | |
35 |
| -| `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` | |
36 |
| -| `SLEEPTIME` | Number of seconds to sleep between runs (useful for scheduling in Docker or cron). | Integer | `43200` | |
37 |
| -| `TZ` | Timezone for program times (affects output XML and Perl's time calculations). | String | System default | |
38 |
| - |
39 |
| -### Optional run configurations |
40 |
| - |
41 |
| -| Option | Type | Default | Description | Config File | Command Line | |
42 |
| -| ---------------- | --------- | ----------- | ------------------------------------------------------ | ----------------------------- | ------------ | |
43 |
| -| `start` | Integer | `0` | Number of days to offset from today for the start date | `start=1` | `-s` | |
44 |
| -| `days` | Integer | `7` | Number of days of program data to fetch | `days=14` | `-d` | |
45 |
| -| `retries` | Integer | `3` | Number of connection retries before failure (max 20) | `retries=5` | `-r` | |
46 |
| -| `user` | String | (empty) | Username/email for Zap2it account | `[email protected]` | `-u` | |
47 |
| -| `pass` | String | (empty) | Password for Zap2it account | `pass=mypassword` | `-p` | |
48 |
| -| `cache` | Directory | `cache` | Directory to store cached data files | `cache=/config/cache` | `-c` | |
49 |
| -| `ncdays` | Integer | `0` | Number of days from the end to not cache | `ncdays=2` | `-n` | |
50 |
| -| `ncsdays` | Integer | `0` | Number of days from the start to not cache | `ncsdays=1` | `-N` | |
51 |
| -| `ncmday` | Integer | `-1` | Specific day number to not cache (1-based) | `ncmday=3` | `-B` | |
52 |
| -| `outfile` | File path | `xmltv.xml` | Output XML file path | `outfile=/xmltv/xmltv.xml` | `-o` | |
53 |
| -| `outformat` | String | `xmltv` | Output format (xmltv/xtvd) | `outformat=xtvd` | `-x` | |
54 |
| -| `lang` | String | `en` | Language code for program data | `lang=es` | `-l` | |
55 |
| -| `icon` | Directory | (disabled) | Directory to store channel icons | `icon=/config/icons` | `-i` | |
56 |
| -| `trailer` | Directory | (disabled) | Directory to store movie trailers | `trailer=/config/trailers` | `-t` | |
57 |
| -| `proxy` | URL | (none) | HTTP proxy server URL | `proxy=http://localhost:8080` | `-P` | |
58 |
| -| `lineuptype` | String | (none) | Type of lineup (XTVD only) | `lineuptype=Cable` | - | |
59 |
| -| `lineupname` | String | (none) | Name of the lineup (XTVD only) | `lineupname=My Provider` | - | |
60 |
| -| `lineuplocation` | String | (none) | Location of the lineup (XTVD only) | `lineuplocation=New York, NY` | - | |
61 |
| -| `lineupid` | String | (none) | Lineup ID for TV Guide | `lineupid=X:80000` | `-Y` | |
62 |
| -| `postalcode` | String | (none) | Postal code for TV Guide | `postalcode=01010` | `-Z` | |
63 |
| -| `shiftMinutes` | Integer | `0` | Offset program times by minutes | - | `-m` | |
64 |
| -| `sleeptime` | Integer | `0` | Sleep between requests (seconds) | - | `-S` | |
65 |
| -| `allChan` | Boolean | `false` | Output all channels (not just favorites) | - | `-a` | |
66 |
| -| `outputXTVD` | Boolean | `false` | Force XTVD output format | - | `-x` | |
67 |
| -| `includeDetails` | Boolean | `false` | Include program details (extra requests) | - | `-D` | |
68 |
| -| `includeIcons` | Boolean | `false` | Include program icons (extra requests) | - | `-I` | |
69 |
| -| `retainOrder` | Boolean | `false` | Retain website channel order | - | `-b` | |
70 |
| -| `quiet` | Boolean | `false` | Quiet mode (no status output) | - | `-q` | |
71 |
| -| `wait` | Boolean | `false` | Wait on exit (require keypress) | - | `-w` | |
72 |
| -| `hexEncode` | Boolean | `false` | Hex encode HTML entities | - | `-e` | |
73 |
| -| `utf8` | Boolean | `false` | UTF-8 encoding (default: ISO-8859-1) | - | `-U` | |
74 |
| -| `liveTag` | Boolean | `false` | Output `<live />` tag | - | `-L` | |
75 |
| -| `noTBA` | Boolean | `false` | Don't cache files with "TBA" titles | - | `-T` | |
76 |
| -| `channelFirst` | Boolean | `false` | Output channel names first | - | `-F` | |
77 |
| -| `oldStyle` | Boolean | `false` | Use old tv_grab_na style channel IDs | - | `-O` | |
78 |
| -| `appendFlags` | String | (none) | Append flags to program titles | - | `-A` | |
79 |
| -| `copyYear` | Boolean | `false` | Copy movie_year to sub-title tags | - | `-M` | |
80 |
| -| `addSeries` | Boolean | `false` | Add "series" category to non-movies | - | `-j` | |
81 |
| -| `includeXMLTV` | File | (none) | Include XMLTV file in output | - | `-J` | |
82 |
| -| `useTVGuide` | Boolean | `false` | Use tvguide.com instead of gracenote.com | - | `-z` | |
83 |
| - |
84 |
| -### Notes |
85 |
| - |
86 |
| -- Configuration file values can be overridden by command line options |
87 |
| -- The configuration file supports comments (lines starting with `#`) |
88 |
| -- Empty lines are ignored |
89 |
| -- Values are trimmed of leading/trailing whitespace |
90 |
| -- Boolean options (like `outformat=xtvd`) are case-insensitive |
| 45 | +### Environment variables |
| 46 | +
|
| 47 | +| Variable | Description | Type | Default | |
| 48 | +| ------------- | --------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------- | |
| 49 | +| `LINEUP_ID` | Lineup ID; You can find this at https://tvlistings.gracenote.com/grid-affiliates.html?aid=orbebb | String | `USA-lineupId-DEFAULT` (Attenna) | |
| 50 | +| `TIMESPAN` | Either 3 or 6 hours of shows | Integer | 3 | |
| 51 | +| `PREF` | User Preferences, comma separated list. `m` for showing music, `p` for showing pay-per-view, `h` for showing HD | String | (empty) | |
| 52 | +| `POSTAL_CODE` | Postal code of where shows are available. | Integer | 30309 | |
| 53 | +| `USER_AGENT` | Custom user agent string for HTTP requests. | String | Uses random if not specified | |
| 54 | +| `TZ` | Timezone | String | System default | |
| 55 | +| `SLEEP_TIME` | Sleep time before next run in seconds (default: 10800, Only used with Docker.) | Integer | 10800 | |
| 56 | +| `OUTPUT_FILE` | Output file name (default: xmltv.xml) | String | xmltv.xml | |
| 57 | + |
| 58 | +### Command line arguments |
| 59 | + |
| 60 | +| Argument | Description | Type | Default | |
| 61 | +| -------------- | --------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------- | |
| 62 | +| `--lineupId` | Lineup ID; You can find this at https://tvlistings.gracenote.com/grid-affiliates.html?aid=orbebb | String | `USA-lineupId-DEFAULT` (Attenna) | |
| 63 | +| `--timespan` | Either 3 or 6 hours of shows | Integer | 3 | |
| 64 | +| `--pref` | User Preferences, comma separated list. `m` for showing music, `p` for showing pay-per-view, `h` for showing HD | String | (empty) | |
| 65 | +| `--postalCode` | Postal code of where shows are available. | Integer | 30309 | |
| 66 | +| `--userAgent` | Custom user agent string for HTTP requests. | String | Uses random if not specified | |
| 67 | +| `--timezone` | Timezone | String | System default | |
| 68 | +| `--outputFile` | Output file name (default: xmltv.xml) | String | xmltv.xml | |
0 commit comments