From a5154c38ed9a05f9d1bc6cc70f93cd505e994907 Mon Sep 17 00:00:00 2001 From: frederik Date: Sun, 17 Aug 2025 09:59:12 +0200 Subject: [PATCH] add IMAGE_PROVIDER config --- scripts/config.php | 13 +++++++++++-- scripts/install_config.sh | 4 ++++ scripts/update_birdnet_snippets.sh | 10 ++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/config.php b/scripts/config.php index d60658d..3266b2b 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -59,6 +59,7 @@ if(isset($_GET["latitude"])){ $apprise_notification_title = $_GET['apprise_notification_title']; $apprise_notification_body = $_GET['apprise_notification_body']; $minimum_time_limit = $_GET['minimum_time_limit']; + $image_provider = $_GET["image_provider"]; $flickr_api_key = $_GET['flickr_api_key']; $flickr_filter_email = $_GET["flickr_filter_email"]; $language = $_GET["language"]; @@ -142,6 +143,7 @@ if(isset($_GET["latitude"])){ $contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES=.*/", "APPRISE_NOTIFY_NEW_SPECIES=$apprise_notify_new_species", $contents); $contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=.*/", "APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=$apprise_notify_new_species_each_day", $contents); $contents = preg_replace("/APPRISE_WEEKLY_REPORT=.*/", "APPRISE_WEEKLY_REPORT=$apprise_weekly_report", $contents); + $contents = preg_replace("/IMAGE_PROVIDER=.*/", "IMAGE_PROVIDER=$image_provider", $contents); $contents = preg_replace("/FLICKR_API_KEY=.*/", "FLICKR_API_KEY=$flickr_api_key", $contents); if(strlen($language) == 2){ $contents = preg_replace("/DATABASE_LANG=.*/", "DATABASE_LANG=$language", $contents); @@ -553,12 +555,19 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
-

Bird Photos from Flickr

+

Bird Photo Source

+ + +
+

Set your Flickr API key to enable the display of bird images next to detections. Get your key here.



-

Set your Flickr API key to enable the display of bird images next to detections. Get your free key here.


Localization

diff --git a/scripts/install_config.sh b/scripts/install_config.sh index 44bf19d..6e3a1bd 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -109,6 +109,10 @@ APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=0 APPRISE_ONLY_NOTIFY_SPECIES_NAMES="" APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2="" +#---------------------- Image Provider Configuration ------------------------# +## WIKIPEDIA or FLICKR (Flickr requires API key) +IMAGE_PROVIDER=WIKIPEDIA + #---------------------- Flickr Images API Configuration -----------------------# ## If FLICKR_API_KEY is set, the web interface will try and display bird images ## for each detection. If FLICKR_FILTER_EMAIL is set, the images will only be diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index f7b7ade..67988f6 100755 --- a/scripts/update_birdnet_snippets.sh +++ b/scripts/update_birdnet_snippets.sh @@ -113,6 +113,16 @@ if ! grep -E '^RARE_SPECIES_THRESHOLD=' /etc/birdnet/birdnet.conf &>/dev/null;th echo "RARE_SPECIES_THRESHOLD=\"30\"" >> /etc/birdnet/birdnet.conf fi +if ! grep -E '^IMAGE_PROVIDER=' /etc/birdnet/birdnet.conf &>/dev/null;then + if grep -E '^FLICKR_API_KEY=\S+' /etc/birdnet/birdnet.conf &>/dev/null;then + PROVIDER=FLICKR + else + PROVIDER="" + fi + echo '## WIKIPEDIA or FLICKR (Flickr requires API key)' >> /etc/birdnet/birdnet.conf + echo "IMAGE_PROVIDER=${PROVIDER}" >> /etc/birdnet/birdnet.conf +fi + [ -d $RECS_DIR/StreamData ] || sudo_with_user mkdir -p $RECS_DIR/StreamData [ -L ${EXTRACTED}/spectrogram.png ] || sudo_with_user ln -sf ${RECS_DIR}/StreamData/spectrogram.png ${EXTRACTED}/spectrogram.png