fix: self-update yt-dlp on container start

Instagram and TikTok extraction silently breaks whenever yt-dlp falls
behind upstream API changes, and fixing it required a manual image
rebuild each time. Updating at container start ties the fix to the Pi's
weekly reboot instead, so the extractor stays current without operator
intervention. A failed update never blocks startup, because the network
may not be up yet right after boot.

.gitattributes pins LF for shell scripts: a CRLF checkout on Windows
would make the entrypoint unrunnable inside the Linux container.

Claude-Session: https://claude.ai/code/session_01QkiLqAtFamcbFXDnCtZSPm
This commit is contained in:
Andre
2026-07-18 15:06:36 +02:00
parent 66c3fc8f7a
commit 9451c6e6d3
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -7,5 +7,9 @@ APP_GID=${APP_GID:-1000}
# Fix ownership of mounted volumes so the app user can write to them
chown "${APP_UID}:${APP_GID}" /app/tmp /app/data /app/data/images
# Self-update yt-dlp on every container start (Instagram/TikTok break old versions).
# Must not block or fail the boot: network may not be up yet after a Pi reboot.
timeout 60 yt-dlp -U || echo "yt-dlp self-update failed, continuing with installed version"
# Drop from root to app user and run the actual command
exec gosu "${APP_UID}:${APP_GID}" "$@"