浏览代码

Skip blank lines in batch file -- fixes issue #9

Ricardo Garcia 16 年之前
父节点
当前提交
b65740e474
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      youtube-dl

+ 3 - 1
youtube-dl

@@ -997,7 +997,9 @@ if __name__ == '__main__':
 		batchurls = []
 		if opts.batchfile is not None:
 			try:
-				batchurls = [line.strip() for line in open(opts.batchfile, 'r')]
+				batchurls = open(opts.batchfile, 'r').readlines()
+				batchurls = [x.strip() for x in batchurls]
+				batchurls = [x for x in batchurls if len(x) > 0]
 			except IOError:
 				sys.exit(u'ERROR: batch file could not be read')
 		all_urls = batchurls + args