Fix --match-title and --reject-title decoding (Closes #690)
This commit is contained in:
parent
1013186a17
commit
8271226a55
3 changed files with 11 additions and 4 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue