From f0ba2e9139f814e9499993bc64bc74b11e54e654 Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Sun, 12 Nov 2023 18:03:43 -0700 Subject: [PATCH] Added PPV ESPN events --- README.md | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- services/espn-handler.ts | 12 ++++++++++++ services/networks.ts | 1 + 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cade69..81a9b09 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-Current version: **2.0.19** +Current version: **2.0.20** # About This takes ESPN/ESPN+, FOX Sports, and MLB.tv programming and transforms it into a "live TV" experience with virtual linear channels. It will discover what is on, and generate a schedule of channels that will give you M3U and XMLTV files that you can import into something like [Jellyfin](https://jellyfin.org), [Channels](https://getchannels.com), or [xTeVe](https://github.com/xteve-project/xTeVe). @@ -51,6 +51,7 @@ Use if you would like to login with a TV provider or ESPN+ and access various ES | ACCN | ACCN: Set if your TV provider supports it | False | | ACCNX | ACCNX: Set if your TV provider supports it | False | | LONGHORN | Longhorn Network: Set if your TV provider supports it | False | +| ESPN_PPV | PPV: Set if you have purchased PPV events | False | #### FOX Sports Use if you would like to login with a TV provider and access various FOX Sports events diff --git a/package-lock.json b/package-lock.json index 10a9e5b..704e0b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eplustv", - "version": "2.0.19", + "version": "2.0.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eplustv", - "version": "2.0.19", + "version": "2.0.20", "license": "MIT", "dependencies": { "axios": "^1.2.2", diff --git a/package.json b/package.json index 80c1508..cafd288 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eplustv", - "version": "2.0.19", + "version": "2.0.20", "description": "", "scripts": { "start": "ts-node index.ts", diff --git a/services/espn-handler.ts b/services/espn-handler.ts index 23c54d8..9b80024 100644 --- a/services/espn-handler.ts +++ b/services/espn-handler.ts @@ -23,6 +23,7 @@ import { useLonghorn, useSec, useSecPlus, + useEspnPpv, } from './networks'; import {IAdobeAuth, isAdobeTokenValid, willAdobeTokenExpire, createAdobeAuthHeader} from './adobe-helpers'; import {getRandomHex} from './shared-helpers'; @@ -243,6 +244,9 @@ const getNetworkInfo = (network?: string) => { } else if (network === 'longhorn') { networks = '["5c1fd0f3-1022-3bc4-8af9-f785847baaf9"]'; packages = 'null'; + } else if (network === 'espn_ppv') { + networks = '["d41c5aaf-e100-4726-841f-1e453af347f9"]'; + packages = 'null'; } return [networks, packages]; @@ -394,6 +398,10 @@ class EspnHandler { const liveEntries = await this.getLiveEvents('longhorn'); entries = [...entries, ...liveEntries]; } + if (useEspnPpv) { + const liveEntries = await this.getLiveEvents('espn_ppv'); + entries = [...entries, ...liveEntries]; + } } catch (e) { console.log('Could not parse ESPN events'); } @@ -444,6 +452,10 @@ class EspnHandler { const upcomingEntries = await this.getUpcomingEvents(date.format('YYYY-MM-DD'), 'longhorn'); entries = [...entries, ...upcomingEntries]; } + if (useEspnPpv) { + const upcomingEntries = await this.getUpcomingEvents(date.format('YYYY-MM-DD'), 'espn_ppv'); + entries = [...entries, ...upcomingEntries]; + } } catch (e) { console.log('Could not parse ESPN events'); } diff --git a/services/networks.ts b/services/networks.ts index a86878d..2e08804 100644 --- a/services/networks.ts +++ b/services/networks.ts @@ -7,6 +7,7 @@ export const useSecPlus = process.env.SECPLUS?.toLowerCase() === 'true' ? true : export const useAccN = process.env.ACCN?.toLowerCase() === 'true' ? true : false; export const useAccNx = process.env.ACCNX?.toLowerCase() === 'true' ? true : false; export const useLonghorn = process.env.LONGHORN?.toLowerCase() === 'true' ? true : false; +export const useEspnPpv = process.env.ESPN_PPV?.toLowerCase() === 'true' ? true : false; export const useEspnPlus = process.env.ESPNPLUS?.toLowerCase() === 'false' ? false : true; export const useFoxSports = process.env.FOXSPORTS?.toLowerCase() === 'true' ? true : false;