A script to automate the process of renaming and moving files from one directory to another, including creation of a subdirectory for files that are episodic in nature. The particular use case this was designed for is preparing files for use with a Plex media server.
This simple script is designed to be used with Deluge. It may also function with another torrenting client that supports automatically running scripts after completion; however, they would need to function similary to Deluge by providing the torrent name as ARGV[1]
and the download path as ARGV[2]
.
After cloning this repository, enable the Execute plugin in Deluge and set the path to torrent_post_processor.rb
as the command to be run in the 'Torrent Complete' event.
There are 3 options within the code that you may wish to alter:
FILE_SEPARATOR
- the character used to separate the name of the torrent- Default is
'.'
- Default is
JOIN_CHARACTER
- the character used to re-join the relevant portions of the name- Default is
' '
- Default is
@final_destination
- the absolute path of desired destination to move the file(s)- Default is the download path supplied by Deluge
Navigate to the repository's directory and
$ bundle install
then
$ rspec