From 5ce9cc79c893fd2cf07b6b00a5ec18ee7dc7d55d Mon Sep 17 00:00:00 2001 From: panni Date: Sun, 7 Jan 2018 06:33:44 +0100 Subject: [PATCH] remove crap from filename: also remove brackets inside release group --- Contents/Libraries/Shared/subliminal_patch/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Contents/Libraries/Shared/subliminal_patch/core.py b/Contents/Libraries/Shared/subliminal_patch/core.py index 04df5199..8b5737ca 100644 --- a/Contents/Libraries/Shared/subliminal_patch/core.py +++ b/Contents/Libraries/Shared/subliminal_patch/core.py @@ -40,8 +40,9 @@ INCLUDE_EXOTIC_SUBS = True DOWNLOAD_TRIES = 0 DOWNLOAD_RETRY_SLEEP = 6 -REMOVE_CRAP_FROM_FILENAME = re.compile(r"(?i)[\s_-]+(obfuscated|scrambled|nzbgeek|chamele0n" - r"|buymore|xpost|postbot|asrequested)(\.\w+|$)$") +# fixme: this may be overkill +REMOVE_CRAP_FROM_FILENAME = re.compile(r"(?i)((?:[\s_-]+(?:obfuscated|scrambled|nzbgeek|chamele0n|buymore|xpost" + r"|postbot|asrequested))?(?:(?<=(?=[\s_-]*.+?))\[.*?\])?)(?:\.\w+|$)$") SUBTITLE_EXTENSIONS = ('.srt', '.sub', '.smi', '.txt', '.ssa', '.ass', '.mpl', '.vtt')