[TOOL] Batch Operations Manager

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Wirly
Posts: 9
Joined: 10 Aug 2020, 01:08

[TOOL] Batch Operations Manager

Post by Wirly »

Hey guys,

I wanted a way to run multiple AMC configurations from the command line. I also wanted it to repeat every X minutes. Basically, I wanted to monitor multiple download folders, each with their own AMC configurations. Since I don't run AMC using my torrent client (which would normally pass specific options to AMC depending on the type of download), being able to specify to AMC what it should expect to find in each download folder (Anime series folder, non-anime series, movies, etc) makes matching a lot more accurate.

To meet my needs, and so that I could easily/flexibly update the AMC settings, I wrote this python script which will pass any number of .txt files to FileBot. Each .txt file is read by FileBot using the built-in option and then run. I then put this inside a loop, so if you specify a sleep-time then the program will stay alive and run every X seconds (Disabled by default). Each time it finishes its sleep-timer, it re-scans the folder for any new/edited .txt files, as-well as an updated sleep-time. That means you don't have to stop/start the program everytime you make a change to your .txt files. Start the program once and forget about it! Optionally, you can add it to your list of start-up programs so that it starts monitoring as soon as your computer turns on.

If you don't have python, don't want to install it, or if you're like me and want to keep things portable, I've also compiled the script into a stand-alone .exe (which has the added benefit of being easy to find in the Task Manager).

When running this script using the .exe or as a .pyw, there is NO indication of its status or that its running
Refer to the FileBot logs for updates (or setup AMC's pushBullet/pushover options). To kill the program, use Task Manager or change the sleep-time to 0. If you change the sleep time to 0 then the next time the program finishes its countdown, it will detect the change and safely exit. This is the best approach to avoid accidentaly killing the program in the middle of a scan.

BatchOperations
Source Code

Code: Select all

Run all FileBot argument .txt files in '_BatchOperations_' folder (https://www.filebot.net/forums/viewtopic.php?f=4&t=3244)
 
1) Place this script (or .exe) in the same folder as 'filebot.exe'
2) Run it to create the '_BatchOperations_' directory and a '.repeat' file
3) Add .txt files to the '_BatchOperations_' folder, each containing valid FileBot arguments (Refer to link above).
4) Run this script again and it will scan the '_BatchOperations_' folder and run FileBot once for each .txt file found.
 
* Optional: Automatically repeat the operation
    0 == Repeat disabled (Default)
    If you'd like to re-run the filebot commands every X seconds, you can change the '0' in the '.repeat' file, 
    which is inside the '_BatchOperations_' folder. Changing the value to anything >0 (numbers only) will enable repeats every X second.
    * If using this script as a .pyw or .exe, then you'll have to use TaskManager to kill the program
Post Reply