From 32b3f2cb5621abf8d6415a6e81178cb301d1b50c Mon Sep 17 00:00:00 2001 From: XiaoLu-Ling <77573768+XiaoLu-Ling@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:29:17 +0800 Subject: [PATCH] fix File xxx already exists --- scripts/Sound.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Sound.py b/scripts/Sound.py index f5acef0..0c91f29 100644 --- a/scripts/Sound.py +++ b/scripts/Sound.py @@ -34,7 +34,7 @@ def download_file(name: str, hash: str): nameCheck = re.compile(f'{realFileName.split(".")[0]}.+?m4a') checked = check_file(nameCheck, dirName) - if not os.path.isfile(name) and checked is None: + if not os.path.isfile(name) and checked is False: print(f'Downloading {name}...') r = requests.get(f'{Constants.SOUND_URL}/{hash[:2]}/{hash}').content with open(name, 'wb') as f: @@ -129,4 +129,4 @@ def sound() -> None: if __name__ == '__main__': - sound() \ No newline at end of file + sound()