From 72de657202619ef6d2b3da46ba2222882abd71bb Mon Sep 17 00:00:00 2001 From: Zwitschi Date: Fri, 6 Nov 2026 23:56:51 +0100 Subject: [PATCH] docs: record the second reference pass and its gaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five usable sets added locally (hero daytime façades, the El Capitan Theatre block, night premiere staging, Ovation Hollywood, and the Lee Drug neighbour) — 41 images total, none committed. Records what remains missing: a sidewalk-level frame of the hero entry, the 6806-6822 retail run, and a night frame of 6840 itself rather than its neighbour. commons_fetch.py now survives a throttled download instead of discarding the rest of the batch, and takes --delay. --- Tools/README.md | 2 +- Tools/commons_fetch.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Tools/README.md b/Tools/README.md index efa941e..9c75da5 100644 --- a/Tools/README.md +++ b/Tools/README.md @@ -17,7 +17,7 @@ Repeatable import/export and processing helpers. Anything that was done twice by - `street_mesh.py` — road, kerbs, and sidewalks on the DEM, in the project frame; kerbs flush at the three crossings. - `terrain_from_dem.py` — terrain grid from the committed DEM, with building footprints cut out. - `blosm_blockout.py` — headless Blosm import of the committed `.osm` extract into a `.blend`, with a per-building scale report. Exact invocation in `Art/blender/README.md`. -- `commons_fetch.py` — Wikimedia Commons reference fetcher. Search or exact `File:` titles, 1600 px thumbnails, provenance `sidecar.json` per folder. Writes only into the gitignored `Art/reference/`; reference images are never committed. +- `commons_fetch.py` — Wikimedia Commons reference fetcher. Search or exact `File:` titles, thumbnails, provenance `sidecar.json` per folder. Wikimedia throttles `upload.wikimedia.org` (HTTP 429), so keep batches to six or fewer files and pass `--delay 3`; a throttled file is skipped and recorded rather than aborting the run. Writes only into the gitignored `Art/reference/`; reference images are never committed. ## Planned helpers - Blender export preset runner (named presets, metric scale assertion) diff --git a/Tools/commons_fetch.py b/Tools/commons_fetch.py index ae2b428..0b6bb9e 100755 --- a/Tools/commons_fetch.py +++ b/Tools/commons_fetch.py @@ -166,6 +166,7 @@ def main() -> int: ap.add_argument("--limit", type=int, default=6) ap.add_argument("--width", type=int, default=1600, help="thumbnail width in px") ap.add_argument("--dry-run", action="store_true") + ap.add_argument("--delay", type=float, default=2.0, help="seconds between downloads") args = ap.parse_args() if not args.query and not args.file: @@ -199,7 +200,13 @@ def main() -> int: name = safe_name(item["title"], index) path = os.path.join(out_dir, name) print(f" [{index}/{len(selected)}] {item['title']}") - digest = download(item["download_url"], path) + try: + digest = download(item["download_url"], path) + except SystemExit as exc: + # one throttled file must not discard the ones already fetched + print(f" skipped: {exc}", flush=True) + time.sleep(args.delay * 5) + continue item.update( { "local_file": name, @@ -208,7 +215,7 @@ def main() -> int: } ) records.append(item) - time.sleep(1) + time.sleep(args.delay) sidecar = { "fetched_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds"),