Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bbab917
Create index.html
Monnapse Nov 4, 2024
903b66a
Create streaming-apis.json
Monnapse Nov 4, 2024
fa99b86
Create FilmLabs.pur
Monnapse Nov 4, 2024
2edd0ad
base home page
Monnapse Nov 5, 2024
947e2c4
Create .gitignore
Monnapse Nov 5, 2024
a6ca118
login save
Monnapse Nov 5, 2024
d58a2ba
added a few pages
Monnapse Nov 6, 2024
f3fc53b
Create ui-design
Monnapse Nov 6, 2024
57fa948
Delete ui-design
Monnapse Nov 6, 2024
2f2cfd7
film page save
Monnapse Nov 6, 2024
d4d1845
film page save
Monnapse Nov 6, 2024
6d4d931
Update FilmLabs.pur
Monnapse Nov 6, 2024
6c84cd2
finnished film page
Monnapse Nov 6, 2024
308d08b
server created
Monnapse Nov 6, 2024
8f4e7b7
save
Monnapse Nov 6, 2024
20f130c
save
Monnapse Nov 6, 2024
91d2e43
server save
Monnapse Nov 7, 2024
bf387ec
Server save, finished account registering.
Monnapse Nov 7, 2024
3a05cad
tmdb wrapper
Monnapse Nov 8, 2024
cb4e779
save
Monnapse Nov 8, 2024
c7b8c63
save
Monnapse Nov 8, 2024
6ae5d5d
save
Monnapse Nov 8, 2024
57ef361
Added search functionality and added film categories that you can cli…
Monnapse Nov 9, 2024
29d5c60
save
Monnapse Nov 9, 2024
0fb304b
save
Monnapse Nov 9, 2024
40b4659
Added movie watching support
Monnapse Nov 9, 2024
c76bdf5
fixed database
Monnapse Nov 10, 2024
bf2f892
Added favorites db function, and save.
Monnapse Nov 10, 2024
0618365
Save db, basically finished.
Monnapse Nov 10, 2024
9a9d4fb
save
Monnapse Nov 11, 2024
7ebbbb5
save
Monnapse Nov 11, 2024
b323ae9
Implementing watch history, save.
Monnapse Nov 11, 2024
21f3a75
Added error handling to routes, watch history basic added, save.
Monnapse Nov 11, 2024
09057b5
Watch history implemented, fixed some bugs.
Monnapse Nov 12, 2024
a6b8729
Create eye.svg
Monnapse Nov 12, 2024
384875f
Added episode styling when it has been watched.
Monnapse Nov 12, 2024
4ed6bce
added stream services
Monnapse Nov 12, 2024
53a60f6
fixed requirements
Monnapse Nov 12, 2024
06504aa
Merge branch 'main' into film-box-0.1.0
Monnapse Nov 12, 2024
01a904a
Delete .gitignore
Monnapse Nov 12, 2024
5b53288
Merge branch 'film-box-0.1.0' of https://github.com/Monnapse/FilmLabs…
Monnapse Nov 12, 2024
8a32f83
fixed requirements and updated readme
Monnapse Nov 12, 2024
fa8cbce
fixed pacakges
Monnapse Nov 12, 2024
9c64d9f
Fixed requirements file
Monnapse Nov 12, 2024
428856a
UPDATE Test
Monnapse Nov 12, 2024
e22a494
test update
Monnapse Nov 12, 2024
d7d9838
Update README.md
Monnapse Nov 12, 2024
3a2690e
Update README.md
Monnapse Nov 12, 2024
784f8bf
Update README.md
Monnapse Nov 12, 2024
d4cc5e9
Update base.html
Monnapse Nov 12, 2024
ffbe71c
Merge branch 'film-labs' into film-box-0.1.0
Monnapse Nov 12, 2024
c6fdad5
Update README.md
Monnapse Nov 13, 2024
0631706
Readme, Removed Popout Button
Monnapse Nov 13, 2024
6d5cf7b
Update README.md
Monnapse Nov 13, 2024
7b19e8b
Added Mysql DB Connection Pooling
Monnapse Nov 13, 2024
31204d7
changed static url method
Monnapse Dec 21, 2024
1669571
Update base.html
Monnapse Dec 21, 2024
9bd2601
Create .gitignore
Monnapse Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ignore/
/venv
90 changes: 86 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,91 @@
# FilmLabs

Local hosted streaming site.
This repository does not store any media files it uses streaming apis to stream movies/tv shows.

This repository does not store any film files it uses streaming apis to stream movies/tv shows.
# Features

You can create accounts to store watch history, you can search for movies, tv shows and anime.
* Local hosted streaming site.
* Create/Login accounts.
* Account favoriting for Movies/TV Shows.
* Account Watch history for Movies/TV Shows.
* Account Settings.
* Home page showing popular, trending, new, etc Movies/TV Shows.
* Search for Movies/TV Shows.
* Watch Movies/TV Shows.

The database uses mysql.
# Technical Features
* MYSQL Database.
* Python Flask Server.
* TMDB Api.

# FilmLabs Installation Intructions

## WINDOWS

## LINUX

### Downloading Files
Clone/download the repository by running `git clone -b film-labs https://github.com/Monnapse/FilmLabs.git`.

Now go into directory by running `cd FilmLabs/`.

### Create Virtual Environemnt (Optional)
If you want to use a virtual environment then you want to first run `python3 -m venv filmlabs-environment`
(if you dont have the venv package install by running `apt install python3-venv`)

Activate the virtual environemnt by running `source filmlabs-environment/bin/activate`.

### Install required packages
Now install required packages by running `pip install -r requirements.txt`.

### Install mysql
Now install the mysql server by running `sudo apt install mysql-server`. Now you need to secure mysql server by
running `sudo mysql_secure_installation` it will ask some questions, for the first question say `y`
then password security level question just say `2` for highest security,
and then all the rest of the questions just say `y` to all of them.

### Create mysql password
Now enter mysql by running `sudo mysql -u root`
add this line and enter a password in `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';` replace `'your_new_password'` with your password then press enter, once you have done that add this line `FLUSH PRIVILEGES;`

### Create database
Now create the database by adding `source mysql/forward_engineer.sql` to the next line. Exit by entering `exit`.

### Creating environment variables
Now create your environment variables by running `sudo nano /etc/environment`
next in that file add the following on different lines:

1. `FILMLABS_DB="filmlabs"` (this is the name of the database)

2. `FILMLABS_JWT_KEY="df6^Dju-3Ffsf__d9pFDfSh#7#$)448*#4v$Jf-#HQHjf9hdf-FH(#r#"lrjfx-dSGsDJ4td)"` (This variable is your secret key creating your tokens so you can change it to whatever you want but its best to make it long and randomized so no hacker can get it)

3. `MYSQL_PASSWORD="mysql password"` (Change mysql passsword with your password you created for your mysql root)

4. `MYSQL_USER="root"` (This is your mysql user that is being logged into just keep it the same)

5. `TMDB_API_KEY="your tmdb api key"` (Put in your TMDB api key here, you can get an api key from this [link](https://developer.themoviedb.org/docs/getting-started))

Now save the file by doing `ctrl+o` then press `enter` now exit the file by doing `ctrl+x`.

Now restart, so the changes to take effect by running `sudo reboot`.

Once restarted go to your the FilmLabs folder (`cd FilmLabs/`)
(and if you set up a virtual environment you need to activate it by running `source filmlabs-environment/bin/activate`)
now run your server by running `python3 main.py`, it should print out alot of stuff but what you are looking for is a list of ip adresses like this
```
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:2400
* Running on http://10.0.0.52:2400
```
`http://127.0.0.1:2400` will only allow access on your local machine. The last one `http://10.0.0.52:2400` allows access to the site on your network.

Now enjoy.

## Update files
if you want to update the files to latest release you do, pull latest changes `git pull origin film-labs`.

# Modifying Home Page Categories
Open `home_page.json`

# Adding/Removing Streaming Apis
Open `services.json`
100 changes: 100 additions & 0 deletions home_page.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"pages": [
{
"current_page": 1,

"categories": [
{
"name": "My watch history",
"media_type": null,
"list_type": "watch_history",
"time_window": null
},
{
"name": "My favorites",
"media_type": null,
"list_type": "favorites",
"time_window": null
},
{
"name": "Trending today",
"media_type": null,
"list_type": "trending",
"time_window": "day"
}
]
},
{
"current_page": 2,

"categories": [
{
"name": "Trending this week",
"media_type": null,
"list_type": "trending",
"time_window": "week"
},
{
"name": "Popular movies",
"media_type": "movie",
"list_type": "popular",
"time_window": null
},
{
"name": "Now playing movies",
"media_type": "movie",
"list_type": "now_playing",
"time_window": null
}
]
},
{
"current_page": 3,

"categories": [
{
"name": "Top rated tv series",
"media_type": "tv",
"list_type": "top_rated",
"time_window": null
},
{
"name": "Top rated movies",
"media_type": "movie",
"list_type": "popular",
"time_window": null
},
{
"name": "Popular tv series",
"media_type": "tv",
"list_type": "popular",
"time_window": null
}
]
},
{
"current_page": 4,

"categories": [
{
"name": "Airing today tv series",
"media_type": "tv",
"list_type": "airing_today",
"time_window": null
},
{
"name": "On the air tv series",
"media_type": "tv",
"list_type": "on_the_air",
"time_window": null
},
{
"name": "Upcoming movies",
"media_type": "movie",
"list_type": "upcoming",
"time_window": null
}
]
}
]
}
Binary file added ignore/FilmLabs.pur
Binary file not shown.
101 changes: 101 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
"""

Film Box Server
Made by Monnapse

Created 11/6/2024
Last Updated 11/6/2024

0.1.0

"""

from flask import Flask, request
#from flask_session import Session
from datetime import timedelta
from os import environ
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from flask_jwt_extended import JWTManager
import json

import server.web as web
from server.packages import db, films, tmdb, json_controller, service
from server.packages.tmdb import FilmType, TVListType, MovieListType, TimeWindow, TMDB, ListResult

# Settings
token_max_days = 7

password_min_length = 8
password_max_length = 20

username_min_length = 3
username_max_length = 20

# w9, w154, w185, w342, w500, w780, original
poster_sizing = "w185" # Smaller = more optimized = faster loading

# Define the flask app
app = Flask(__name__)
limiter = Limiter(app, key_func=get_remote_address)

#app.config["SESSION_PERMANENT"] = False
#app.config["SESSION_TYPE"] = "filesystem"
#app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(minutes=session_days)
app.config['JWT_SECRET_KEY'] = environ.get("FILMLABS_JWT_KEY")
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = timedelta(days=token_max_days)

#Session(app)
jwt = JWTManager(app)

api = tmdb.TMDB(
environ.get("TMDB_API_KEY"),
poster_sizing
)
service_controller = service.ServiceController(
json_controller.load_json("services.json")
)

#print(service_controller.get_services()[0].get_tv_url("693134", 1, 1))

#print(film_controller.get_next_categories(2))

db_controller = db.FilmLabsDB(
password_max_length,
password_min_length,
username_min_length,
username_max_length
)
film_controller = films.FilmsController(
api,
db_controller,
json_controller.load_json("home_page.json")
)
web_controller = web.WebClass(
app,
limiter,
db_controller,
jwt,
film_controller,
service_controller,
token_max_days,
password_max_length,
password_min_length,
username_min_length,
username_max_length
)
if __name__ == '__main__':
# Connect to database
db_controller.connect(
"localhost",
environ.get("MYSQL_USER"),
environ.get("MYSQL_PASSWORD"),
environ.get("FILMLABS_DB")
)

# Now make the web directories
# and run the flask app
web_controller.run_directories()

# Run flask app
app.run(debug=False, port="2400", host="0.0.0.0")
Loading