Bekijk de volledige versie : [HowTo] Use Dropbox to download torrents on router

28-02-2012, 14:35
This script allows you to add new tasks to a transmission torrent client on router. It uses official python Dropbox SDK (https://www2.dropbox.com/developers/reference/sdk).
Please note, it requires a new Entware repository (http://www.wl500g.info/showthread.php?t=28778) to work.

0. Install Dropbox API from my repo

$ opkg install python-dropbox

1. Download script, attached to post

$ 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 (https://www2.dropbox.com/developers/apps), 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 (http://en.wikipedia.org/wiki/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:

$ DropboxTorrentsWatch.py -s
Script offers you an URL, so copy it to browser. If all goes well, you will see this (http://vispyanskiy.name/im/wp_plugin_backup_to_dropbox_allow.png) 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:

$ 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.

13-01-2013, 10:54
Thank you very much, its working. But [howto] not full. Lamers cant understand what need to do :)