mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-14 01:02:55 -07:00
use basestring to match unicode path in transcoder.
This commit is contained in:
parent
d34e06e42b
commit
ee738764c1
1 changed files with 6 additions and 6 deletions
|
@ -115,7 +115,7 @@ def getVideoDetails(videofile, img=None, bitbucket=None):
|
||||||
|
|
||||||
|
|
||||||
def buildCommands(file, newDir, movieName, bitbucket):
|
def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
if isinstance(file, str):
|
if isinstance(file, basestring):
|
||||||
inputFile = file
|
inputFile = file
|
||||||
if '"concat:' in file:
|
if '"concat:' in file:
|
||||||
file = file.split('|')[0].replace('concat:', '')
|
file = file.split('|')[0].replace('concat:', '')
|
||||||
|
@ -613,7 +613,7 @@ def processList(List, newDir, bitbucket):
|
||||||
if combine:
|
if combine:
|
||||||
newList.extend(combineCD(combine))
|
newList.extend(combineCD(combine))
|
||||||
for file in newList:
|
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
|
success = False
|
||||||
break
|
break
|
||||||
if success and newList:
|
if success and newList:
|
||||||
|
@ -748,13 +748,13 @@ def Transcode_directory(dirName):
|
||||||
return 1, dirName
|
return 1, dirName
|
||||||
|
|
||||||
for file in List:
|
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
|
continue
|
||||||
command = buildCommands(file, newDir, movieName, bitbucket)
|
command = buildCommands(file, newDir, movieName, bitbucket)
|
||||||
newfilePath = command[-1]
|
newfilePath = command[-1]
|
||||||
|
|
||||||
# transcoding files may remove the original file, so make sure to extract subtitles first
|
# 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)
|
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)
|
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)
|
print_cmd(command)
|
||||||
result = 1 # set result to failed in case call fails.
|
result = 1 # set result to failed in case call fails.
|
||||||
try:
|
try:
|
||||||
if isinstance(file, str):
|
if isinstance(file, basestring):
|
||||||
proc = subprocess.Popen(command, stdout=bitbucket, stderr=bitbucket)
|
proc = subprocess.Popen(command, stdout=bitbucket, stderr=bitbucket)
|
||||||
else:
|
else:
|
||||||
img, data = iteritems(file).next()
|
img, data = iteritems(file).next()
|
||||||
|
@ -784,7 +784,7 @@ def Transcode_directory(dirName):
|
||||||
except:
|
except:
|
||||||
logger.error("Transcoding of video {0} has failed".format(newfilePath))
|
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):
|
for sub in get_subs(file):
|
||||||
name = os.path.splitext(os.path.split(file)[1])[0]
|
name = os.path.splitext(os.path.split(file)[1])[0]
|
||||||
subname = os.path.split(sub)[1]
|
subname = os.path.split(sub)[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue