mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-06-05 22:09:18 +02:00 
			
		
		
		
	Skip blank lines in batch file -- fixes issue #9
This commit is contained in:
		| @@ -997,7 +997,9 @@ if __name__ == '__main__': | |||||||
| 		batchurls = [] | 		batchurls = [] | ||||||
| 		if opts.batchfile is not None: | 		if opts.batchfile is not None: | ||||||
| 			try: | 			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: | 			except IOError: | ||||||
| 				sys.exit(u'ERROR: batch file could not be read') | 				sys.exit(u'ERROR: batch file could not be read') | ||||||
| 		all_urls = batchurls + args | 		all_urls = batchurls + args | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user