mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-06 06:51:35 +01:00
feat: better error handling & feedback
This commit is contained in:
3
main.py
3
main.py
@@ -61,7 +61,6 @@ def downloadFlugfeldData(fromTime, toTime, dtype):
|
||||
|
||||
# check response code #
|
||||
if r.status_code != 200 or "nicht gefunden" in r.text.lower():
|
||||
print("Flugfeld kapott")
|
||||
content = fallback_csv.generate("./dwd", fromTime, toTime, cacheFile, dtype)
|
||||
else:
|
||||
content = r.content.decode('utf-8', "ignore") # ignore bad bytes
|
||||
@@ -101,8 +100,6 @@ def checkLastMonths(backwardsMonths=6):
|
||||
if start > end:
|
||||
return ""
|
||||
|
||||
print(start, end)
|
||||
|
||||
for dtype in dtypes:
|
||||
content = downloadFlugfeldData(start, end, dtype)
|
||||
dataList = parse(content, dtype)
|
||||
|
||||
Reference in New Issue
Block a user