Using Automator to make your life with Transmission easier

I have two computers: a Macbook with Snow Leopard, that sometimes I carry with me, and a computer at home with an Atom processor and running Linux that is my media server and downloader. If I need to download something that will take too much time, I put this second computer to download: it has a good connection and it’s always online.

It has Transmission running with its great web interface activated. If I need to download some torrent file, I open its web interface and upload the .torrent file. Good, but… it could be easier.

If you download torrent files very often, the easiest way is to use the watch-dir feature from Transmission: every torrent that you put at some directory is automatically downloaded by Transmission. So, all I needed to do was copying the torrent files from my Macbook to my home server, using SFTP.

To configure your Transmission watch-dir, you must stop the Transmission service (I’m running the transmission-daemon version) and edit the settings.json file, inserting the following settings:

[sourcecode language=”js”]
"watch-dir": "/home/mediaserver/transmission/watch",
"watch-dir-enabled": true
[/sourcecode]

Remember: you must stop Transmission service, edit the file and start it again!

It works, but… It can be even easier, I thought. And I remembered of Automator, a good piece of software that comes with Snow Leopard, and that I knew but never used before.

The idea was: every time a new .torrent file is written at my laptop’s download directory, it should be copied to my home server.

So I opened Automator and created a new Folder Action:

At the top of the new workflow, I selected my Downloads folder:

 The next step in our flow is to create a script to copy our files via SSH to the computer that’s running Transmission. Use Utilities -> Run Shell Script to make it:

Now add the following content as the script’s source code. To make it work automatically, I allow my SSH server to receive connections using keys, not passwords. Don’t forget to change the scp’s destination to your computer’s host and directory:

[sourcecode language=”bash”]
for f in "$@"
do
ext=`basename "$f" | awk -F "." ‘{ print $NF }’`
if [ "$ext" == "torrent" ]; then
scp "$f" root@myhostname.asdf.com:/home/transmission/watch
fi
done
[/sourcecode]

That’s it! Save your workflow and test it. Now, every time you click at a torrent file and download it, Transmission will download it automatically.

6 thoughts on “Using Automator to make your life with Transmission easier”

  1. Wow! Such a great trick for download torrent. Sometimes I face this problem but now I can realise from it. Thanks a lot for sharing this tricks with us. I hope people will be benefited by reading this post.

  2. The new way of the using this automated this is looking a good one. From the side of the information as you write about that this is looking very nice. People will enjoy allot while sharing the different opinions about this.

  3. It looks great to download torrents. I am tired of using proxies and other advertisements software to download torrent. But by using shell script i think it's so easy to download torrent file. I use microleaves Dedicated proxies to download torrents file but i think it is very helpful.

  4. 人気の売れ筋商品を多数取り揃えております。全て激安特価でご提供.お願いします.
    迅速、確実にお客様の手元にお届け致します。
    実物写真、付属品を完備しております。
    低価格を提供すると共に、品質を絶対保証しております。
    商品の交換と返品ができます。
    ブランドコピーバッグの誠実と信用の店
    24時間以内に出荷し、3~4日に到着して、

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.