aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZirro <code@zirro.se>2021-11-23 01:40:53 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-11-23 01:41:49 +0530
commit0e6b018a10e751bc6da59cdf5d55e61cdf975efa (patch)
tree6b97af6ed5b1e389e1737569a35bcf2f123f226c
parentf7b558df4d76fae77a5bbac62364195891673738 (diff)
downloadhypervideo-pre-0e6b018a10e751bc6da59cdf5d55e61cdf975efa.tar.lz
hypervideo-pre-0e6b018a10e751bc6da59cdf5d55e61cdf975efa.tar.xz
hypervideo-pre-0e6b018a10e751bc6da59cdf5d55e61cdf975efa.zip
Ensure path for link files exists (#1755)
Authored by: Zirro
-rw-r--r--yt_dlp/YoutubeDL.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index fb7e12624..5c2d64598 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2690,6 +2690,8 @@ class YoutubeDL(object):
self.report_error('Cannot write internet shortcut file because the "webpage_url" field is missing in the media information')
return False
linkfn = replace_extension(self.prepare_filename(info_dict, 'link'), link_type, info_dict.get('ext'))
+ if not self._ensure_dir_exists(encodeFilename(linkfn)):
+ return False
if self.params.get('overwrites', True) and os.path.exists(encodeFilename(linkfn)):
self.to_screen(f'[info] Internet shortcut (.{link_type}) is already present')
return True