From 8271226a55bd3daa7eddfe2efc243892de02ccf4 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 21 Feb 2013 17:09:39 +0100 Subject: Fix --match-title and --reject-title decoding (Closes #690) --- youtube_dl/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index e6ce028d6..95bd94843 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -420,6 +420,14 @@ def encodeFilename(s): encoding = 'utf-8' return s.encode(encoding, 'ignore') +def decodeOption(optval): + if optval is None: + return optval + if isinstance(optval, bytes): + optval = optval.decode(preferredencoding()) + + assert isinstance(optval, compat_str) + return optval class ExtractorError(Exception): """Error during info extraction.""" -- cgit v1.2.3