first commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
node_modules/
|
||||
dist/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
data/pyload_settings.json
|
||||
data/pyload_secret.key
|
||||
@@ -0,0 +1,513 @@
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlsplit, urlunsplit
|
||||
from flask import Flask, jsonify, request, send_from_directory
|
||||
from cryptography.fernet import Fernet, InvalidToken
|
||||
import requests
|
||||
|
||||
app = Flask(__name__, static_folder="dist", static_url_path="")
|
||||
|
||||
API = "https://mediathekviewweb.de/api/query"
|
||||
CHANNELS_API = "https://mediathekviewweb.de/api/channels"
|
||||
DIST_DIR = Path(app.root_path) / "dist"
|
||||
DATA_DIR = Path(app.root_path) / "data"
|
||||
PYLOAD_SETTINGS_FILE = DATA_DIR / "pyload_settings.json"
|
||||
PYLOAD_KEY_FILE = DATA_DIR / "pyload_secret.key"
|
||||
DEFAULT_RESULTS_PER_PAGE = 8
|
||||
VIDEO_SIZE_CACHE = {}
|
||||
CONTENT_RANGE_SIZE_RE = re.compile(r"/(\d+)$")
|
||||
|
||||
|
||||
def fetch_channels():
|
||||
try:
|
||||
response = requests.get(CHANNELS_API, timeout=30)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
channels = data.get("channels") if isinstance(data, dict) else None
|
||||
|
||||
if isinstance(channels, list):
|
||||
clean_channels = sorted({
|
||||
str(channel).strip()
|
||||
for channel in channels
|
||||
if str(channel).strip()
|
||||
})
|
||||
if clean_channels:
|
||||
return clean_channels
|
||||
except (requests.RequestException, ValueError):
|
||||
pass
|
||||
|
||||
# Fallback for compatibility in case /api/channels is temporarily unavailable.
|
||||
payload = {"queries": [], "size": 5000}
|
||||
response = requests.post(API, json=payload, timeout=30)
|
||||
response.raise_for_status()
|
||||
|
||||
return sorted({
|
||||
e.get("channel")
|
||||
for e in response.json()["result"]["results"]
|
||||
if e.get("channel")
|
||||
})
|
||||
|
||||
|
||||
def search(term, channels):
|
||||
offset = 0
|
||||
size = 50
|
||||
results = []
|
||||
|
||||
queries = [{"fields": ["title", "topic"], "query": term}]
|
||||
|
||||
for ch in channels:
|
||||
queries.append({"fields": ["channel"], "query": ch})
|
||||
|
||||
while True:
|
||||
payload = {
|
||||
"queries": queries,
|
||||
"offset": offset,
|
||||
"size": size
|
||||
}
|
||||
|
||||
r = requests.post(API, json=payload, timeout=30)
|
||||
r.raise_for_status()
|
||||
data = r.json()["result"]["results"]
|
||||
|
||||
if not data:
|
||||
break
|
||||
|
||||
for e in data:
|
||||
title = e.get("title") or ""
|
||||
if "originalversion" in title.lower():
|
||||
continue
|
||||
|
||||
qualities = []
|
||||
seen_urls = set()
|
||||
quality_candidates = [
|
||||
("hd", "HD", e.get("url_video_hd"), e.get("size_hd")),
|
||||
("standard", "Standard", e.get("url_video"), e.get("size")),
|
||||
("low", "Niedrig", e.get("url_video_low"), e.get("size_low")),
|
||||
]
|
||||
for qid, label, url, quality_size in quality_candidates:
|
||||
if not url:
|
||||
continue
|
||||
clean_url = str(url).strip()
|
||||
if not clean_url or clean_url in seen_urls:
|
||||
continue
|
||||
seen_urls.add(clean_url)
|
||||
qualities.append({
|
||||
"id": qid,
|
||||
"label": label,
|
||||
"url": clean_url,
|
||||
"size": int(quality_size) if isinstance(quality_size, (int, float)) else None,
|
||||
})
|
||||
|
||||
default_quality = qualities[0]["id"] if qualities else ""
|
||||
|
||||
results.append({
|
||||
"id": f"{title}_{e.get('timestamp')}",
|
||||
"title": title,
|
||||
"topic": e.get("topic"),
|
||||
"channel": e.get("channel"),
|
||||
"timestamp": e.get("timestamp"),
|
||||
"duration": e.get("duration"),
|
||||
"size": e.get("size"),
|
||||
"description": e.get("description"),
|
||||
"qualities": qualities,
|
||||
"default_quality": default_quality,
|
||||
"subtitle": e.get("url_subtitle"),
|
||||
"url": e.get("url_website")
|
||||
})
|
||||
|
||||
offset += size
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def parse_positive_int(value):
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
try:
|
||||
parsed = int(value)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
|
||||
if parsed <= 0:
|
||||
return None
|
||||
|
||||
return parsed
|
||||
|
||||
|
||||
def size_from_response_headers(response):
|
||||
content_length = parse_positive_int(response.headers.get("Content-Length"))
|
||||
if content_length:
|
||||
return content_length
|
||||
|
||||
content_range = (response.headers.get("Content-Range") or "").strip()
|
||||
if not content_range:
|
||||
return None
|
||||
|
||||
match = CONTENT_RANGE_SIZE_RE.search(content_range)
|
||||
if not match:
|
||||
return None
|
||||
|
||||
return parse_positive_int(match.group(1))
|
||||
|
||||
|
||||
def resolve_video_size(url):
|
||||
value = str(url or "").strip()
|
||||
if not value:
|
||||
return None
|
||||
|
||||
if value in VIDEO_SIZE_CACHE:
|
||||
return VIDEO_SIZE_CACHE[value]
|
||||
|
||||
size = None
|
||||
|
||||
try:
|
||||
response = requests.head(value, allow_redirects=True, timeout=12)
|
||||
if response.ok:
|
||||
size = size_from_response_headers(response)
|
||||
except requests.RequestException:
|
||||
pass
|
||||
|
||||
if size is None:
|
||||
try:
|
||||
response = requests.get(
|
||||
value,
|
||||
allow_redirects=True,
|
||||
timeout=15,
|
||||
stream=True,
|
||||
headers={"Range": "bytes=0-0"},
|
||||
)
|
||||
if response.ok or response.status_code == 206:
|
||||
size = size_from_response_headers(response)
|
||||
except requests.RequestException:
|
||||
pass
|
||||
|
||||
VIDEO_SIZE_CACHE[value] = size
|
||||
return size
|
||||
|
||||
|
||||
def normalize_pyload_api_base(server):
|
||||
value = (server or "").strip()
|
||||
if not value:
|
||||
raise ValueError("pyLoad-Server fehlt.")
|
||||
|
||||
if not value.startswith(("http://", "https://")):
|
||||
value = f"http://{value}"
|
||||
|
||||
parts = urlsplit(value)
|
||||
if not parts.netloc:
|
||||
raise ValueError("pyLoad-Server ist ungueltig.")
|
||||
|
||||
path = parts.path.rstrip("/")
|
||||
if not path:
|
||||
path = "/api"
|
||||
elif not path.endswith("/api"):
|
||||
path = f"{path}/api"
|
||||
|
||||
return urlunsplit((parts.scheme, parts.netloc, path, "", ""))
|
||||
|
||||
|
||||
def response_data(response):
|
||||
try:
|
||||
return response.json()
|
||||
except ValueError:
|
||||
return response.text.strip()
|
||||
|
||||
|
||||
def request_error_message(exc):
|
||||
if getattr(exc, "response", None) is None:
|
||||
return str(exc)
|
||||
|
||||
response = exc.response
|
||||
text = (response.text or "").strip().replace("\n", " ")
|
||||
if len(text) > 220:
|
||||
text = f"{text[:220]}..."
|
||||
|
||||
if text:
|
||||
return f"HTTP {response.status_code}: {text}"
|
||||
|
||||
return f"HTTP {response.status_code}"
|
||||
|
||||
|
||||
def ensure_data_dir():
|
||||
DATA_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def get_cipher():
|
||||
ensure_data_dir()
|
||||
|
||||
if PYLOAD_KEY_FILE.exists():
|
||||
key = PYLOAD_KEY_FILE.read_bytes().strip()
|
||||
else:
|
||||
key = Fernet.generate_key()
|
||||
PYLOAD_KEY_FILE.write_bytes(key)
|
||||
try:
|
||||
PYLOAD_KEY_FILE.chmod(0o600)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
return Fernet(key)
|
||||
|
||||
|
||||
def encrypt_password(password):
|
||||
if not password:
|
||||
return ""
|
||||
|
||||
return get_cipher().encrypt(password.encode("utf-8")).decode("utf-8")
|
||||
|
||||
|
||||
def decrypt_password(token):
|
||||
if not token:
|
||||
return ""
|
||||
|
||||
try:
|
||||
return get_cipher().decrypt(token.encode("utf-8")).decode("utf-8")
|
||||
except (InvalidToken, ValueError):
|
||||
return ""
|
||||
|
||||
|
||||
def load_pyload_settings():
|
||||
if not PYLOAD_SETTINGS_FILE.exists():
|
||||
return {
|
||||
"server": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"results_per_page": DEFAULT_RESULTS_PER_PAGE,
|
||||
}
|
||||
|
||||
try:
|
||||
content = json.loads(PYLOAD_SETTINGS_FILE.read_text(encoding="utf-8"))
|
||||
except (OSError, ValueError):
|
||||
return {
|
||||
"server": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"results_per_page": DEFAULT_RESULTS_PER_PAGE,
|
||||
}
|
||||
|
||||
encrypted_password = content.get("password_encrypted") or ""
|
||||
results_per_page = content.get("results_per_page", DEFAULT_RESULTS_PER_PAGE)
|
||||
try:
|
||||
results_per_page = int(results_per_page)
|
||||
except (TypeError, ValueError):
|
||||
results_per_page = DEFAULT_RESULTS_PER_PAGE
|
||||
if results_per_page < 1 or results_per_page > 200:
|
||||
results_per_page = DEFAULT_RESULTS_PER_PAGE
|
||||
|
||||
return {
|
||||
"server": str(content.get("server") or "").strip(),
|
||||
"username": str(content.get("username") or "").strip(),
|
||||
"password": decrypt_password(str(encrypted_password)),
|
||||
"results_per_page": results_per_page,
|
||||
}
|
||||
|
||||
|
||||
def save_pyload_settings(server, username, password, results_per_page):
|
||||
try:
|
||||
rows = int(results_per_page)
|
||||
except (TypeError, ValueError):
|
||||
rows = DEFAULT_RESULTS_PER_PAGE
|
||||
if rows < 1 or rows > 200:
|
||||
rows = DEFAULT_RESULTS_PER_PAGE
|
||||
|
||||
ensure_data_dir()
|
||||
data = {
|
||||
"server": (server or "").strip(),
|
||||
"username": (username or "").strip(),
|
||||
"password_encrypted": encrypt_password(password or ""),
|
||||
"results_per_page": rows,
|
||||
}
|
||||
PYLOAD_SETTINGS_FILE.write_text(
|
||||
json.dumps(data, ensure_ascii=True, indent=2),
|
||||
encoding="utf-8",
|
||||
)
|
||||
try:
|
||||
PYLOAD_SETTINGS_FILE.chmod(0o600)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def pyload_add_package(session, api_base, username, password, name, links):
|
||||
payload = {
|
||||
"name": name,
|
||||
"links": links,
|
||||
"dest": 1,
|
||||
}
|
||||
response = session.post(
|
||||
f"{api_base}/add_package",
|
||||
json=payload,
|
||||
auth=(username, password),
|
||||
timeout=30,
|
||||
)
|
||||
response.raise_for_status()
|
||||
return response_data(response)
|
||||
|
||||
|
||||
@app.route("/channels")
|
||||
def channels():
|
||||
return jsonify(fetch_channels())
|
||||
|
||||
|
||||
@app.route("/search")
|
||||
def do_search():
|
||||
term = request.args.get("q", "")
|
||||
channels = request.args.getlist("channels[]")
|
||||
return jsonify(search(term, channels))
|
||||
|
||||
|
||||
@app.route("/quality-sizes", methods=["POST"])
|
||||
def quality_sizes():
|
||||
body = request.get_json(silent=True) or {}
|
||||
urls = body.get("urls")
|
||||
|
||||
if not isinstance(urls, list):
|
||||
return jsonify({"error": "urls muss ein Array sein."}), 400
|
||||
|
||||
resolved = {}
|
||||
for raw_url in urls[:18]:
|
||||
url = str(raw_url or "").strip()
|
||||
if not url:
|
||||
continue
|
||||
|
||||
size = resolve_video_size(url)
|
||||
if isinstance(size, int) and size > 0:
|
||||
resolved[url] = size
|
||||
|
||||
return jsonify({"sizes": resolved})
|
||||
|
||||
|
||||
@app.route("/pyload/settings", methods=["GET"])
|
||||
def get_pyload_settings():
|
||||
return jsonify(load_pyload_settings())
|
||||
|
||||
|
||||
@app.route("/pyload/settings", methods=["POST"])
|
||||
def set_pyload_settings():
|
||||
body = request.get_json(silent=True) or {}
|
||||
|
||||
existing = load_pyload_settings()
|
||||
|
||||
if "server" in body:
|
||||
server = str(body.get("server") or "")
|
||||
else:
|
||||
server = existing.get("server") or ""
|
||||
|
||||
if "username" in body:
|
||||
username = str(body.get("username") or "")
|
||||
else:
|
||||
username = existing.get("username") or ""
|
||||
|
||||
if "password" in body:
|
||||
password = str(body.get("password") or "")
|
||||
else:
|
||||
password = existing.get("password") or ""
|
||||
|
||||
if "results_per_page" in body:
|
||||
results_per_page = body.get("results_per_page")
|
||||
else:
|
||||
results_per_page = existing.get("results_per_page", DEFAULT_RESULTS_PER_PAGE)
|
||||
|
||||
save_pyload_settings(server, username, password, results_per_page)
|
||||
return jsonify({"saved": True})
|
||||
|
||||
|
||||
@app.route("/pyload/add", methods=["POST"])
|
||||
def pyload_add():
|
||||
body = request.get_json(silent=True) or {}
|
||||
|
||||
stored = load_pyload_settings()
|
||||
server = str(body.get("server") or stored.get("server") or "").strip()
|
||||
username = str(body.get("username") or stored.get("username") or "").strip()
|
||||
password = body.get("password")
|
||||
if password is None or password == "":
|
||||
password = stored.get("password") or ""
|
||||
else:
|
||||
password = str(password)
|
||||
packages = body.get("packages")
|
||||
|
||||
if not server:
|
||||
return jsonify({"error": "pyLoad-Server fehlt."}), 400
|
||||
if not username:
|
||||
return jsonify({"error": "pyLoad-Benutzer fehlt."}), 400
|
||||
if not password:
|
||||
return jsonify({"error": "pyLoad-Passwort fehlt."}), 400
|
||||
if not isinstance(packages, list) or not packages:
|
||||
return jsonify({"error": "Keine Pakete zum Hinzufuegen."}), 400
|
||||
|
||||
clean_packages = []
|
||||
for package in packages:
|
||||
if not isinstance(package, dict):
|
||||
continue
|
||||
|
||||
name = (package.get("name") or "").strip()
|
||||
links = package.get("links") or []
|
||||
if not isinstance(links, list):
|
||||
continue
|
||||
|
||||
clean_links = [str(link).strip() for link in links if str(link).strip()]
|
||||
if name and clean_links:
|
||||
clean_packages.append({"name": name, "links": clean_links})
|
||||
|
||||
if not clean_packages:
|
||||
return jsonify({"error": "Keine gueltigen Pakete enthalten."}), 400
|
||||
|
||||
try:
|
||||
api_base = normalize_pyload_api_base(server)
|
||||
except ValueError as exc:
|
||||
return jsonify({"error": str(exc)}), 400
|
||||
|
||||
session = requests.Session()
|
||||
added = []
|
||||
failed = []
|
||||
|
||||
for package in clean_packages:
|
||||
try:
|
||||
package_id = pyload_add_package(
|
||||
session,
|
||||
api_base,
|
||||
username,
|
||||
password,
|
||||
package["name"],
|
||||
package["links"],
|
||||
)
|
||||
added.append({"name": package["name"], "pid": package_id})
|
||||
except requests.RequestException as exc:
|
||||
message = request_error_message(exc)
|
||||
response = getattr(exc, "response", None)
|
||||
if response is not None and response.status_code == 404:
|
||||
body = (response.text or "").strip()
|
||||
if "obsolete api" in body.lower():
|
||||
message = (
|
||||
"HTTP 404: Obsolete API. Bitte pyLoad REST API mit "
|
||||
"Basic Auth verwenden."
|
||||
)
|
||||
failed.append({
|
||||
"name": package["name"],
|
||||
"error": message,
|
||||
})
|
||||
|
||||
status_code = 200 if added else 502
|
||||
return jsonify({
|
||||
"added": added,
|
||||
"failed": failed,
|
||||
"added_count": len(added),
|
||||
"failed_count": len(failed),
|
||||
}), status_code
|
||||
|
||||
|
||||
@app.route("/", defaults={"path": ""})
|
||||
@app.route("/<path:path>")
|
||||
def serve_frontend(path):
|
||||
if not DIST_DIR.exists():
|
||||
return "Frontend not built. Run 'npm run build'.", 503
|
||||
|
||||
requested_file = DIST_DIR / path
|
||||
if path and requested_file.exists() and requested_file.is_file():
|
||||
return send_from_directory(DIST_DIR, path)
|
||||
|
||||
return send_from_directory(DIST_DIR, "index.html")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=5000)
|
||||
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Klangkiste Control Panel</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+2860
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "klangkiste-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview --host 0.0.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@phosphor-icons/react": "2.1.7",
|
||||
"primeicons": "^7.0.0",
|
||||
"primereact": "^10.7.0",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react": "4.3.1",
|
||||
"vite": "5.4.3"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,249 @@
|
||||
const defaultHost =
|
||||
typeof window !== 'undefined' && window.location ? window.location.hostname : '127.0.0.1';
|
||||
const API_BASE = '/api';
|
||||
|
||||
async function readJson(response) {
|
||||
const text = await response.text();
|
||||
try {
|
||||
return { ok: response.ok, status: response.status, data: JSON.parse(text) };
|
||||
} catch (error) {
|
||||
return { ok: response.ok, status: response.status, data: { detail: text } };
|
||||
}
|
||||
}
|
||||
|
||||
export async function getBoxes() {
|
||||
const response = await fetch(`${API_BASE}/boxes`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function pairBox(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/pair`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ box_id: boxId }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getStatus(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/status`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getBoxDetails(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/details`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getMediaTree() {
|
||||
const response = await fetch(`${API_BASE}/media-tree`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function createMediaFolder(parentPath, name) {
|
||||
const response = await fetch(`${API_BASE}/media/folder`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ parent_path: parentPath, name }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function renameMedia(path, name) {
|
||||
const response = await fetch(`${API_BASE}/media/rename`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ path, name }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function moveMedia(path, targetParent) {
|
||||
const response = await fetch(`${API_BASE}/media/move`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ path, target_parent: targetParent }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function deleteMedia(path) {
|
||||
const response = await fetch(`${API_BASE}/media/delete`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ path }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export function uploadMedia(targetPath, files, onProgress) {
|
||||
const formData = new FormData();
|
||||
formData.append('target_path', targetPath);
|
||||
files.forEach((file) => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const request = new XMLHttpRequest();
|
||||
request.open('POST', `${API_BASE}/media/upload`);
|
||||
request.upload.onprogress = (event) => {
|
||||
if (!event.lengthComputable || !onProgress) return;
|
||||
const percent = Math.round((event.loaded / event.total) * 100);
|
||||
onProgress(percent);
|
||||
};
|
||||
request.onload = () => {
|
||||
try {
|
||||
const data = JSON.parse(request.responseText || '{}');
|
||||
resolve({ ok: request.status >= 200 && request.status < 300, status: request.status, data });
|
||||
} catch (error) {
|
||||
resolve({
|
||||
ok: request.status >= 200 && request.status < 300,
|
||||
status: request.status,
|
||||
data: { detail: request.responseText || '' },
|
||||
});
|
||||
}
|
||||
};
|
||||
request.onerror = () => {
|
||||
resolve({ ok: false, status: 0, data: { detail: 'network error' } });
|
||||
};
|
||||
request.send(formData);
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTags() {
|
||||
const response = await fetch(`${API_BASE}/tags`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function generateTag(label) {
|
||||
const response = await fetch(`${API_BASE}/tags/generate`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ label }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function claimTag(uid, label) {
|
||||
const response = await fetch(`${API_BASE}/tags/claim`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ uid, label }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function markTagWritten(uid) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}/write`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getBoxTags(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/tags`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getBoxLocalTags(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/local-tags`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getBoxStorage(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/storage`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function getTagBlocks(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/tag-blocks`);
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function setTagBlock(boxId, uid, blocked) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/tag-blocks`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ uid, blocked }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function setBoxAlias(boxId, alias) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/alias`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ alias }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function setTagAlias(uid, alias) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}/alias`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ alias }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function assignTag(uid, boxId) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}/assign`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ box_id: boxId }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function unassignTag(uid, boxId) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}/unassign`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ box_id: boxId }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function deleteTag(uid) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function setTagMedia(uid, mediaPath) {
|
||||
const response = await fetch(`${API_BASE}/tags/${uid}/media`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ media_path: mediaPath }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function pullTagFromBox(boxId, uid, targetFolder) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/pull-tag`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ uid, target_folder: targetFolder }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function sendCommand(boxId, command, payload = {}) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/command`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ command, payload }),
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
|
||||
export async function unpairBox(boxId) {
|
||||
const response = await fetch(`${API_BASE}/boxes/${boxId}/unpair`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
return readJson(response);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { PrimeReactProvider } from 'primereact/api';
|
||||
import 'primereact/resources/themes/lara-dark-teal/theme.css';
|
||||
import 'primereact/resources/primereact.min.css';
|
||||
import 'primeicons/primeicons.css';
|
||||
import App from './App.jsx';
|
||||
import './styles.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<PrimeReactProvider>
|
||||
<App />
|
||||
</PrimeReactProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const rawTarget = env.VITE_BACKEND_URL || 'http://127.0.0.1:5001';
|
||||
const apiTarget = rawTarget.replace(/\/api\/?$/, '');
|
||||
|
||||
return {
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: true,
|
||||
port: 5174,
|
||||
strictPort: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: apiTarget,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Mediathek Loader</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+1681
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "mediathedownloader",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"start": "python3 app.py"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"vite": "^5.4.19"
|
||||
},
|
||||
"dependencies": {
|
||||
"primeflex": "^4.0.0",
|
||||
"primeicons": "^7.0.0",
|
||||
"primereact": "^10.9.7",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Flask
|
||||
requests
|
||||
cryptography
|
||||
+1296
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { PrimeReactProvider } from 'primereact/api';
|
||||
import 'primereact/resources/themes/lara-dark-teal/theme.css';
|
||||
import 'primereact/resources/primereact.min.css';
|
||||
import 'primeicons/primeicons.css';
|
||||
import 'primeflex/primeflex.css';
|
||||
import App from './App';
|
||||
import './styles.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<PrimeReactProvider value={{ ripple: true, inputStyle: 'filled' }}>
|
||||
<App />
|
||||
</PrimeReactProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
+502
@@ -0,0 +1,502 @@
|
||||
html,
|
||||
body,
|
||||
#root {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.app-shell {
|
||||
min-height: 100vh;
|
||||
padding-bottom: 5rem;
|
||||
background:
|
||||
radial-gradient(1200px 420px at 25% -8%, color-mix(in srgb, var(--primary-color) 25%, transparent), transparent 60%),
|
||||
linear-gradient(180deg, #08132a 0%, #071125 45%, #071022 100%);
|
||||
}
|
||||
|
||||
.app-topbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
border-bottom: 1px solid var(--surface-border);
|
||||
background: color-mix(in srgb, var(--surface-ground) 90%, black 10%);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.app-topbar-inner {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 0.8rem 1rem;
|
||||
}
|
||||
|
||||
.app-brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1rem;
|
||||
}
|
||||
|
||||
.app-brand-title {
|
||||
font-size: 0.88rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.app-brand-subtitle {
|
||||
font-size: 0.62rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
.app-main {
|
||||
max-width: 1120px;
|
||||
margin: 1rem auto;
|
||||
padding: 0 1rem 1.5rem;
|
||||
}
|
||||
|
||||
.app-content-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-areas:
|
||||
"search"
|
||||
"selection"
|
||||
"results";
|
||||
gap: 1rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.search-card {
|
||||
grid-area: search;
|
||||
}
|
||||
|
||||
.selection-panel {
|
||||
grid-area: selection;
|
||||
}
|
||||
|
||||
.results-card {
|
||||
grid-area: results;
|
||||
}
|
||||
|
||||
@media (min-width: 1260px) {
|
||||
.app-shell {
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 0;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
width: 100%;
|
||||
flex: 1 1 auto;
|
||||
height: calc(100vh - 3.4rem);
|
||||
min-height: 0;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-content-grid {
|
||||
height: 100%;
|
||||
grid-template-columns: minmax(0, 1fr) 23.5rem;
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
grid-template-areas:
|
||||
"results search"
|
||||
"results selection";
|
||||
}
|
||||
|
||||
.results-card {
|
||||
height: 100%;
|
||||
max-height: calc(100dvh - 8.5rem);
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.results-card .p-card-body {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.results-card .p-card-content {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.results-card .p-dataview {
|
||||
height: 100%;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.results-card .p-dataview-content {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow-y: auto !important;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.results-card .p-paginator {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.app-bottom-nav {
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 30;
|
||||
padding: 0.6rem 0.85rem max(0.6rem, env(safe-area-inset-bottom));
|
||||
border-top: 1px solid var(--surface-border);
|
||||
background: color-mix(in srgb, var(--surface-ground) 92%, black 8%);
|
||||
}
|
||||
|
||||
.app-bottom-nav-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 0.45rem;
|
||||
}
|
||||
|
||||
.app-bottom-nav .p-button {
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.app-bottom-nav .p-button.active {
|
||||
background: color-mix(in srgb, var(--primary-color) 20%, transparent);
|
||||
color: var(--primary-color-text);
|
||||
}
|
||||
|
||||
.mobile-sheet-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 45;
|
||||
background: rgba(5, 10, 18, 0.68);
|
||||
display: grid;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.mobile-sheet-card {
|
||||
max-height: 82vh;
|
||||
overflow-y: auto;
|
||||
border-radius: 1rem 1rem 0 0;
|
||||
border: 1px solid var(--surface-border);
|
||||
background: color-mix(in srgb, var(--surface-ground) 92%, black 8%);
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.mobile-sheet-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
|
||||
.mobile-sheet-content {
|
||||
display: grid;
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.mobile-panel-card {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.result-row {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid var(--surface-border);
|
||||
background: color-mix(in srgb, var(--surface-card) 92%, black 8%);
|
||||
}
|
||||
|
||||
.result-label {
|
||||
display: inline-block;
|
||||
font-size: 0.64rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color-secondary);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.result-grid {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.result-table-head,
|
||||
.result-table-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 4.2rem 6.4rem 4.6rem 2.8rem;
|
||||
column-gap: 0.6rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.result-table-row {
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
|
||||
.result-controls-group {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.result-title {
|
||||
font-size: 0.74rem;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.result-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.result-muted {
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
.result-columns {
|
||||
margin: 0 0 0.35rem;
|
||||
padding: 0.45rem 0.75rem;
|
||||
background: color-mix(in srgb, var(--surface-card) 78%, black 22%);
|
||||
border: 1px solid var(--surface-border);
|
||||
border-radius: 0.45rem;
|
||||
font-size: 0.6rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.selection-row {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid var(--surface-border);
|
||||
background: color-mix(in srgb, var(--surface-card) 95%, black 5%);
|
||||
}
|
||||
|
||||
.selection-header {
|
||||
padding: 0.6rem 0.75rem 0.35rem;
|
||||
}
|
||||
|
||||
.selection-meta {
|
||||
margin-top: 0.1rem;
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
|
||||
.selection-controls {
|
||||
margin: 0;
|
||||
padding: 0.2rem 0.75rem 0.6rem;
|
||||
border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
|
||||
}
|
||||
|
||||
.quality-compact {
|
||||
width: 5.4rem;
|
||||
min-width: 5.4rem;
|
||||
}
|
||||
|
||||
.quality-compact .p-dropdown-label {
|
||||
padding-right: 1.8rem;
|
||||
}
|
||||
|
||||
.quality-compact-main .p-dropdown-label {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.panel-card {
|
||||
border: 1px solid var(--surface-border);
|
||||
box-shadow: 0 10px 28px color-mix(in srgb, black 22%, transparent);
|
||||
}
|
||||
|
||||
.panel-card .p-card-title {
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.76rem;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.panel-card .p-card-body {
|
||||
padding: 0.85rem 1rem 1rem;
|
||||
}
|
||||
|
||||
.panel-card .p-card-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.search-panel .p-card-body {
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.app-shell .p-inputtext,
|
||||
.app-shell .p-dropdown,
|
||||
.app-shell .p-multiselect,
|
||||
.app-shell .p-button,
|
||||
.app-shell .p-tag,
|
||||
.app-shell .p-checkbox-label {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.app-shell .p-dropdown-label,
|
||||
.app-shell .p-multiselect-label {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.app-shell,
|
||||
.app-shell .text-sm,
|
||||
.app-shell .text-xs,
|
||||
.app-shell .text-600 {
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
|
||||
.app-shell .p-component,
|
||||
.app-shell .p-tag .p-tag-value,
|
||||
.app-shell .p-dropdown-panel .p-dropdown-items .p-dropdown-item,
|
||||
.app-shell .p-multiselect-panel .p-multiselect-items .p-multiselect-item,
|
||||
.app-shell .p-multiselect-token,
|
||||
.app-shell .p-button .p-button-label,
|
||||
.app-shell .p-inputtext,
|
||||
.app-shell .p-checkbox + label,
|
||||
.app-shell .p-checkbox-label,
|
||||
.app-shell .p-dropdown .p-dropdown-label,
|
||||
.app-shell .p-multiselect .p-multiselect-label {
|
||||
font-size: 0.68rem !important;
|
||||
}
|
||||
|
||||
.app-shell .p-tag {
|
||||
padding: 0.2rem 0.4rem;
|
||||
}
|
||||
|
||||
.app-shell .p-inputtext,
|
||||
.app-shell .p-dropdown .p-dropdown-label,
|
||||
.app-shell .p-multiselect .p-multiselect-label {
|
||||
padding-top: 0.42rem;
|
||||
padding-bottom: 0.42rem;
|
||||
}
|
||||
|
||||
.app-shell .p-dataview-content > .grid {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.app-shell .p-dataview-content > .grid > .col-12 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.app-shell .p-paginator {
|
||||
padding: 0.65rem 0 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.app-shell .p-paginator .p-dropdown {
|
||||
min-width: 5rem;
|
||||
height: 2.2rem;
|
||||
}
|
||||
|
||||
.app-shell .p-paginator .p-dropdown .p-dropdown-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.app-shell .p-paginator .p-dropdown .p-dropdown-trigger {
|
||||
width: 2rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.app-bottom-nav {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.app-brand-subtitle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-main {
|
||||
padding: 0 0.75rem 1.5rem;
|
||||
}
|
||||
|
||||
.app-content-grid {
|
||||
grid-template-areas: "results";
|
||||
}
|
||||
|
||||
.panel-card .p-card-body {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.mobile-sheet-card .panel-card .p-card-body {
|
||||
padding: 0.7rem;
|
||||
}
|
||||
|
||||
.result-table-head {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.result-table-row {
|
||||
grid-template-columns: minmax(0, 40%) minmax(0, 60%);
|
||||
grid-template-areas: "title controls";
|
||||
row-gap: 0;
|
||||
column-gap: 0.7rem;
|
||||
align-items: center;
|
||||
padding: 0.55rem 0.6rem;
|
||||
}
|
||||
|
||||
.result-col-title {
|
||||
grid-area: title;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.result-controls-group {
|
||||
grid-area: controls;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
justify-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.result-col-video,
|
||||
.result-col-ut,
|
||||
.result-col-action {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.result-col-quality {
|
||||
width: 100%;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.result-tags {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0.32rem;
|
||||
justify-content: stretch;
|
||||
align-content: start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.quality-compact {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 4.9rem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
SKIP_BUILD=0
|
||||
if [[ "${1:-}" == "--skip-build" ]]; then
|
||||
SKIP_BUILD=1
|
||||
fi
|
||||
|
||||
if [[ ! -d node_modules ]]; then
|
||||
echo "Installing frontend dependencies..."
|
||||
npm install
|
||||
fi
|
||||
|
||||
if [[ $SKIP_BUILD -eq 0 ]]; then
|
||||
echo "Building frontend..."
|
||||
npm run build
|
||||
fi
|
||||
|
||||
echo "Starting Flask app on http://127.0.0.1:5000 ..."
|
||||
exec python3 app.py
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/channels': 'http://127.0.0.1:5000',
|
||||
'/search': 'http://127.0.0.1:5000'
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user