From 37e32396bde4a779e7af4e329b868735626e170c Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Thu, 10 Feb 2022 18:03:53 -0800 Subject: [PATCH 1/5] remove unnecessary ACCESS_URI env var --- README.md | 5 ++--- index.ts | 13 ++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c05625b..83cbe5f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ The recommended way of running is to pull the image from [Docker Hub](https://hu #### Environement Variables | Environment Variable | Description | Required? | |---|---|---| -| ACCESS_URI | What accessable URL your clients will be connecting from. For example: `http://192.168.0.1:8000` | Yes | | ESPN_USER | Your ESPN+ Username | Yes | | ESPN_PASS | Your ESPN+ Password | Yes | | START_CHANNEL | What the first channel number should be. Keep in mind this generates 100 channels to keep a healthy buffer. | No. If not set, the start channel will default to 1. | @@ -47,5 +46,5 @@ The recommended way of running is to pull the image from [Docker Hub](https://hu By default, the easiest way to get running is: ```bash -docker run -p 8000:8000 -v /config_dir:/app/config -v /dev/shm:/app/tmp -e ACCESS_URI='http://192.168.0.10:8000' -e ESPN_USER='...' -e ESPN_PASS='...' m0ngr31/eplustv -``` \ No newline at end of file +docker run -p 8000:8000 -v /config_dir:/app/config -v /dev/shm:/app/tmp -e ESPN_USER='...' -e ESPN_PASS='...' m0ngr31/eplustv +``` diff --git a/index.ts b/index.ts index 3df958b..25647e6 100644 --- a/index.ts +++ b/index.ts @@ -25,11 +25,6 @@ if (_.isNaN(START_CHANNEL)) { START_CHANNEL = 1; } -let ACCESS_URL = process.env.ACCESS_URI; -while (ACCESS_URL.endsWith('/')) { - ACCESS_URL = ACCESS_URL.slice(0, -1); -} - interface IChannelStatus { heartbeat: number; pid?: any; @@ -69,7 +64,7 @@ const schedule = async () => { const app = express(); app.get('/channels.m3u', (req, res) => { - const m3uFile = generateM3u(NUM_OF_CHANNELS, ACCESS_URL, START_CHANNEL); + const m3uFile = generateM3u(NUM_OF_CHANNELS, 'http://'+req.headers.host, START_CHANNEL); if (!m3uFile) { notFound(req, res); @@ -110,10 +105,10 @@ app.get('/channels/:id.m3u8', async (req, res) => { appStatus.channels[id].heartbeat = new Date().valueOf(); if (!fs.existsSync(filename)) { - contents = slateStream.getSlate('soon', ACCESS_URL); + contents = slateStream.getSlate('soon', 'http://'+req.headers.host); // Start stream - launchChannel(id, appStatus, ACCESS_URL); + launchChannel(id, appStatus, 'http://'+req.headers.host); } if (!contents) { @@ -127,7 +122,7 @@ app.get('/channels/:id.m3u8', async (req, res) => { } } - checkNextStream(id, appStatus, ACCESS_URL); + checkNextStream(id, appStatus, 'http://'+req.headers.host); res.writeHead(200, { 'Content-Type': 'application/vnd.apple.mpegurl', From fdd21ed0b0fae632c9b625df17496db0bd63a30b Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Fri, 11 Feb 2022 20:46:23 +0000 Subject: [PATCH 2/5] Update index.ts --- index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 25647e6..a33b525 100644 --- a/index.ts +++ b/index.ts @@ -64,7 +64,7 @@ const schedule = async () => { const app = express(); app.get('/channels.m3u', (req, res) => { - const m3uFile = generateM3u(NUM_OF_CHANNELS, 'http://'+req.headers.host, START_CHANNEL); + const m3uFile = generateM3u(NUM_OF_CHANNELS, `${req.protocol}://${req.headers.host}`, START_CHANNEL); if (!m3uFile) { notFound(req, res); @@ -105,10 +105,10 @@ app.get('/channels/:id.m3u8', async (req, res) => { appStatus.channels[id].heartbeat = new Date().valueOf(); if (!fs.existsSync(filename)) { - contents = slateStream.getSlate('soon', 'http://'+req.headers.host); + contents = slateStream.getSlate('soon', `${req.protocol}://${req.headers.host}`); // Start stream - launchChannel(id, appStatus, 'http://'+req.headers.host); + launchChannel(id, appStatus, `${req.protocol}:\/\/${req.headers.host}`); } if (!contents) { @@ -122,7 +122,7 @@ app.get('/channels/:id.m3u8', async (req, res) => { } } - checkNextStream(id, appStatus, 'http://'+req.headers.host); + checkNextStream(id, appStatus, `${req.protocol}://${req.headers.host}`); res.writeHead(200, { 'Content-Type': 'application/vnd.apple.mpegurl', From 5748ba28945889562b665eeff72ac43e1289f27d Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Fri, 11 Feb 2022 20:47:15 +0000 Subject: [PATCH 3/5] Update index.ts --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index a33b525..d43ae63 100644 --- a/index.ts +++ b/index.ts @@ -108,7 +108,7 @@ app.get('/channels/:id.m3u8', async (req, res) => { contents = slateStream.getSlate('soon', `${req.protocol}://${req.headers.host}`); // Start stream - launchChannel(id, appStatus, `${req.protocol}:\/\/${req.headers.host}`); + launchChannel(id, appStatus, `${req.protocol}://${req.headers.host}`); } if (!contents) { From 8a4afe0ae4566dd2b345eacfe7cc38c5d3f3773c Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Fri, 18 Feb 2022 18:15:45 +0000 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83cbe5f..d8689f0 100644 --- a/README.md +++ b/README.md @@ -46,5 +46,5 @@ The recommended way of running is to pull the image from [Docker Hub](https://hu By default, the easiest way to get running is: ```bash -docker run -p 8000:8000 -v /config_dir:/app/config -v /dev/shm:/app/tmp -e ESPN_USER='...' -e ESPN_PASS='...' m0ngr31/eplustv +docker run -p 8000:8000 -v /config_dir:/app/config -v /dev/shm:/app/tmp -e ESPN_USER="..." -e ESPN_PASS="..." m0ngr31/eplustv ``` From f75fa018bc503cd36cc8d9e40247f5b8764e2474 Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Fri, 18 Feb 2022 18:18:34 +0000 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8689f0..8c82376 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-Current version: **0.9.0** +Current version: **0.9.1** ## About This takes ESPN+ 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 or VLC.