yt-dlp declares `dependencies = []` and puts everything in extras, so the bare `yt-dlp` requirement installed it with no yt-dlp-ejs and no JavaScript runtime. Without those it cannot solve YouTube's player challenges and falls back to media URLs that YouTube rejects with HTTP 403, which is the failure seen when adding a song. Require `yt-dlp[default,curl-cffi,deno]` instead; the deno extra ships the JS runtime as a wheel, so the image needs no extra apt packages. Around that, make the stage survive the next time YouTube changes something: the download is retried against each player client in `ytdlp_clients` (default `["default", "tv"]`, the latter not needing a PO token) before giving up, yt-dlp's retry counts are raised, and its own log lines are routed into the job log so a PO-token demand can be told apart from a rate limit. The final error names the running yt-dlp version, since a stale one is the usual cause. Cookies, TLS impersonation and a bgutil PO token provider URL are now config fields, so an operator can work around a block without a code change. `_classify_downloads` skips .part/.ytdl scratch files, which retries make far more likely to be lying around.
48 lines
1.2 KiB
TOML
48 lines
1.2 KiB
TOML
[project]
|
|
name = "songtrace"
|
|
version = "0.1.0"
|
|
description = "Generate UltraStar/Melody Mania karaoke songs from a video and reference lyrics"
|
|
requires-python = ">=3.11"
|
|
license = "AGPL-3.0-or-later"
|
|
dependencies = [
|
|
# yt-dlp declares no runtime deps of its own; the extras are what make
|
|
# YouTube work. "default" pulls yt-dlp-ejs (JS challenge solving) and the
|
|
# requests/urllib3 handlers, "deno" ships the JS runtime that executes it,
|
|
# and "curl-cffi" provides the --impersonate targets. Without them YouTube
|
|
# extraction degrades to HTTP 403 on the media URLs.
|
|
"yt-dlp[default,curl-cffi,deno]",
|
|
"demucs",
|
|
"torch",
|
|
"torchaudio",
|
|
"torchcrepe",
|
|
"librosa",
|
|
"soundfile",
|
|
"numpy",
|
|
"pyphen",
|
|
"num2words",
|
|
"httpx",
|
|
"fastapi",
|
|
"uvicorn",
|
|
"python-multipart",
|
|
"pillow",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["pytest", "playwright"]
|
|
|
|
[project.scripts]
|
|
songtrace = "songtrace.cli:main"
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.setuptools.package-data]
|
|
songtrace = ["static/*", "static/fonts/*"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|