Hotfix empty urls

This commit is contained in:
henryruhs 2024-12-24 16:40:37 +01:00
parent 7a09479fb5
commit 91e4616fe1

View File

@ -72,6 +72,7 @@ def conditional_download_hashes(hashes : DownloadSet) -> bool:
for index in hashes: for index in hashes:
if hashes.get(index).get('path') in invalid_hash_paths: if hashes.get(index).get('path') in invalid_hash_paths:
invalid_hash_url = hashes.get(index).get('url') invalid_hash_url = hashes.get(index).get('url')
if invalid_hash_url:
download_directory_path = os.path.dirname(hashes.get(index).get('path')) download_directory_path = os.path.dirname(hashes.get(index).get('path'))
conditional_download(download_directory_path, [ invalid_hash_url ]) conditional_download(download_directory_path, [ invalid_hash_url ])
@ -98,6 +99,7 @@ def conditional_download_sources(sources : DownloadSet) -> bool:
for index in sources: for index in sources:
if sources.get(index).get('path') in invalid_source_paths: if sources.get(index).get('path') in invalid_source_paths:
invalid_source_url = sources.get(index).get('url') invalid_source_url = sources.get(index).get('url')
if invalid_source_url:
download_directory_path = os.path.dirname(sources.get(index).get('path')) download_directory_path = os.path.dirname(sources.get(index).get('path'))
conditional_download(download_directory_path, [ invalid_source_url ]) conditional_download(download_directory_path, [ invalid_source_url ])