Skip to content

The only downloader you need. 下载器的集大成者。

fix: replace segment file on Windows (#744)

Suliman Abdulrazzaq80a6ade0e9d2
diff --git a/features/bili_pack/task.py b/features/bili_pack/task.py
index 0ddd4fb7..195ff02e 100644
--- a/features/bili_pack/task.py
+++ b/features/bili_pack/task.py
@@ -377,7 +377,7 @@ class BilibiliMergeStep(FFmpegStep):
f.write(header)
with open(path, "rb") as seg:
shutil.copyfileobj(seg, f)
- tmp.rename(path)
+ tmp.replace(path)
hasVideo = self._videoPath.exists()
hasAudio = self._audioPath.exists()
diff --git a/features/yt_dlp_pack/task.py b/features/yt_dlp_pack/task.py
index f7a9621e..f6eae4f8 100644
--- a/features/yt_dlp_pack/task.py
+++ b/features/yt_dlp_pack/task.py
@@ -594,7 +594,7 @@ class YouTubeMergeStep(FFmpegStep):
f.write(header)
with open(path, "rb") as seg:
shutil.copyfileobj(seg, f)
- tmp.rename(path)
+ tmp.replace(path)
hasVideo = self._videoPath.exists()
hasAudio = self._audioPath.exists()