aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/fragment.py
diff options
context:
space:
mode:
authorEmanuel Hoogeveen <55082669+ehoogeveen-medweb@users.noreply.github.com>2022-03-03 15:33:32 +0100
committerGitHub <noreply@github.com>2022-03-03 06:33:32 -0800
commit45806d44a7bc96dc0199410fec81cdce6015a546 (patch)
tree02ece02e5e4874e27c099f504a6b532cb10c7a52 /yt_dlp/downloader/fragment.py
parent747c0bd127ebd205278d31ec7216ffa02fe96734 (diff)
downloadhypervideo-pre-45806d44a7bc96dc0199410fec81cdce6015a546.tar.lz
hypervideo-pre-45806d44a7bc96dc0199410fec81cdce6015a546.tar.xz
hypervideo-pre-45806d44a7bc96dc0199410fec81cdce6015a546.zip
[downloader] Obey `--file-access-retries` when deleting/renaming (#2224)
Authored by: ehoogeveen-medweb
Diffstat (limited to 'yt_dlp/downloader/fragment.py')
-rw-r--r--yt_dlp/downloader/fragment.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py
index 83a9f81b6..95fb2f9e7 100644
--- a/yt_dlp/downloader/fragment.py
+++ b/yt_dlp/downloader/fragment.py
@@ -159,7 +159,7 @@ class FragmentFD(FileDownloader):
if self.__do_ytdl_file(ctx):
self._write_ytdl_file(ctx)
if not self.params.get('keep_fragments', False):
- os.remove(encodeFilename(ctx['fragment_filename_sanitized']))
+ self.try_remove(encodeFilename(ctx['fragment_filename_sanitized']))
del ctx['fragment_filename_sanitized']
def _prepare_frag_download(self, ctx):
@@ -305,7 +305,7 @@ class FragmentFD(FileDownloader):
if self.__do_ytdl_file(ctx):
ytdl_filename = encodeFilename(self.ytdl_filename(ctx['filename']))
if os.path.isfile(ytdl_filename):
- os.remove(ytdl_filename)
+ self.try_remove(ytdl_filename)
elapsed = time.time() - ctx['started']
if ctx['tmpfilename'] == '-':