fix for VIDEO_TS and add .bin handling. Fixes #545

This commit is contained in:
clinton-hall 2014-09-16 21:12:50 +09:30
commit a217e1edf1

View file

@ -10,7 +10,7 @@ import shutil
import re import re
from subprocess import call from subprocess import call
from nzbtomedia import logger from nzbtomedia import logger
from nzbtomedia.nzbToMediaUtil import makeDir from nzbtomedia.nzbToMediaUtil import makeDir, copy_link
def isVideoGood(videofile, status): def isVideoGood(videofile, status):
fileNameExt = os.path.basename(videofile) fileNameExt = os.path.basename(videofile)
@ -476,17 +476,27 @@ def processList(List, newDir, bitbucket):
success = True success = True
for item in List: for item in List:
newfile = None newfile = None
if os.path.splitext(item)[1].lower() == '.iso' and not '.iso' in nzbtomedia.IGNOREEXTENSIONS: ext = os.path.splitext(item)[1].lower()
if ext == '.iso' and not '.iso' in nzbtomedia.IGNOREEXTENSIONS:
logger.debug("Attempting to rip .iso image: %s" % (item), "TRANSCODER") logger.debug("Attempting to rip .iso image: %s" % (item), "TRANSCODER")
temp_list, temp_mounted = ripISO(item, newDir, bitbucket) temp_list, temp_mounted = ripISO(item, newDir, bitbucket)
newList.extend(temp_list) newList.extend(temp_list)
mounted.extend(temp_mounted) mounted.extend(temp_mounted)
remList.append(item) remList.append(item)
elif ext == '.bin' and not '.bin' in nzbtomedia.IGNOREEXTENSIONS:
logger.debug("Attempting to rip .bin image: %s" % (item), "TRANSCODER")
item2 = '%s.iso' % (os.path.splitext(item)[0])
copy_link(item, item2, hard)
temp_list, temp_mounted = ripISO(item2, newDir, bitbucket)
newList.extend(temp_list)
mounted.extend(temp_mounted)
remList.extend([item, item2])
elif re.match(".+VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb]", item) and not '.vob' in nzbtomedia.IGNOREEXTENSIONS: elif re.match(".+VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb]", item) and not '.vob' in nzbtomedia.IGNOREEXTENSIONS:
logger.debug("Found VIDEO_TS image file: %s" % (item), "TRANSCODER") logger.debug("Found VIDEO_TS image file: %s" % (item), "TRANSCODER")
if not vtsPath: if not vtsPath:
try:
vtsPath = re.match(".+VIDEO_TS",item).group() vtsPath = re.match(".+VIDEO_TS",item).group()
if not vtsPath: except:
vtsPath = os.path.split(item)[0] vtsPath = os.path.split(item)[0]
remList.append(item) remList.append(item)
elif re.match(".+VIDEO_TS.", item) or re.match(".+VTS_[0-9][0-9]_[0-9].", item): elif re.match(".+VIDEO_TS.", item) or re.match(".+VTS_[0-9][0-9]_[0-9].", item):