feat(aircraft): planespotters.net photo in aircraft popup #16
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/planespotters-photos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a planespotters.net latest-photo lookup to the ADS-B aircraft popup on the map.
app/live_layers.py—fetch_planespotters_photo()(hex preferred, reg fallback) +_normalize_planespotter_photo(); 24h TTL cache (planespotters ToS cap).app/main.py—GET /api/aircraft/photo?hex=...(orreg=...): 422 on missing/invalid params, 404 when no photo, 502 on upstream failure.app/static/index.html—.ps-photoblock in the ADS-B popup; lazy-loads onpopupopen; thumbnail links to the photo page + photographer credit.Why server-side, not browser fetch()
Planespotters returns
403for any request carrying anOriginheader — and every browserfetch()sends one. So the JSON must be proxied server-side with the identifyingOSINT_USER_AGENT. The thumbnail binary itself is loaded by the browser straight from the planespotters CDN (never re-hosted), per their Terms of Use.Tests
test_live_layers.py) + 4 API contract tests (test_api_live_layers.py).fetch_planespotters_photo(hex_code='e8027e')returned a real photo (LATAM A320, photographer "Philipp Greiml"); a hex absent from their DB returnsNoneand the popup hides the block.