Skip to content
This repository was archived by the owner on Mar 17, 2018. It is now read-only.

Using Transmission

Alexander Ryzhov edited this page Mar 4, 2016 · 16 revisions

Introduction

There is several BitTorrent clients, provided by Entware: btpd, deluge, rtorrent, but Transmission is most popular of them.

Requirements

Optionally, you can open ports on your device to simplify connection between peers:

iptables -I INPUT -p tcp --destination-port 51413 -j ACCEPT
iptables -I INPUT -p udp --destination-port 51413 -j ACCEPT

Installation

opkg install transmission-web nano

Create the data directories (adjust as desired):

mkdir /opt/Torrent/
mkdir /opt/Torrent/Incomplete
mkdir /opt/Torrent/Watch
mkdir /opt/Torrent/Completed

Make sure Transmission isn't already running, then edit its configuration:

/opt/etc/init.d/S88transmission stop
nano -w /opt/etc/transmission/settings.json

You will want to adjust the following paths:

"download-dir": "/opt/Torrent/Completed",
"watch-dir": "/opt/Torrent/Watch",
"incomplete-dir": "/opt/Torrent/Incomplete",

It's also recommended to password-protect the Web UI. Set the following parameters:

"rpc-authentication-required": true,
"rpc-username": "admin",
"rpc-password": "yourpassword",

Your password will be hashed the first time Transmission runs, so it's safe to enter it as clear text there.

Using Transmission

Everything is now configured. You can manually start it immediately (it will automatically start at boot time):

/opt/etc/init.d/S88transmission start

Access it through

http://<Your device IP>:9091/transmission 

Adding more trackers

Since 2.90, we've implemented a script execution right after torrent started. Script below will help to add trackers to new torrents, it can be handy when there's no peers on main tracker. Stop transmission:

/opt/etc/init.d/S88transmission stop

Add following strings to `/opt/etc/transmission/settings.json':

"script-torrent-added-enabled": true,
"script-torrent-added-filename": "/opt/etc/transmission/tr_added.sh",

Make new /opt/etc/transmission/tr_added.sh with this content:

#!/bin/sh

base_url='http://torrentz.eu'
pattern='announcelist_[0-9]+'

if [ -z "$logger -t $(basename $0) " ] ; then
    echo 'This script should be called from transmission-daemon.'
    exit 1
fi

announce_list=`curl -s ${base_url}/$TR_TORRENT_HASH | grep -Eo "${pattern}"`

if [ -z "$announce_list" ] ; then
    logger -t $(basename $0) 'No additional trackers found, sorry.'
    exit 1
fi

for tracker in $(curl -s ${base_url}/${announce_list})
do
  logger logger -t $(basename $0) "Adding ${tracker} to torrent $TR_TORRENT_HASH"
  transmission-remote -t $TR_TORRENT_HASH -td ${tracker}
done

Make it executable and start transmission again:

chmod +x /opt/etc/transmission/tr_added.sh
/opt/etc/init.d/S88transmission start

Check syslog after adding new torrent too see what trackers was added.

Links

Clone this wiki locally