Camera scraper: live public source (fury999io/public-ip-cams), markdown-list parser, batch IP geolocation via ip-api; fix empty-env fallback so default source applies
All checks were successful
build-and-deploy / build (push) Successful in 1m38s
All checks were successful
build-and-deploy / build (push) Successful in 1m38s
This commit is contained in:
parent
28146c1adc
commit
347ee3a642
2 changed files with 90 additions and 25 deletions
|
|
@ -12,14 +12,16 @@ import os
|
|||
# * Insecam-style HTML directory pages (lat/lon embedded per camera)
|
||||
# * Plain-text lists, one camera per line:
|
||||
# <url>[|<lat>,<lon>|<vendor>|<location_name>]
|
||||
# NOTE: docker-compose always defines CAMERA_SOURCE_URLS (empty when no .env),
|
||||
# so os.getenv()'s default would never apply — use `or` semantics instead.
|
||||
_DEFAULT_SOURCE_URL = (
|
||||
# Publicly published open-camera list (markdown bullets of stream URLs).
|
||||
"https://raw.githubusercontent.com/fury999io/public-ip-cams/main/README.md"
|
||||
)
|
||||
CAMERA_SOURCE_URLS = [
|
||||
u.strip()
|
||||
for u in os.getenv(
|
||||
"CAMERA_SOURCE_URLS",
|
||||
# Default: publicly published open-camera lists (free, no paid API).
|
||||
"https://raw.githubusercontent.com/neo23x0/CameraHacks/main/camera_list.txt",
|
||||
).split(",")
|
||||
if u.strip()
|
||||
for u in (os.getenv("CAMERA_SOURCE_URLS") or _DEFAULT_SOURCE_URL).split(",")
|
||||
if u.strip() # empty env var → fall back to the default above
|
||||
]
|
||||
|
||||
# Seconds between full scrape cycles of every source.
|
||||
|
|
|
|||
Loading…
Reference in a new issue