From 328ad85d21cf9e8d4035ed3b4cce12e25fc17168 Mon Sep 17 00:00:00 2001 From: rouggy Date: Wed, 26 Jan 2022 18:42:49 +0700 Subject: [PATCH] update --- filebot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/filebot.py b/filebot.py index d20f064..8461205 100644 --- a/filebot.py +++ b/filebot.py @@ -10,7 +10,7 @@ import re source_path = Path('/mnt/Download/finished/') dest_path = '/mnt/Download/PostProcess/' -section_folders = ['4K-Movies', '4K-Series', 'Movies', 'Series', ''] +section_folders = ['4K-Movies', '4K-Series', 'Movies', 'Series'] # source_path = 'C:/Test/finished' # dest_path = "C:/Test/PostProcess" @@ -27,8 +27,10 @@ for root, dirs, files in os.walk(source_path): print("Deleting rar, sfv, nfo files...") for root, dirs, files in os.walk(source_path): for dir in dirs: + if re.search('sample', dir, re.IGNORECASE) or re.search('proof', dir, re.IGNORECASE): + shutil.rmtree(dir) for file in files: - if re.search(r'\.r\d{2,3}', file) or file.endswith('.rar') or file.endswith('.sfv') or file.endswith('.nfo'): + if re.search(r'\.r\d{2,3}', file) or file.endswith('.rar') or file.endswith('.sfv') or file.endswith('.nfo') or re.search('sample', file, re.IGNORECASE): os.remove(os.path.join(root, file)) for root, dirs, files in os.walk(source_path):