diff --git a/explorers/webui.py b/explorers/webui.py index ca2510d..6863aa4 100644 --- a/explorers/webui.py +++ b/explorers/webui.py @@ -1,10 +1,13 @@ from shutil import which +import time from ffmpeg_progress_yield import FfmpegProgress from explorers import constants from explorers.api import API from flask import Flask, send_from_directory, request from urllib.parse import unquote +from webbrowser import open as open_browser from werkzeug.utils import secure_filename +from threading import Thread api = API() app = Flask(__name__) @@ -75,4 +78,10 @@ def root(): def main(): - app.run(host="0.0.0.0", port=8080) + port = 28015 + def open_browser_on_startup(): + time.sleep(1) + open_browser("http://127.0.0.1:" + str(port)) + Thread(target=open_browser_on_startup, daemon=True).start() + app.run(host="127.0.0.1", port=port) + diff --git a/web/assets/index.js b/web/assets/index.js index bf1d77a..6f49b3c 100644 --- a/web/assets/index.js +++ b/web/assets/index.js @@ -80,6 +80,8 @@ getLessonButton.addEventListener('click', async () => { for (const [id, video] of Object.entries(ids)) { promises.push(async () => { const checkbox = document.querySelector(`#${id}`); + // Disable the checkbox since the user can't download the same video twice + checkbox.disabled = true; if (!checkbox.checked) { return; } diff --git a/web/assets/style.css b/web/assets/style.css index b261c7e..028335d 100644 --- a/web/assets/style.css +++ b/web/assets/style.css @@ -15,6 +15,20 @@ header { background-color: #ffffff50; } +footer { + padding: 20px 0px; + bottom: 0; + display: flex; + justify-content: center; + position: absolute; + width: 100%; + background-color: #222; +} + +footer a { + color: #fff; +} + .block { width: fit-content; border: 1px solid #fff; diff --git a/web/index.html b/web/index.html index c2967a5..14b7e2a 100644 --- a/web/index.html +++ b/web/index.html @@ -1,3 +1,4 @@ + @@ -48,5 +49,8 @@ --> + \ No newline at end of file