From 401fc137e74617af733070369cd301e17bf52938 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 6 Feb 2023 20:12:25 +0100 Subject: [PATCH] fix loading after v14 of edgeAI #12 --- collectmeteranalog/collect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/collectmeteranalog/collect.py b/collectmeteranalog/collect.py index ccf5885..f024d6f 100644 --- a/collectmeteranalog/collect.py +++ b/collectmeteranalog/collect.py @@ -56,6 +56,8 @@ def readimages(servername, output_dir, daysback=15): path = output_dir + "/" + servername + "/" + picturedate + "/" + hour os.makedirs(path, exist_ok=True) for url in urls: + if (url[-4] != 'jpg'): + continue prefix = os.path.basename(url).split('_', 1)[0] if (prefix == os.path.basename(url)): prefix = '' @@ -66,6 +68,7 @@ def readimages(servername, output_dir, daysback=15): while countrepeat > 0: if (not os.path.exists(path + "/" + prefix + filename)): try: + print(serverurl+url) img = Image.open(requests.get(serverurl+url, stream=True).raw) img.save(path + "/" + prefix + filename) count = count + 1