diff --git a/README.md b/README.md index c05625b..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. @@ -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..d43ae63 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, `${req.protocol}://${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', `${req.protocol}://${req.headers.host}`); // Start stream - launchChannel(id, appStatus, ACCESS_URL); + launchChannel(id, appStatus, `${req.protocol}://${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, `${req.protocol}://${req.headers.host}`); res.writeHead(200, { 'Content-Type': 'application/vnd.apple.mpegurl',