From ee738764c108085be64dc69d150b29d12e5aecd9 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Mon, 13 Feb 2017 20:27:00 +1030 Subject: [PATCH] use basestring to match unicode path in transcoder. --- core/transcoder/transcoder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/transcoder/transcoder.py b/core/transcoder/transcoder.py index 977fbe54..67b4fe39 100644 --- a/core/transcoder/transcoder.py +++ b/core/transcoder/transcoder.py @@ -115,7 +115,7 @@ def getVideoDetails(videofile, img=None, bitbucket=None): def buildCommands(file, newDir, movieName, bitbucket): - if isinstance(file, str): + if isinstance(file, basestring): inputFile = file if '"concat:' in file: file = file.split('|')[0].replace('concat:', '') @@ -613,7 +613,7 @@ def processList(List, newDir, bitbucket): if combine: newList.extend(combineCD(combine)) for file in newList: - if isinstance(file, str) and 'concat:' not in file and not os.path.isfile(file): + if isinstance(file, basestring) and 'concat:' not in file and not os.path.isfile(file): success = False break if success and newList: @@ -748,13 +748,13 @@ def Transcode_directory(dirName): return 1, dirName for file in List: - if isinstance(file, str) and os.path.splitext(file)[1] in core.IGNOREEXTENSIONS: + if isinstance(file, basestring) and os.path.splitext(file)[1] in core.IGNOREEXTENSIONS: continue command = buildCommands(file, newDir, movieName, bitbucket) newfilePath = command[-1] # transcoding files may remove the original file, so make sure to extract subtitles first - if core.SEXTRACT and isinstance(file, str): + if core.SEXTRACT and isinstance(file, basestring): extract_subs(file, newfilePath, bitbucket) try: # Try to remove the file that we're transcoding to just in case. (ffmpeg will return an error if it already exists for some reason) @@ -769,7 +769,7 @@ def Transcode_directory(dirName): print_cmd(command) result = 1 # set result to failed in case call fails. try: - if isinstance(file, str): + if isinstance(file, basestring): proc = subprocess.Popen(command, stdout=bitbucket, stderr=bitbucket) else: img, data = iteritems(file).next() @@ -784,7 +784,7 @@ def Transcode_directory(dirName): except: logger.error("Transcoding of video {0} has failed".format(newfilePath)) - if core.SUBSDIR and result == 0 and isinstance(file, str): + if core.SUBSDIR and result == 0 and isinstance(file, basestring): for sub in get_subs(file): name = os.path.splitext(os.path.split(file)[1])[0] subname = os.path.split(sub)[1]