Walk the grouped index, ask flickr for each new photo, download the best
size that actually serves, and write the sidecar only once the file is
renamed into place. Photos already complete cost no flickr calls; a change
in which pages use one rewrites just the sidecar. Every failure is
recorded with the pages affected and the run carries on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Immich has no copyright or source fields, so the photographer, licence,
flickr page and every wiki page using the photo go into a marked block in
the description. The marker lets a later run find and replace only that
block, leaving anything written by hand alone. Tags mirror licence and
photographer for filtering.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The sidecar is what makes the directory a backup on its own and what the
immich phase reads, so it is written atomically and a photo only counts as
done when the sidecar, its file and no .part remain.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two unsigned json calls per photo: getInfo for title, owner, dates and
licence, getSizes for the renditions. Sizes come back ordered best-first so
a missing original can fall through to the next. Not-found and permission
errors become PhotoGone so the run can name the wiki pages affected.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One json request to the wiki's index carries every node's image fields, so
no per-page scraping is needed. Nodes are grouped by flickr photo id, taken
from the thumbnail filename or the photo page, so a photo used on several
pages is fetched once and its description can list them all.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One place decides what is worth another attempt: 429, 5xx and network
errors, with jittered exponential backoff and Retry-After honoured. Other
4xx responses fail at once. Downloads stream to disk under the same policy,
refuse a body over the size cap, and only flickr calls and photo downloads
are paced; the api key is redacted from debug output.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Reuse the flickr key flickrtouchr already holds and the immich url and key
immich-sync uses, so nothing secret is duplicated. Everything else comes
from a typed settings file with flag > environment > file > default
precedence, so a cron line can be the bare script.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Start the script that will back up the Randomness Guide to London's photos
to disk and Immich. This commit holds the constants, error classes and
quiet-aware output helpers every later section relies on, plus the test
loader for an extensionless script.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>