A flask server to server mp4 to a whitelisted set of users based on IP address.
pip install virtualenv
virtualenv python_video_server
- Activate the virtualenv (google it)
pip install flask
- Add content by following the guide for adding shows or for adding movies (MAKE THE FOLDERS FOR BOTH TYPES OR IT MAY BREAK THINGS!)
- Run it with
sudo python3 server.py
or through an admin prompt on windows (needs to bind to port 80 which is admin locked.) You can change the port in server.py and run it as a normal user if you'd like.
Add your public IPV4 and any others in a file called ips.txt
in the root of the server directory. Inside, place IPs like this:
ip.1.goes.here,
ip.2.goes.here
Each new ip requires a comma after the last ip, a new line and no comma at the end of the last IP (similar to JSON)
- Make a folder called
shows
inside thestatic
folder - Make a folder inside
shows
named whatever the show is named. Example:letterkenny
- You can also place a file called
title.txt
in the root of the show folder (so in this case, inside theletterkenny
folder) and then add the show's name there and it will be used for the interface
- You can also place a file called
- Make a folder for each season that follows the pattern
s<n>
for each season of the show where<n>
= season number. - Upload the
.mp4
files into the season folder and name theme<n>.mp4
where<n>
= episode number - Go to
/shows
and verify the new show is there and all its content. If not, double check you did exactly what was required.
- Make a folder called
movies
inside thestatic
folder - Make a folder inside
movies
and call it something recognizable. Example:nacholibre
- Make a file called
title.txt
inside the recognizable folder. On the first line of it, write the title of the movie. Example:Nacho Libre
- Upload the
.mp4
file in the same folder and call itmovie.mp4
- Go to
/movies
and verify the new movie is listed there. If not, double check you did exactly what was required.
Example directory tree:
.
+--static
|
+--shows
| |
| +--letterkenny
| |
| +--title.txt
| |
| +--s1
| |
| +--e1.mp4
| |
| +--e2.mp4
+--movies
| |
| +--nacholibre
| |
| +--title.txt
| |
| +--movie.mp4