Transmission CLI Build Status Coverage Status Scrutinizer Code Quality

transmission-cli is console php application for automate torrent download/upload from weburg.net

Blog post: http://blog.popstas.ru/blog/2016/01/17/torrent-transmission-client-for-weburg/

Based on:

Features

Graphics

Screenshot

Available commands:

Global command options

Install

PHAR automatic (Recommended)

latest_phar=$(curl -s https://api.github.com/repos/popstas/transmission-cli/releases/latest | grep 'browser_' | cut -d\" -f4)
wget -O /usr/local/bin/transmission-cli "$latest_phar"
chmod +x /usr/local/bin/transmission-cli

PHAR manually

Download latest transmission-cli.phar here, make it executable and put it to bin directory.

Composer global

composer global require popstas/transmission-cli

If you cannot execute transmission-cli after that, probably you should add ~/.composer/vendor/bin to your PATH environment variable as described here.

Composer from source:

git clone https://github.com/popstas/transmission-cli
cd transmission-cli
composer install
ln -s "$PWD"/bin/transmission-cli /usr/local/bin/transmission-cli

Configure

Default config placement: ~/.transmission-cli.yml. It creates on first weburg-series-add command. You can change some parameters here.

Also, you can pass config to command: transmission-cli --config /path/to/config.yml

Commands weburg-download, weburg-series-add, interacts only with weburg.net and not requests to Transmission or InfluxDb.

Transmission

If you want to make commands torrent-* working, you should enable remote access in Transmission and add host, port, username, password if it not defaults.

By default, transmission-cli request to Transmission on localhost:9091 without user and password. You can change it in ~/.transmission-cli.yml.

You can override default config: --transmission-host, --transmission-port, --transmission-user, --transmission-password

Also, maybe you want to automatically download movies, not only torrent files. To do that, enable autodownload in Transmission and point to same directory in --dest= option.

InfluxDB and Grafana

You need to install it for drawing torrent graphics.

InfluxDB

Simplest way to install InfluxDB - Docker:

docker run --name influxdb\
    -d --volume=/Users/popstas/lib/influxdb:/data \
    -p 8083:8083 -p 8086:8086 \
    tutum/influxdb

And if you don't want to see detailed stats about your torrents, you may not install InfluxDB, commands stat-* will not working.

Grafana

Add InfluxDB as data source to Grafana. Then import dashboard - grafana-torrents.json If you don't want to see graphs, Grafana not necessary.

autocompletion for bash/zsh:

source <(transmission-cli _completion --generate-hook)

Cron

Then, add to cron tasks like this:

PATH="$PATH:/usr/local/bin"
59 * * * * transmission-cli torrent-remove-duplicates --transmission-host=localhost
59 * * * * transmission-cli torrent-remove-duplicates --transmission-host=wrtnsq
0  * * * * transmission-cli stats-send --transmission-host=localhost
0  * * * * transmission-cli stats-send --transmission-host=wrtnsq
1  2 * * * transmission-cli weburg-download --download-torrents-dir=/Volumes/media/_planeta/_torrents

Don't forget add to cron PATH your ~/.composer/vendor/bin if you installed transmission-cli with composer global!

Usage

See commands --help.

Contribution

Required checks for pass build:

./vendor/bin/phpcs --standard=psr2 ./src ./tests
phpunit

Chore

conventional-changelog -p angular -i CHANGELOG.md -s 
bin/transmission-cli _docs > docs/commands.md

Recommended

phpmd src/ text codesize,controversial,design,naming,unusedcode