Skip to content

Commit

Permalink
Refactor url handling
Browse files Browse the repository at this point in the history
  • Loading branch information
H4rdB4se committed Jan 9, 2025
1 parent 4447189 commit cc9c44b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions maps4fs/generator/dtm/bavaria.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ def get_download_urls(self) -> list[str]:
tree = ET.parse(file_path)
root = tree.getroot()
namespace = {'ml': 'urn:ietf:params:xml:ns:metalink'}
url_set = set()
for url in root.findall('.//ml:url', namespace):
url_set.add(url.text)
if url.text not in urls:
urls.append(url.text)

urls = list(url_set)
self.download_tif_files(urls)
else:
self.logger.error("Failed to get data. HTTP Status Code: %s", response.status_code)
Expand Down

0 comments on commit cc9c44b

Please sign in to comment.