diff --git a/setup.py b/setup.py index 2ee41c4..524ebb9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="simple_dwd_weatherforecast", - version="2.0.11", + version="2.0.12", author="Max Fermor", description="A simple tool to retrieve a weather forecast from DWD OpenData", long_description=long_description, diff --git a/simple_dwd_weatherforecast/dwdforecast.py b/simple_dwd_weatherforecast/dwdforecast.py index 7a6e5a5..0ec638d 100644 --- a/simple_dwd_weatherforecast/dwdforecast.py +++ b/simple_dwd_weatherforecast/dwdforecast.py @@ -811,7 +811,10 @@ def download_latest_kml(self, stationid, force_hourly=False): self.parse_kml(kml, force_hourly) def download_latest_report(self): - url = f"https://opendata.dwd.de/weather/weather_reports/poi/{self.station_id}-BEOB.csv" + station_id = self.station_id + if len(station_id) == 4: + station_id = station_id + '_' + url = f"https://opendata.dwd.de/weather/weather_reports/poi/{station_id}-BEOB.csv" headers = {"If-None-Match": self.etags[url] if url in self.etags else ""} response = requests.get(url, headers=headers) if response.status_code == 200: