Skip to content

Commit

Permalink
Merge pull request #12 from tmm1/drop-access-env
Browse files Browse the repository at this point in the history
remove unnecessary ACCESS_URI env var
  • Loading branch information
m0ngr31 committed Feb 18, 2022
2 parents 3343284 + f75fa01 commit a823d49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://i.imgur.com/FIGZdR3.png">
</p>

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.
Expand All @@ -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. |
Expand All @@ -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
```
docker run -p 8000:8000 -v /config_dir:/app/config -v /dev/shm:/app/tmp -e ESPN_USER="..." -e ESPN_PASS="..." m0ngr31/eplustv
```
13 changes: 4 additions & 9 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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',
Expand Down

0 comments on commit a823d49

Please sign in to comment.