opensubtitles-client #nodejs #javascript integration with RTorrent

Oscar Brito


After writing the npm module opensubtitles-client to be able to download subtitles from the command line I felt the need to integrate it with rtorrent. With the following configuration after a torrent is finished, subtitler will try to download subtitles for it.

On .rtorrent.rc add:


system.method.setkey =event.download.finished,movecomplete,"execute=subtitler,$d.getbasepath="

If you want you create a script file with several instructions and tweak subtitler arguments like:

system.method.setkey =event.download.finished,movecomplete,"execute=~/torrentfinish.sh,$d.getbasepath="
and on ~/torrentfinish.sh:

#!/bin/sh

#always download 2 subtitles file in english to torrent and log it
subtitler "$1" -n 2 -lang eng >> /tmp/rtorrentFinish

My life has become so much easier...now I just need to connect my USB hard drive to the tv...

Just a note: RTorrent is running on my raspberry, also with nodejs v0.10.2...

Links:
https://github.com/aetheon/node-opensubtitles-client
https://npmjs.org/package/opensubtitles-client




Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.