瀏覽代碼

[YoutubeDL] Sanitize path before creating non-existent paths (Closes #4324)

Sergey M․ 10 年之前
父節點
當前提交
e5a11a2293
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/YoutubeDL.py

+ 1 - 1
youtube_dl/YoutubeDL.py

@@ -1262,7 +1262,7 @@ class YoutubeDL(object):
             return
             return
 
 
         try:
         try:
-            dn = os.path.dirname(encodeFilename(filename))
+            dn = os.path.dirname(sanitize_path(encodeFilename(filename)))
             if dn and not os.path.exists(dn):
             if dn and not os.path.exists(dn):
                 os.makedirs(dn)
                 os.makedirs(dn)
         except (OSError, IOError) as err:
         except (OSError, IOError) as err: