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

Using Transmission

Alexander Ryzhov edited this page Jan 18, 2018 · 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 transmission-daemon-openssl 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 added. Script below will help to add more trackers to every new torrent, 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 script /opt/etc/transmission/tr_added.sh with this content:

#!/bin/sh

base_url='https://torrentz2.eu'
pattern='announcelist_[0-9]+'

if [ -z "$TR_TORRENT_HASH" ] ; then
    echo 'This script should be called from transmission-daemon.'
    exit 1
fi

announce_list=`wget --no-check-certificate -qO - ${base_url}/$TR_TORRENT_HASH | grep -Eo "${pattern}"`

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

for tracker in $(wget -qO - ${base_url}/${announce_list}) ; do
  logger -t $(basename $0) "Adding ${tracker} to $TR_TORRENT_NAME"
  transmission-remote -t $TR_TORRENT_HASH -td ${tracker}
done

Make it executable and start transmission again:

chmod +x /opt/etc/transmission/tr_added.sh
opkg install ca-certificates
/opt/etc/init.d/S88transmission start

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

Links