asahi417 commited on
Commit
9217cd8
·
1 Parent(s): 9050d55
Files changed (1) hide show
  1. download_audio.py +2 -1
download_audio.py CHANGED
@@ -31,7 +31,8 @@ def wget(url: str, cache_dir: str, filename: Optional[str] = None):
31
  urllib.request.urlretrieve(url, output_file)
32
  except (ConnectionError, KeyboardInterrupt, HTTPError):
33
  traceback.print_exc()
34
- os.remove(output_file)
 
35
  return False
36
 
37
  if output_file.endswith('.tar.gz') or output_file.endswith('.tgz') or output_file.endswith('.tar'):
 
31
  urllib.request.urlretrieve(url, output_file)
32
  except (ConnectionError, KeyboardInterrupt, HTTPError):
33
  traceback.print_exc()
34
+ if os.path.exists(output_file):
35
+ os.remove(output_file)
36
  return False
37
 
38
  if output_file.endswith('.tar.gz') or output_file.endswith('.tgz') or output_file.endswith('.tar'):