feat: add YouTube cookies upload via web UI

Adds a Settings panel to upload a cookies.txt file directly from the
browser, persisted in a named Docker volume. yt-dlp uses the file
when present to bypass YouTube bot detection.
This commit is contained in:
Julien Calixte
2026-03-23 19:32:51 +01:00
parent c49ecab33f
commit 57910462e4
5 changed files with 91 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import asyncio
import uuid
import os
from pathlib import Path
from app.config import settings
AUDIO_TMP_DIR = "/tmp/apoena-audio"
@@ -21,9 +22,13 @@ async def extract_audio(url: str) -> Path:
"--audio-quality", "128K",
"--format", "bestaudio/best",
"--output", outtmpl,
url,
]
if settings.yt_dlp_cookies_file:
cmd += ["--cookies", settings.yt_dlp_cookies_file]
cmd.append(url)
proc = await asyncio.create_subprocess_exec(
*cmd,
stdout=asyncio.subprocess.PIPE,