diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 864ca54b..a5758aa6 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -98,7 +98,8 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): except: Logger.exception("MAIN: Failed to link file: %s", file) elif fileExtension in compressedContainer: - if re.search(r'\d+', os.path.splitext(fileName)[1]) and os.path.dirname(filePath) in extracted_folder: # find part numbers in second "extension" from right, if we have more than 1 compressed file in the same directory. + # find part numbers in second "extension" from right, if we have more than 1 compressed file in the same directory. + if re.search(r'\d+', os.path.splitext(fileName)[1]) and os.path.dirname(filePath) in extracted_folder and not (os.path.splitext(fileName)[1] in ['.720p','.1080p']): part = int(re.search(r'\d+', os.path.splitext(fileName)[1]).group()) if part == 1: # we only want to extract the primary part. Logger.debug("MAIN: Found primary part of a multi-part archive %s. Extracting", file)