Rename Movies and TV Shows Using Filebot on Ubuntu 14.03 LTS
We need to initially install the pre-requisites using these commands –
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
Then we can download the Filebot installer itself.
Once Downloaded we can install it using the below command –
sudo gdebi filebot_4.7_amd64.deb
Because we installed this using the root account (sudo) we will need to change the permissions on the install directory to the user account we created. In my case this was the user called simply ‘User’.
We can complete this by running this command –
sudo chown -R $USER:$USER ~/.filebot/
When I set this up previously I come across a script in the Filebot community called ‘amc’ this basically will automatically rename all Movies and TV Shows and move them in to relevant folders. We need to create a ‘file’ that includes the below commands. The easiest way to do this is to use WinSCP to connect to the host and right click and select ‘New’ –> ‘File’ then type in the below. You will need to change the Input and Output location as below. Change the ‘Renamed Files’ to the directory you require the completed files to be moved in to and change the ‘Non-Renamed Files’ in to the directory that you currently have the files you want to rename.
filebot -script fn:amc –output “/media/Renamed Files” –action move -non-strict “/media/Non-Renamed Files” –def excludeList=amc.txt
We now have a script that we can run, but to take this further I have created a schedule that will run this script every 30 minutes. The amc.txt is automatically created by the software which basically lists the movies/tv shows that it has already re-named so that it doesn’t keep trying to rename files that are already complete.
To configure this I have created a file called ‘Filebot’ in the /media Directory. You will need to edit the following file by typing
sudo crontab -e and then typing in the below –
*/30 * * * * /media/filebot
This will run the script automatically every 30 minutes.
To save this file you will need to press CTRL + X and then Y. (On Windows via Putty)
You may notice I also have a chmod script that will change the permissions on this directory. I have this so it will automatically re-change the permissions after the rename has been completed. This is a simple script as below –
chmod -R 777 /media/LOCATION
Note – I recommend these scripts are not used in production and only in a Home Lab environment.