Merge pull request #822 from patrikbwi/patrikbwi-patch-1

Update server.py
This commit is contained in:
ehpersonal38
2023-04-10 21:41:05 -04:00
committed by GitHub
+4 -1
View File
@@ -13,6 +13,7 @@ import operator
import socket
import threading
import os
import gzip
from utils.notifications import sendAppriseNotifications
from utils.parse_settings import config_to_settings
@@ -559,7 +560,9 @@ def handle_client(conn, addr):
with open(args.i, 'rb') as f:
wav_data = f.read()
response = requests.post(url=soundscape_url, data=wav_data, headers={'Content-Type': 'application/octet-stream'})
gzip_wav_data = gzip.compress(wav_data)
response = requests.post(url=soundscape_url, data=gzip_wav_data, headers={'Content-Type': 'application/octet-stream',
'Content-Encoding': 'gzip'})
print("Soundscape POST Response Status - ", response.status_code)
sdata = response.json()
soundscape_id = sdata['soundscape']['id']