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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user