Root cause of bad album/title tags: yt-dlp's --parse-metadata reads a
single-word FROM (matching field_to_template's ^[a-zA-Z_]+$) as a *field
name*, so literal one-word titles/albums like "Cochise" became "NA". Inject
literals via seed-then-replace into meta_<tag> instead (--parse-metadata to
create the field, --replace-in-metadata with literal args to set it), which
is immune to template parsing and also creates tags the source lacks.
- yt_download: literal-safe meta_artist/title/album; hit album no longer
clobbered by the Unknown-Album default; artist tag now created when missing.
- lidarr_search: connection/timeout errors surface via err() ("Lidarr
unreachable … falling back to YouTube") instead of silent dbg(), so the
YouTube fallback isn't mistaken for "no Lidarr match".
- Dockerfile: install deno (arch-aware) — the JS runtime yt-dlp needs for
YouTube; without it: "No supported JavaScript runtime" / HTTP 403.
- repair: treat NA/Unknown placeholders as bogus and overwrite title/artist
from source (was fill-missing-only); normalise literal "NA" album to
"Unknown Album"; rename bogus "NA [<id>]" filenames to the recovered title.
- README updated; .gitignore excludes server/log.txt.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
FROM python:3.12-slim
|
|
|
|
# ffmpeg for audio extraction/embedding; deno is the JS runtime yt-dlp needs
|
|
# for YouTube (without it: "No supported JavaScript runtime" -> missing formats
|
|
# / HTTP 403). yt-dlp auto-detects deno on PATH.
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ffmpeg ca-certificates curl unzip \
|
|
&& arch="$(uname -m)" \
|
|
&& case "$arch" in \
|
|
x86_64) deno_arch=x86_64-unknown-linux-gnu ;; \
|
|
aarch64) deno_arch=aarch64-unknown-linux-gnu ;; \
|
|
*) echo "unsupported arch: $arch" >&2; exit 1 ;; \
|
|
esac \
|
|
&& curl -fsSL "https://github.com/denoland/deno/releases/latest/download/deno-${deno_arch}.zip" -o /tmp/deno.zip \
|
|
&& unzip /tmp/deno.zip -d /usr/local/bin \
|
|
&& rm /tmp/deno.zip \
|
|
&& apt-get purge -y --auto-remove curl unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY server/requirements.txt /app/server/requirements.txt
|
|
RUN pip install --no-cache-dir -r /app/server/requirements.txt
|
|
|
|
COPY musicfetch /app/musicfetch
|
|
COPY server /app/server
|
|
|
|
EXPOSE 6769
|
|
CMD ["sh", "-c", "uvicorn server.app:app --host 0.0.0.0 --port ${MUSICFETCH_PORT:-6769}"]
|