aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2009-04-25 13:30:50 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:24:12 +0100
commitb65740e4741e82e41336f68bca81fb39a2f67ffe (patch)
treeef278314d0561bc632abe60fafbd2fda46dc060a
parenta825f0ca83e1bdb12fc6c88377defdfa28156f78 (diff)
downloadyoutube-dl-b65740e4741e82e41336f68bca81fb39a2f67ffe.tar.xz
Skip blank lines in batch file -- fixes issue #9
-rwxr-xr-xyoutube-dl4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl
index 8764acda0..e20e59bf8 100755
--- a/youtube-dl
+++ b/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