Skip to content

Commit

Permalink
Fix issue with Akamai on Fox Sports
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ngr31 committed Mar 26, 2024
1 parent 54f0e64 commit 671a31e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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: **2.1.10**
Current version: **2.1.11**

# About
This takes ESPN/ESPN+, FOX Sports, Paramount+, MSG+, 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) or [Channels](https://getchannels.com).
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": "2.1.10",
"version": "2.1.11",
"description": "",
"scripts": {
"start": "ts-node index.ts",
Expand Down
6 changes: 5 additions & 1 deletion services/fox-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,13 @@ class FoxHandler {
await this.getAppConfig();
}

// let cdn;
const data = await this.getSteamData(eventId);

// console.log('CDN: ', data.trackingData.properties.CDN);
// while (cdn !== 'akamai|limelight|fastly') {
// console.log('CDN: ', data.trackingData.properties.CDN);
// cdn = data.trackingData.properties.CDN;
// }

if (!data || !data?.url) {
throw new Error('Could not get stream data. Event might be upcoming, ended, or in blackout...');
Expand Down
6 changes: 4 additions & 2 deletions services/playlist-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const createBaseUrlChunklist = (url: string, network: string): string => {
const cleaned = url.replace(/\.m3u8.*$/, '');
let filteredUrl: string[] | string = cleaned.split('/');

if (network === 'foxsports') {
if (network === 'foxsports' && !url.includes('akamai')) {
filteredUrl = filteredUrl.filter(seg => !seg.match(/=/));
}

Expand Down Expand Up @@ -207,8 +207,10 @@ export class PlaylistHandler {
: cleanUrl(`${baseManifestUrl}${segmentUrl}`)
: segmentUrl;

const shouldProxy = PROXY_SEGMENTS || baseManifestUrl.includes('akamai');

if (
PROXY_SEGMENTS &&
shouldProxy &&
// Proxy keyed segments
(segmentKey ||
// Proxy non-keyed segments that aren't on ESPN
Expand Down

0 comments on commit 671a31e

Please sign in to comment.