This script allows you to add new tasks to a transmission torrent client on router. It uses official python Dropbox SDK.
Please note, it requires a new Entware repository to work.
0. Install Dropbox API from my repo
Code:
$ opkg install python-dropbox
1. Download script, attached to post
Code:
$ wget -O /opt/tmp/tmp.gz http://www.wl500g.info/attachment.php?attachmentid=8666&d=1330436107
$ gzip -cd /opt/tmp/tmp.gz > /opt/bin/DropboxTorrentsWatch.py
$ chmod +x /opt/bin/DropboxTorrentsWatch.py
$ rm /opt/tmp/tmp.gz
2. Create access key for DropboxTorrentsWatch.py script
Log on to dropbox.com, proceed here, and create a new application with a unique name. Dropbox.com assigns APP_KEY, APP_SECRET pair to your application, please, write down those pair in appropriate script lines.
3.Authorize DropboxTorrentsWatch.py
Dropbox uses OAuth. You have seen this on other sites, it sound like "Logon using Facebook" or "Logon using Google account". Please, run script with "-s" key:
Code:
$ DropboxTorrentsWatch.py -s
Script offers you an URL, so copy it to browser. If all goes well, you will see this message. Press "Allow", go back to the router console and hit enter.
4.Allow transmission to use watchdir feature
Make sure transmission is not running and edit settings.json:
Code:
$ grep -E "watch|trash" /opt/etc/transmission/settings.json
"trash-original-torrent-files": true,
"watch-dir": "/opt/etc/transmission/watchdir",
"watch-dir-enabled": true
5.Last check
And make sure that REMOTE_DIR, LOCAL_DIR vars in script points to chosen Dropbox folder and to transmission watchdir folder.
Better run this script from cron, mine runs every five minutes.
Script checks your Dropbox folder, downloads new torrent files from here and gives it to transmission.
A sign that everything works well is disappearing of original torrent-files from the DropBox folder. This means router "took" them to work.