Make sure URLs are always character strings (Fixes #2051)
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 5 Jan 2014 04:24:50 +0000 (05:24 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 5 Jan 2014 04:24:50 +0000 (05:24 +0100)
youtube_dl/__init__.py

index 26c1f0e74b71b2d407b2803c932d789c5880d249..6fb35faadea319857b11fe5c44a0e988830d89c6 100644 (file)
@@ -522,6 +522,8 @@ def _real_main(argv=None):
             sys.exit(u'ERROR: batch file could not be read')
     all_urls = batchurls + args
     all_urls = [url.strip() for url in all_urls]
+    _enc = preferredencoding()
+    all_urls = [url.decode(_enc, 'ignore') if isinstance(url, bytes) else url]
 
     extractors = gen_extractors()