浏览代码

[options] Accept quoted string across multiple lines (#9940)

Like:

    -f "
    bestvideo+bestaudio/
    best
    "
Jaime Marquínez Ferrándiz 9 年之前
父节点
当前提交
9e29ef13a3
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      youtube_dl/options.py

+ 1 - 3
youtube_dl/options.py

@@ -26,9 +26,7 @@ def parseOpts(overrideArguments=None):
         except IOError:
         except IOError:
             return default  # silently skip if file is not present
             return default  # silently skip if file is not present
         try:
         try:
-            res = []
-            for l in optionf:
-                res += compat_shlex_split(l, comments=True)
+            res = compat_shlex_split(optionf.read(), comments=True)
         finally:
         finally:
             optionf.close()
             optionf.close()
         return res
         return res