Skip to content

Commit

Permalink
Small cleanup for FOX 4K
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 7, 2024
1 parent fc7a42e commit f7c5565
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://i.imgur.com/FIGZdR3.png">
</p>

Current version: **3.2.8**
Current version: **3.2.9**

# About
This takes ESPN/ESPN+, FOX Sports, Paramount+, MSG+, NFL+, B1G+, NESN, Mountain West, FloSports, or 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) or [Channels](https://getchannels.com).
Expand Down Expand Up @@ -58,7 +58,7 @@ Use if you would like to login with a TV provider and access various FOX Sports
| Environment Variable | Description | Required? | Default |
|---|---|---|---|
| FOXSPORTS** | Set if your TV provider supports it | No | False |
| MAX_RESOLUTION | Max resolution to use. Valid options are `UHD/HDR`, `UHD/SDR`, and `720p` (Some events don't offer 4K and will attempt to play the highest framerate available for selected resolution). | No | UHD/SDR |
| MAX_RESOLUTION | Max resolution to use. Valid options are `UHD/HDR` and `720p` (Some events don't offer 4K and will attempt to play the highest framerate available for selected resolution). | No | 720p |
| FOX_ONLY_4K | Only grab 4K events | No | False |

#### Paramount+
Expand Down
17 changes: 11 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ app.get('/linear-xmltv.xml', async (req, res) => {
app.get('/channels/:id.m3u8', async (req, res) => {
const {id} = req.params;

let contents = null;
let contents: string | undefined;

// Channel data needs initial object
if (!appStatus.channels[id]) {
Expand All @@ -147,6 +147,9 @@ app.get('/channels/:id.m3u8', async (req, res) => {
console.log(
`Could not get a playlist for channel #${id}. Please make sure there is an event scheduled and you have access to it.`,
);

delete appStatus.channels[id];

notFound(req, res);
return;
}
Expand All @@ -163,7 +166,7 @@ app.get('/channels/:id.m3u8', async (req, res) => {
app.get('/chunklist/:id/:chunklistid.m3u8', async (req, res) => {
const {id, chunklistid} = req.params;

let contents = null;
let contents: string | null;

if (!appStatus.channels[id]?.player?.playlist) {
notFound(req, res);
Expand Down Expand Up @@ -191,10 +194,11 @@ app.get('/chunklist/:id/:chunklistid.m3u8', async (req, res) => {

app.get('/channels/:id/:part.key', async (req, res) => {
const {id, part} = req.params;
let contents;

let contents: ArrayBuffer | undefined;

try {
contents = await appStatus.channels[id].player.getSegmentOrKey(part);
contents = await appStatus.channels[id].player?.getSegmentOrKey(part);
} catch (e) {
notFound(req, res);
return;
Expand All @@ -216,10 +220,11 @@ app.get('/channels/:id/:part.key', async (req, res) => {

app.get('/channels/:id/:part.ts', async (req, res) => {
const {id, part} = req.params;
let contents;

let contents: ArrayBuffer | undefined;

try {
contents = await appStatus.channels[id].player.getSegmentOrKey(part);
contents = await appStatus.channels[id].player?.getSegmentOrKey(part);
} catch (e) {
notFound(req, res);
return;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eplustv",
"version": "3.2.8",
"version": "3.2.9",
"description": "",
"scripts": {
"start": "ts-node index.ts",
Expand Down
6 changes: 2 additions & 4 deletions services/fox-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ const getMaxRes = _.memoize(() => {
switch (process.env.MAX_RESOLUTION) {
case 'UHD/HDR':
return 'UHD/HDR';
case '720p':
return '720p';
default:
return 'UHD/SDR';
return '720p';
}
});

Expand Down Expand Up @@ -299,7 +297,7 @@ class FoxHandler {
};

private getSteamData = async (eventId: string): Promise<any> => {
const streamOrder = ['UHD/HDR', 'UHD/SDR', '720p'];
const streamOrder = ['UHD/HDR', '720p'];

let resIndex = streamOrder.findIndex(i => i === maxRes);

Expand Down
8 changes: 0 additions & 8 deletions services/nfl-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,6 @@ class NflHandler {
mvpdUserId: this.mvpdUserId,
networks: event.feed || 'NFLN',
}),
...(this.checkPrimeAccess() && {
amazonPrimeUUID: this.amazonPrimeUUID,
amazonPrimeUserId: this.amazonPrimeUserId,
}),
...(this.checkPeacockAccess() && {
peacockUUID: this.amazonPrimeUUID,
peacockUserId: this.amazonPrimeUserId,
}),
},
{
headers: {
Expand Down

0 comments on commit f7c5565

Please sign in to comment.