diff --git a/.github/ISSUE_TEMPLATE/bug-remote.md b/.github/ISSUE_TEMPLATE/bug-remote.md deleted file mode 100644 index ea2b36b..0000000 --- a/.github/ISSUE_TEMPLATE/bug-remote.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: 🐛 Bug report -about: Report a bug for this project ---- - -## Expected Behavior - - - -## Current Behavior - - - -## Steps to Reproduce - - - - -## Environment - -- OS: - - - -## Logs - - diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md deleted file mode 100644 index 76ec70c..0000000 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: 🚀 Feature request -about: Suggest a new idea ---- - -### Description - - - -### Possible solution - - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index b452334..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,19 +0,0 @@ - - - - -### Description - - - - -### Testing - - - - - -### New dependencies - - - diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 0c0dff6..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Continuous Integration -on: - pull_request: - branches: - - main -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Build service - run: docker build . diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml deleted file mode 100644 index 1b6e97e..0000000 --- a/.github/workflows/nightly-release.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Nightly Release - -on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: {} - -jobs: - nightly-release: - name: Nightly Build and Release Docker image (if code changed in 24h) - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Check if code has changed within 24 hours - id: code-change - run: | - if [[ $(git rev-list --after="24 hours" --first-parent HEAD) ]]; then - echo "should-run=true" >> $GITHUB_OUTPUT - else - echo "should-run=false" >> $GITHUB_OUTPUT - fi - - - name: Login into GitHub Container Registry - if: steps.code-change.outputs.should-run == 'true' - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - - - name: Build Docker image - if: steps.code-change.outputs.should-run == 'true' - run: | - docker build \ - -t "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" \ - -t "ghcr.io/${GITHUB_REPOSITORY}:nightly" . - - - name: Release Docker image - if: steps.code-change.outputs.should-run == 'true' - run: | - docker push "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" - docker push "ghcr.io/${GITHUB_REPOSITORY}:nightly" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index d3d04ec..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - build-tag-release: - name: Build, tag, and release Docker image - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup release please - uses: google-github-actions/release-please-action@v2 - id: release - with: - token: ${{ secrets.GITHUB_TOKEN }} - release-type: simple - changelog-path: CHANGELOG.md - package-name: zap2xml - - - name: Login into GitHub Container Registry - if: ${{ steps.release.outputs.release_created }} - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - - - name: Build Docker image - if: ${{ steps.release.outputs.release_created }} - run: | - docker build \ - -t "ghcr.io/${GITHUB_REPOSITORY}:${{ steps.release.outputs.tag_name }}" \ - -t "ghcr.io/${GITHUB_REPOSITORY}:latest" . - - - name: Release Docker image - if: ${{ steps.release.outputs.release_created }} - run: | - docker push "ghcr.io/${GITHUB_REPOSITORY}:${{ steps.release.outputs.tag_name }}" - docker push "ghcr.io/${GITHUB_REPOSITORY}:latest" diff --git a/.gitignore b/.gitignore index fade825..a3e0822 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .zap2xmlrc +compose.yaml config/ xmltv/ +node_modules/ diff --git a/.zap2xmlrc-example b/.zap2xmlrc-example index 6263e8e..f1d1002 100644 --- a/.zap2xmlrc-example +++ b/.zap2xmlrc-example @@ -20,7 +20,7 @@ ncdays=0 # ncsdays: Number of days from the start to not cache (default: 0, cmd: -N) ncsdays=0 # ncmday: Specific day number to not cache, 1-based relative to start (default: -1, cmd: -B) -ncmday=-1 +# ncmday=-1 # Output settings # outfile: Output XML file path (default: xmltv.xml or xtvd.xml, cmd: -o) @@ -40,7 +40,7 @@ trailer=/config/trailers # Network # proxy: HTTP proxy server URL (default: none, cmd: -P) -proxy=http://localhost:8080 +# proxy=http://localhost:8080 # XTVD format settings (only used when outformat=xtvd) # lineuptype: Type of lineup - Cable/CableDigital/Satellite/LocalBroadcast (default: none) diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 08d2edd..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -# Changelog - -### [1.0.3](https://www.github.com/jef/zap2xml/compare/v1.0.2...v1.0.3) (2025-07-15) - - -### Bug Fixes - -* command line errors ([#11](https://www.github.com/jef/zap2xml/issues/11)) ([ac2fd43](https://www.github.com/jef/zap2xml/commit/ac2fd43215f474b051cfeb94d0845752aa4c5ced)) -* update AffiliateID param ([2809b27](https://www.github.com/jef/zap2xml/commit/2809b27975c44717cd0c6f40bde6283dcb921a96)) - -### [1.0.2](https://www.github.com/jef/zap2xml/compare/v1.0.1...v1.0.2) (2025-04-02) - - -### Bug Fixes - -* gracenote.com local URLs throughout code ([#17](https://www.github.com/jef/zap2xml/issues/17)) ([ec67964](https://www.github.com/jef/zap2xml/commit/ec67964282b3b1a391b7fe2190181c562701b89b)) - -### [1.0.1](https://www.github.com/jef/zap2xml/compare/v1.0.0...v1.0.1) (2025-04-02) - - -### Bug Fixes - -* update zap2it URL ([#13](https://www.github.com/jef/zap2xml/issues/13)) ([a41eab9](https://www.github.com/jef/zap2xml/commit/a41eab9f222f1625c4e20a29068bf81562a38829)) - -## 1.0.0 (2021-04-24) - - -### Features - -* update docker and pipeline ([e31071b](https://www.github.com/jef/zap2xml/commit/e31071bda880b57cabc174591e6b92a639735436)) diff --git a/Dockerfile b/Dockerfile index 6871720..24920c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM alpine:3.13.5 - -ENV SLEEPTIME=43200 +FROM alpine:3.22.1 RUN apk add --no-cache \ perl \ diff --git a/LICENSE b/LICENSE index bcce465..fc11c8d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Jeffrey LeCompte +Copyright (c) 2025 Jeffrey LeCompte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 57ab0fc..0b2992b 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,6 @@ See [zap2xml](https://web.archive.org/web/20200426004001/zap2xml.awardspace.info ## Docker -| Tag | Description | -| ------- | ----------------------- | -| latest | Stable zap2xml releases | -| nightly | HEAD zap2xml release | - ### docker-compose (recommended) ```yaml @@ -30,11 +25,11 @@ services: ### 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 | +| Variable | Description | Default | +| ------------ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `USER_AGENT` | Custom user agent string for HTTP requests. | `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). | `43200` | +| `TZ` | Timezone for program times (affects output XML and Perl's time calculations). | System default | ### Optional run configurations diff --git a/entrypoint.sh b/entrypoint.sh index f9edb40..cb09f0e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/sh +SLEEPTIME=43200 + while true; do DATE=$(date) eval /opt/zap2xml.pl "$OPT_ARGS" diff --git a/version.txt b/version.txt deleted file mode 100644 index 21e8796..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.3 diff --git a/zap2xml.pl b/zap2xml.pl index 937c83d..903df75 100755 --- a/zap2xml.pl +++ b/zap2xml.pl @@ -74,7 +74,6 @@ $sleeptime = 0; $allChan = 0; $shiftMinutes = 0; - $userAgent = $ENV{USER_AGENT} || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36'; $outputXTVD = 0; @@ -264,7 +263,7 @@ my $zstart = substr($ms, 0, -3); $params = "?time=$zstart×pan=$gridHours&pref=$zapPref&"; $params .= &getZapGParams(); - $params .= '&TMSID=&AffiliateID=lat&FromPage=TV%20Grid'; + $params .= '&TMSID=&AffiliateID=chi&FromPage=TV%20Grid'; $params .= '&ActivityID=1&OVDID=&isOverride=true'; $rs = &getURL($urlRoot . "api/grid$params",1); last if ($rs eq ''); @@ -432,11 +431,11 @@ sub stationToChannel { if (defined($options{z})) { return sprintf("I%s.%s.tvguide.com", $stations{$s}{number},$stations{$s}{stnNum}); } elsif (defined($options{O})) { - return sprintf("C%s%s.gracenote.com",$stations{$s}{number},lc($stations{$s}{name})); + return sprintf("C%s%s.zap2it.com",$stations{$s}{number},lc($stations{$s}{name})); } elsif (defined($options{9})) { - return sprintf("I%s.labs.gracenote.com",$stations{$s}{stnNum}); + return sprintf("I%s.labs.zap2it.com",$stations{$s}{stnNum}); } - return sprintf("I%s.%s.gracenote.com", $stations{$s}{number},$stations{$s}{stnNum}); + return sprintf("I%s.%s.zap2it.com", $stations{$s}{number},$stations{$s}{stnNum}); } sub sortChan { @@ -470,7 +469,7 @@ sub printHeader { if (defined($options{z})) { print $FH "\n"; } @@ -895,7 +894,7 @@ sub getZapParams { $phash{countryCode} = $country; $phash{headendId} = $lineupId; $phash{device} = $device; - $phash{aid} = 'lat'; + $phash{aid} = 'chi'; return %phash; } @@ -1345,7 +1344,7 @@ sub parseJSON { $programs{$cp}{imageUrl} = $turl; } if ($program->{'seriesId'} ne '' && $program->{'tmsId'} ne '') { - $programs{$cp}{url} = $urlRoot . "overview-affiliates.html?programSeriesId=" + $programs{$cp}{url} = $urlRoot . "/overview.html?programSeriesId=" . $program->{seriesId} . "&tmsId=" . $program->{tmsId}; } @@ -1573,7 +1572,7 @@ sub HELP_MESSAGE { -e = hex encode entities (html special characters like accents) -E "amp apos quot lt gt" = selectively encode standard XML entities -F = output channel names first (rather than "number name") - -O = use old tv_grab_na style channel ids (C###nnnn.gracenote.com) + -O = use old tv_grab_na style channel ids (C###nnnn.zap2it.com) -A "new live" = append " *" to program titles that are "new" and/or "live" -M = copy movie_year to empty movie sub-title tags -U = UTF-8 encoding (default = "ISO-8859-1") @@ -1587,7 +1586,7 @@ sub HELP_MESSAGE { -J = include xmltv file in output -Y (if not using username/password) -Z (if not using username/password) - -z = use tvguide.com instead of gracenote.com + -z = use tvguide.com instead of zap2it.com -a = output all channels (not just favorites) -j = add "series" category to all non-movie programs END