A live bird collage card for your Home Assistant dashboard.
Use raw flac (#408)
Alexandre176a10578242
diff --git a/requirements.txt b/requirements.txtindex d8993564..ef6c133c 100644--- a/requirements.txt+++ b/requirements.txt@@ -16,3 +16,4 @@ requestsmatplotlibpillowpyarrow==20.0.0+soundfilediff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.shindex 85312cb7..f7b7ade4 100755--- a/scripts/update_birdnet_snippets.sh+++ b/scripts/update_birdnet_snippets.sh@@ -141,6 +141,7 @@ if [ "$PY_VERSION" == 39 ] && [ "$tf_version" != "2.11.0" ] || [ "$PY_VERSION" !fiensure_python_package inotify inotify+ensure_python_package soundfile soundfileif ! which inotifywait &>/dev/null;thenensure_apt_updateddiff --git a/scripts/utils/reporting.py b/scripts/utils/reporting.pyindex 336010b8..c8c5f62c 100644--- a/scripts/utils/reporting.py+++ b/scripts/utils/reporting.py@@ -1,5 +1,4 @@import glob-import gzipimport jsonimport loggingimport os@@ -179,15 +178,14 @@ def bird_weather(file: ParseFileName, detections: [Detection]):except Exception as e:log.error("Error during FLAC conversion: %s", e)return- gzip_flac_data = gzip.compress(flac_data)# POST soundscape to serversoundscape_url = (f'https://app.birdweather.com/api/v1/stations/'f'{conf["BIRDWEATHER_ID"]}/soundscapes?timestamp={file.iso8601}')try:- response = requests.post(url=soundscape_url, data=gzip_flac_data, timeout=30,- headers={'Content-Type': 'application/octet-stream', 'Content-Encoding': 'gzip'})+ response = requests.post(url=soundscape_url, data=flac_data, timeout=30,+ headers={'Content-Type': 'audio/flac'})log.info("Soundscape POST Response Status - %d", response.status_code)sdata = response.json()except BaseException as e: