forked from fe80Grau/ytdlp2STRM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
25 lines (20 loc) · 735 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from flask import Flask, stream_with_context, request, Response, send_from_directory, send_file, redirect
from threading import Thread
app = Flask(__name__, template_folder='ui/html', static_folder='ui/static', static_url_path='')
from clases.config import config as c
from clases.folders import folders as f
import config.routes
from clases.cron import cron as cron
ytdlp2strm_config = c.config(
'./config/config.json'
).get_config()
if __name__ == "__main__":
crons = cron.Cron()
crons.start()
thread = Thread(
target=f.folders().clean_old_videos
)
thread.daemon = True
thread.start()
#Run Flask server
app.run(host='0.0.0.0',port=ytdlp2strm_config['ytdlp2strm_port'],debug=True)