From 0199804d81574b3b8b9c916df749c7af613e69fb Mon Sep 17 00:00:00 2001 From: rouggy Date: Wed, 26 Jan 2022 17:13:42 +0700 Subject: [PATCH] first commit --- filebot.py | 14 ++++++++++++++ requirements.txt | 0 2 files changed, 14 insertions(+) create mode 100644 filebot.py create mode 100644 requirements.txt diff --git a/filebot.py b/filebot.py new file mode 100644 index 0000000..fee0bee --- /dev/null +++ b/filebot.py @@ -0,0 +1,14 @@ +from glob import glob +import shutil +import os + + +rar_file = glob(f"{os.path.join(rls.ContentPath, '')}*rar") +if rar_file: + # Now verify that unrar is installed + unrar_sys_package = '/usr/bin/unrar' + if os.path.isfile(unrar_sys_package): + console.print("Found rar files, extracting the files now", style="bold red") + + # run the system package unrar and save the extracted file to its parent dir + subprocess.run([unrar_sys_package, 'e', rar_file[0], '-idq', rls.ContentPath]) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29