aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/common.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 23:08:18 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 23:32:22 +0530
commit0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51 (patch)
tree2f65da99909dbcd7cf732d711ac8a918674c1f63 /yt_dlp/downloader/common.py
parentce0593ef61a3da2ac296a8e791bbb0c6e356c05a (diff)
downloadhypervideo-pre-0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51.tar.lz
hypervideo-pre-0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51.tar.xz
hypervideo-pre-0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51.zip
Do not prevent download if locking is unsupported
Closes #3022 Failure to lock download-archive is still fatal. This is consistent with youtube-dl's behavior
Diffstat (limited to 'yt_dlp/downloader/common.py')
-rw-r--r--yt_dlp/downloader/common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py
index afd2f2e38..cbfea7a65 100644
--- a/yt_dlp/downloader/common.py
+++ b/yt_dlp/downloader/common.py
@@ -11,6 +11,7 @@ from ..utils import (
encodeFilename,
error_to_compat_str,
format_bytes,
+ LockingUnsupportedError,
sanitize_open,
shell_quote,
timeconvert,
@@ -234,7 +235,10 @@ class FileDownloader(object):
@wrap_file_access('open', fatal=True)
def sanitize_open(self, filename, open_mode):
- return sanitize_open(filename, open_mode)
+ f, filename = sanitize_open(filename, open_mode)
+ if not getattr(f, 'locked', None):
+ self.write_debug(f'{LockingUnsupportedError.msg}. Proceeding without locking', only_once=True)
+ return f, filename
@wrap_file_access('remove')
def try_remove(self, filename):