setup icloudphotodownloader

This commit is contained in:
tomasr committed 2026-08-14 12:15:38 +02:00
1 parent 69ad5b3d13
commit f2e3f30173
5 files changed
+257 -3

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_DIR="/home/tomasr/vps-config"
ENV_FILE="$REPO_DIR/.env"
ICLOUDPD="/home/tomasr/.venvs/icloudpd/bin/icloudpd"
COOKIE_DIR="/home/tomasr/.icloudpd"
if [[ ! -f "$ENV_FILE" ]]; then
echo "ERROR: $ENV_FILE does not exist."
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
if [[ -z "${ICLOUD_EMAIL:-}" ]]; then
echo "ERROR: ICLOUD_EMAIL is not configured."
exit 1
fi
if [[ -z "${ICLOUD_PASSWORD:-}" ]]; then
echo "ERROR: ICLOUD_PASSWORD is not configured."
exit 1
fi
mkdir -p "$COOKIE_DIR"
chmod 700 "$COOKIE_DIR"
echo "Authenticating icloudpd as $ICLOUD_EMAIL"
echo
"$ICLOUDPD" \
--auth-only \
--username "$ICLOUD_EMAIL" \
--password "$ICLOUD_PASSWORD" \
--cookie-directory "$COOKIE_DIR"
echo
echo "iCloud authentication completed."