Like the everyone else who uses µTorrent for Mac in these parts, I wanted to make it super self-service. Sadly, the Mac client doesn't support the essential feature "µTorrent -> Run Program -> Run this program when torrent finishes".
So I used launchd to automate it. launchd is the OS X replacement for cron and I wanted to try to go with the flow. launchd will initiate filebot every time a file is modified in your finished torrents directory.
Step 1) In order for this to work, you MUST configure µTorrent to "Move completed downloads to:" some other location, a location that you only use for handing off torrents to filebot and AMC. Otherwise, the script will get run constantly on partially-downloaded files, wasting a ton of resources and failing to move your files. Find this option in µTorrent -> Preferences under the "Directories" section.
Step 2) Work out a command to do exactly what you want with your files in this new location. I recommend starting with the canonical sticky post for AMC in this forum which suggests
Code: Select all
filebot -script fn:amc --output "/path/to/output" --log-file amc.log --action copy -non-strict "/path/to/input" --def excludeList=amc.txt
Step 3) Customize the following configuration file to match your preferences and torrent file locations. Again, your various .log files and amc.txt files MUST NOT go in your new "Move completed downloads to:" directory because that would trigger an endless loop. AMC will run when a file is modified in the directory, and then it will modify a file in that directory, etc forever.
Note that escaping arguments in this xml file is done completely differently than it is done on the command line. Anything that would have been enclosed in double quotes is not instead enclosed in <string></string> tags. This is better if you're using quotes inside your command line, but much worse if you are using xml entities in your command line. I haven't tried testing how that works out. Best of luck.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.proustfulness.filebotfortorrents</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/filebot</string>
<string>-script</string>
<string>fn:amc</string>
<string>--output</string>
<string>/Volumes/TwentyQuestions</string>
<string>--log-file</string>
<string>/Volumes/TwentyQuestions/amc.log</string>
<string>--action</string>
<string>move</string>
<string>-non-strict</string>
<string>/Volumes/TwentyQuestions/Done Torrents/</string>
<string>--def</string>
<string>excludeList=/Volumes/TwentyQuestions/amc.txt</string>
<string>deleteAfterExtract=y</string>
<string>seriesFormat=/Volumes/TwentyQuestions/Television/{n}/{'S'+s}/{n} - {s00e00} - {t}</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Volumes/TwentyQuestions/Done Torrents</string>
</array>
<key>StandardOutPath</key>
<string>/Volumes/TwentyQuestions/filebot.log</string>
<key>WorkingDirectory</key>
<string>/Volumes/TwentyQuestions</string>
<key>StandardErrorPath</key>
<string>/Volumes/TwentyQuestions/filebot.log</string>
<key>SoftResourceLimits</key>
<dict>
<key>Core</key>
<integer>9223372036854775807</integer>
</dict>
<key>HardResourceLimits</key>
<dict>
<key>Core</key>
<integer>9223372036854775807</integer>
</dict>
</dict>
</plist>
Step 4) Configurations for launchd go into ~/Library/LaunchAgents so save that file to a path like this: /Users/proustfan/Library/LaunchAgents/org.proustfulness.filebotfortorrents.plist.
Step 5) Your launchd files will get parsed and used every time you log in, but while you're still testing it you can use
Code: Select all
launchctl load /Users/proustfan/Library/LaunchAgents/org.proustfulness.filebotfortorrents.plist
Code: Select all
launchctl unload /Users/proustfan/Library/LaunchAgents/org.proustfulness.filebotfortorrents.plist
This is working pretty excellently for me. My only gripes so far:
- When I tried using the "clean" option in filebot, it trashed all the music in my done torrents directory. I naively hoped that it would ignore the music and leave it in place since I didn't tell it to do music renaming.
- When I re-download the same file a second time (because my friend wanted to watch something I'd already seen) it got ignored by amc.txt. I naively hoped that amc.txt only ignored files it copied or couldn't handle, not all the files it's _moved_.
Love,
Proustfan