From 9451c6e6d335ffa65593011f583f8c89dc9f71df Mon Sep 17 00:00:00 2001 From: Andre <200930841+Andre-Bzk@users.noreply.github.com> Date: Sat, 18 Jul 2026 15:06:36 +0200 Subject: [PATCH] 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 --- .gitattributes | 2 ++ entrypoint.sh | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5242e84 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Shell scripts must keep LF endings – they run inside the Linux container +*.sh text eol=lf diff --git a/entrypoint.sh b/entrypoint.sh index c229a81..5d673d6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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}" "$@"