From 91e4616fe1043772e361a302e335db633c01f768 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Tue, 24 Dec 2024 16:40:37 +0100 Subject: [PATCH] Hotfix empty urls --- facefusion/download.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/facefusion/download.py b/facefusion/download.py index 663f9ba4..9d635511 100644 --- a/facefusion/download.py +++ b/facefusion/download.py @@ -72,8 +72,9 @@ def conditional_download_hashes(hashes : DownloadSet) -> bool: for index in hashes: if hashes.get(index).get('path') in invalid_hash_paths: invalid_hash_url = hashes.get(index).get('url') - download_directory_path = os.path.dirname(hashes.get(index).get('path')) - conditional_download(download_directory_path, [ invalid_hash_url ]) + if invalid_hash_url: + download_directory_path = os.path.dirname(hashes.get(index).get('path')) + conditional_download(download_directory_path, [ invalid_hash_url ]) valid_hash_paths, invalid_hash_paths = validate_hash_paths(hash_paths) @@ -98,8 +99,9 @@ def conditional_download_sources(sources : DownloadSet) -> bool: for index in sources: if sources.get(index).get('path') in invalid_source_paths: invalid_source_url = sources.get(index).get('url') - download_directory_path = os.path.dirname(sources.get(index).get('path')) - conditional_download(download_directory_path, [ invalid_source_url ]) + if invalid_source_url: + download_directory_path = os.path.dirname(sources.get(index).get('path')) + conditional_download(download_directory_path, [ invalid_source_url ]) valid_source_paths, invalid_source_paths = validate_source_paths(source_paths)