Skip to content

Commit

Permalink
Fix FileExistsError on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Dec 16, 2024
1 parent 569828b commit 387c9bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/onthespot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def run(self):
if self.gui:
self.progress.emit(item, self.tr("Decrypting"), 99)

decrypted_temp_file_path = temp_file_path + '1.m4a'
decrypted_temp_file_path = temp_file_path + '.m4a'
subprocess.run(
[
config.get('_ffmpeg_bin_path'),
Expand All @@ -441,6 +441,8 @@ def run(self):
],
check=True
)
if os.path.exists(temp_file_path):
os.remove(temp_file_path)
os.rename(decrypted_temp_file_path, temp_file_path)

except RuntimeError as e:
Expand Down

0 comments on commit 387c9bc

Please sign in to comment.