aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-05 05:24:50 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-05 05:24:50 +0100
commitc774b3c696b92d0e23f3c59849b8406aa26812c8 (patch)
tree71118673cdb491a4dd16fbed784e078f1dff57ed /youtube_dl
parent3e34db31708e4ec6b936f9d09357319bf06f2c44 (diff)
Make sure URLs are always character strings (Fixes #2051)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 26c1f0e74..6fb35faad 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -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()