Fix volume permissions: entrypoint chowns /data to uid 1000, run app as non-root
This commit is contained in:
@@ -462,8 +462,10 @@ def start_download(
|
||||
|
||||
file_path = None
|
||||
stream_index = 0
|
||||
output_lines: list[str] = []
|
||||
for line in process.stdout:
|
||||
line = line.strip()
|
||||
output_lines.append(line)
|
||||
if re.search(r"\[download\] Destination:", line):
|
||||
stream_index += 1
|
||||
m = re.search(r"\[download\]\s+([\d.]+)%", line)
|
||||
@@ -480,7 +482,10 @@ def start_download(
|
||||
resolution = detect_resolution(file_path) if file_path else None
|
||||
on_complete(download_id, file_path, resolution)
|
||||
else:
|
||||
on_error(download_id, f"yt-dlp exited with code {process.returncode}")
|
||||
tail = "\n".join(output_lines[-20:]) if output_lines else "(no output)"
|
||||
import logging
|
||||
logging.getLogger(__name__).error("yt-dlp failed (code %d):\n%s", process.returncode, tail)
|
||||
on_error(download_id, f"yt-dlp exited with code {process.returncode}:\n{tail}")
|
||||
|
||||
thread = threading.Thread(target=_run_download, daemon=True)
|
||||
thread.start()
|
||||
|
||||
Reference in New Issue
Block a user