浏览代码

Expand user's home in batch file path.

Kevin Deldycke 9 年之前
父节点
当前提交
e2eca6f65e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      youtube_dl/__init__.py

+ 3 - 1
youtube_dl/__init__.py

@@ -86,7 +86,9 @@ def _real_main(argv=None):
             if opts.batchfile == '-':
                 batchfd = sys.stdin
             else:
-                batchfd = io.open(opts.batchfile, 'r', encoding='utf-8', errors='ignore')
+                batchfd = io.open(
+                    compat_expanduser(opts.batchfile),
+                    'r', encoding='utf-8', errors='ignore')
             batch_urls = read_batch_urls(batchfd)
             if opts.verbose:
                 write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')