Skip to content

Commit aaae708

Browse files
author
Your Name
committed
Initial work for Gotham Sports done
1 parent 292a10e commit aaae708

16 files changed

+1440
-27
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="https://i.imgur.com/FIGZdR3.png">
33
</p>
44

5-
Current version: **4.0.4**
5+
Current version: **4.1.0**
66

77
# About
88
This takes ESPN+, ESPN, FOX Sports, CBS 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).

index.tsx

+29-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {b1gHandler} from './services/b1g-handler';
1717
import {floSportsHandler} from './services/flo-handler';
1818
import {paramountHandler} from './services/paramount-handler';
1919
import {nflHandler} from './services/nfl-handler';
20-
import {msgHandler} from './services/msg-handler';
20+
import {gothamHandler} from './services/gotham-handler';
2121
import {mwHandler} from './services/mw-handler';
2222
import {nesnHandler} from './services/nesn-handler';
2323
import {cbsHandler} from './services/cbs-handler';
@@ -49,6 +49,7 @@ import {B1G} from './services/providers/b1g/views';
4949
import {NFL} from './services/providers/nfl/views';
5050
import {ESPN} from './services/providers/espn/views';
5151
import {ESPNPlus} from './services/providers/espn-plus/views';
52+
import {Gotham} from './services/providers/gotham/views';
5253

5354
const notFound = (c: Context<BlankEnv, '', BlankInput>) => {
5455
return c.text('404 not found', 404, {
@@ -80,7 +81,7 @@ const schedule = async () => {
8081
await mwHandler.getSchedule();
8182
await nflHandler.getSchedule();
8283
await paramountHandler.getSchedule();
83-
await msgHandler.getSchedule();
84+
await gothamHandler.getSchedule();
8485
await nesnHandler.getSchedule();
8586
await cbsHandler.getSchedule();
8687

@@ -117,6 +118,7 @@ app.get('/', async c => {
117118
<ESPN />
118119
<Paramount />
119120
<Nesn />
121+
<Gotham />
120122
<B1G />
121123
<FloSports />
122124
<MntWest />
@@ -316,6 +318,28 @@ app.get('/channels/:id/:part{.+\\.ts$}', async c => {
316318
});
317319
});
318320

321+
app.get('/channels/:id/:part{.+\\.m4i$}', async c => {
322+
const id = c.req.param('id');
323+
const part = c.req.param('part').split('.m4i')[0];
324+
325+
let contents: ArrayBuffer | undefined;
326+
327+
try {
328+
contents = await appStatus.channels[id].player?.getSegmentOrKey(part);
329+
} catch (e) {
330+
return notFound(c);
331+
}
332+
333+
if (!contents) {
334+
return notFound(c);
335+
}
336+
337+
return c.body(contents, 200, {
338+
'Cache-Control': 'no-cache',
339+
'Content-Type': 'video/MP2T',
340+
});
341+
});
342+
319343
// 404 Handler
320344
app.notFound(notFound);
321345

@@ -347,8 +371,8 @@ process.on('SIGINT', shutDown);
347371
await paramountHandler.initialize();
348372
await paramountHandler.refreshTokens();
349373

350-
await msgHandler.initialize();
351-
await msgHandler.refreshTokens();
374+
await gothamHandler.initialize();
375+
await gothamHandler.refreshTokens();
352376

353377
await nesnHandler.initialize();
354378
await nesnHandler.refreshTokens();
@@ -384,7 +408,7 @@ setInterval(async () => {
384408
await floSportsHandler.refreshTokens();
385409
await nflHandler.refreshTokens();
386410
await paramountHandler.refreshTokens();
387-
await msgHandler.refreshTokens();
411+
await gothamHandler.refreshTokens();
388412
await nesnHandler.refreshTokens();
389413
await cbsHandler.refreshTokens();
390414
}, 1000 * 60 * 30);

package-lock.json

+21-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eplustv",
3-
"version": "4.0.4",
3+
"version": "4.1.0",
44
"description": "",
55
"scripts": {
66
"start": "ts-node -r tsconfig-paths/register index.tsx",
@@ -33,6 +33,7 @@
3333
"xml": "^1.0.1"
3434
},
3535
"devDependencies": {
36+
"@types/axios-curlirize": "^1.3.5",
3637
"@types/crypto-js": "^4.2.1",
3738
"@types/express": "^4.17.13",
3839
"@types/lodash": "^4.14.174",

services/channels.ts

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import _ from 'lodash';
22

3-
import {useMsgPlus} from './networks';
43
import {db} from './database';
54
import {IProvider} from './shared-interfaces';
65

@@ -220,37 +219,50 @@ export const CHANNELS = {
220219
tvgName: 'NESNPLD',
221220
},
222221
60: {
223-
canUse: useMsgPlus,
222+
canUse: undefined,
223+
checkChannelEnabled: () => checkChannelEnabled('gotham', 'MSG'),
224224
id: 'MSG',
225225
logo: 'https://tmsimg.fancybits.co/assets/s10979_ll_h15_ab.png?w=360&h=270',
226226
name: 'MSG',
227227
stationId: '10979',
228228
tvgName: 'MSG',
229229
},
230230
61: {
231-
canUse: useMsgPlus,
231+
canUse: undefined,
232+
checkChannelEnabled: () => checkChannelEnabled('gotham', 'MSGSN'),
232233
id: 'MSGSN',
233234
logo: 'https://tmsimg.fancybits.co/assets/s11105_ll_h15_ac.png?w=360&h=270',
234235
name: 'MSG Sportsnet HD',
235236
stationId: '15273',
236237
tvgName: 'MSGSNNP',
237238
},
238239
62: {
239-
canUse: useMsgPlus,
240+
canUse: undefined,
241+
checkChannelEnabled: () => checkChannelEnabled('gotham', 'MSG2'),
240242
id: 'MSG2',
241243
logo: 'https://tmsimg.fancybits.co/assets/s70283_ll_h15_aa.png?w=360&h=270',
242244
name: 'MSG2 HD',
243245
stationId: '70283',
244246
tvgName: 'MSG2HD',
245247
},
246248
63: {
247-
canUse: useMsgPlus,
249+
canUse: undefined,
250+
checkChannelEnabled: () => checkChannelEnabled('gotham', 'MSGSN2'),
248251
id: 'MSGSN2',
249252
logo: 'https://tmsimg.fancybits.co/assets/s70285_ll_h15_ab.png?w=360&h=270',
250253
name: 'MSG Sportsnet 2 HD',
251254
stationId: '70285',
252255
tvgName: 'MSG2SNH',
253256
},
257+
64: {
258+
canUse: undefined,
259+
checkChannelEnabled: () => checkChannelEnabled('gotham', 'YES'),
260+
id: 'YES',
261+
logo: 'https://tmsimg.fancybits.co/assets/s30017_ll_h15_aa.png?w=360&h=270',
262+
name: 'Yes Network',
263+
stationId: '30017',
264+
tvgName: 'YES',
265+
},
254266
};
255267
},
256268
};

services/espn-handler.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,13 @@ const isEnabled = async (which?: string): Promise<boolean> => {
385385
} else if (which === 'plus') {
386386
return espnPlusEnabled;
387387
} else if (which === 'ppv') {
388-
return plusMeta?.use_ppv ? true : false;
388+
return (plusMeta?.use_ppv ? true : false) && espnPlusEnabled;
389389
} else if (which === 'espn3') {
390-
return linearMeta?.espn3 ? true : false;
390+
return (linearMeta?.espn3 ? true : false) && espnLinearEnabled;
391391
} else if (which === 'sec_plus') {
392-
return linearMeta?.sec_plus ? true : false;
392+
return (linearMeta?.sec_plus ? true : false) && espnLinearEnabled;
393393
} else if (which === 'accnx') {
394-
return linearMeta?.accnx ? true : false;
394+
return (linearMeta?.accnx ? true : false) && espnLinearEnabled;
395395
}
396396

397397
return espnPlusEnabled || (espnLinearEnabled && _.some(linear_channels, c => c.enabled));
@@ -578,7 +578,8 @@ class EspnHandler {
578578

579579
const {linear_channels} = await db.providers.findOne<IProvider>({name: 'espn'});
580580

581-
const isChannelEnabled = (channelId: string): boolean => linear_channels.some(c => c.id === channelId && c.enabled);
581+
const isChannelEnabled = (channelId: string): boolean =>
582+
espnLinearEnabled && linear_channels.some(c => c.id === channelId && c.enabled);
582583

583584
let entries = [];
584585

0 commit comments

Comments
 (0)