1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

subtitle: only convert when its unicode

This commit is contained in:
Johan Andersson 2015-09-20 16:03:07 +02:00
parent b05d5922e0
commit 79c7f82881

View File

@ -134,6 +134,8 @@ class subtitle(object):
data = text.group(1)
recomp = re.compile(r'\r')
text = bad_char.sub('-', recomp.sub('', subs)).replace('"', '"')
if is_py2 and isinstance(text, unicode):
return text.encode("utf-8")
return text
def wrst(self, subdata):