From a4697fbf59b1f10f9fb02768f7b9d2eff2401448 Mon Sep 17 00:00:00 2001 From: rouggy Date: Wed, 26 Jan 2022 17:52:58 +0700 Subject: [PATCH] update --- filebot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/filebot.py b/filebot.py index ed88aba..c9054cc 100644 --- a/filebot.py +++ b/filebot.py @@ -8,6 +8,7 @@ import re source_path = Path('/mnt/Download/finished/') dest_path = '/mnt/Download/PostProcess/' +print("Checking if rar files and unraring...") for root, dirs, files in os.walk(source_path): for dir in dirs: for file in files: @@ -15,12 +16,13 @@ for root, dirs, files in os.walk(source_path): if rar_file: subprocess.run(["/usr/bin/unrar", 'e', rar_file[0], '-idq', '']) +print("Deleting rar, sfv, nfo files...") for root, dirs, files in os.walk(source_path): for dir in dirs: 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'): os.remove(os.path.join(root, file)) - +print(f"Moving files from {source_path} to {dest_path}") for src_folder in source_path.iterdir(): shutil.move(src_folder, dest_path) \ No newline at end of file