Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
maddox committed Nov 17, 2020
0 parents commit 41ce58c
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM hoosin/alpine-nginx-nodejs:latest

WORKDIR /usr/src/app
ADD entrypoint.sh /usr/src/app/entrypoint.sh
ADD index.html /usr/src/app/index.html

RUN wget https://github.com/maddox/PlutoIPTV/archive/channels.zip
RUN unzip -j channels.zip
RUN rm channels.zip
RUN yarn

ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pluto for Channels

This simple Docker image will generate an M3U playlist and EPG optimized for use in [Channels](https://getchannels.com) and expose them over HTTP.

[Channels](https://getchannels.com) supports [custom channels](https://getchannels.com/docs/channels-dvr-server/how-to/custom-channels/) by utilizing streaming sources via M3U playlists.

[Channels](https://getchannels.com) allows for [additional extended metadata tags](https://getchannels.com/docs/channels-dvr-server/how-to/custom-channels/#channels-extensions) in M3U playlists that allow you to give it extra information and art to make the experience better. This project adds those extra tags to make things look great in Channels.

## How does it work?

Running the container is easy. Fire up the container as usual. You can set which port it runs on.

docker run -d --name pluto-for-channels -p 8080:80 maddox/pluto-for-channels

You can retreive the playlist and epg via:

http://127.0.0.1:8080/playlist.m3u
http://127.0.0.1:8080/epg.xml
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

cd /usr/src/app

nginx

NGINX_ROOT=/usr/share/nginx/html

while :
do
node index.js forChannels
LAST_RAN=date
sed "s/XXX/$($LAST_RAN)/g" index.html > "$NGINX_ROOT/index.html"
mv playlist.m3u "$NGINX_ROOT/playlist.m3u"
mv epg.xml "$NGINX_ROOT/epg.xml"
echo "Last ran: $($LAST_RAN)"
sleep 10800 # run every 3 hours
done
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">
Pluto for Channels
</h1>
<p class="subtitle">
Last Updated: XXX
</p>
<ul>
<li><a href="/playlist.m3u">Playlist</a></li>
<li><a href="/epg.xml">EPG</a></li>
</ul>
</div>
</section>
</body>
</html>

0 comments on commit 41ce58c

Please sign in to comment.