PHPackages                             popstas/transmission-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. popstas/transmission-cli

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

popstas/transmission-cli
========================

Transmission client for automate weburg.net downloads

v0.11.0(7y ago)18962MITPHPPHP &gt;=7.0

Since Jan 10Pushed 7y ago3 watchersCompare

[ Source](https://github.com/popstas/transmission-cli)[ Packagist](https://packagist.org/packages/popstas/transmission-cli)[ RSS](/packages/popstas-transmission-cli/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)DependenciesVersions (27)Used By (0)

Transmission CLI [![Build Status](https://camo.githubusercontent.com/29842961871544fb1b9e6cadafa75f834c36696877c355701094917718a477c0/68747470733a2f2f7472617669732d63692e6f72672f706f70737461732f7472616e736d697373696f6e2d636c692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/popstas/transmission-cli) [![Coverage Status](https://camo.githubusercontent.com/00a0a8f63f44af81eee4af374e1e1cd77995718886160dda2f932f343d21ce0b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f706f70737461732f7472616e736d697373696f6e2d636c692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/popstas/transmission-cli?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/661b92d5e5efc366a927cf7d70f24f19598a8b0aadba171c6ae6b5ca6897a9e1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706f70737461732f7472616e736d697373696f6e2d636c692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/popstas/transmission-cli/?branch=master)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#transmission-cli---)

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

Blog post:

Based on:

- [symfony/console](http://symfony.com/doc/current/components/console/index.html),
- [martial/transmission-api](https://github.com/MartialGeek/transmission-api),
- [leominov/weburg-torrent-grabber](https://github.com/leominov/weburg-torrent-grabber).

Features
========

[](#features)

- send metrics to InfluxDB, torrent monitoring trends with Grafana
- download popular (rating, comment and votes based) movies from
- download tracked series from
- delete not popular uploads from transmission
- working with multiple transmission instances
- command line autocompletion
- add torrents with GET request

Graphics
--------

[](#graphics)

- hourly upload stats by torrent and summary upload
- list all hosts that sends metrics to InfluxDB

[![Screenshot](docs/img/grafana.png?raw=true)](docs/img/grafana.png?raw=true)

Available commands:
===================

[](#available-commands)

- `help` - Displays help for a command
- `list` - List commands
- `torrent-list [--name='series*1080'] [--age='>1 1 0'] [--days=7] [--sort=1] [--limit=10] [--rm]`, `sg` - Get metrics from InfluxDB
- `stats-send`, `ss` - Send metrics to InfluxDB
- `weburg-download [--limit 1]`, `wd` - Download popular torrents and tracked series from weburg.net
- `weburg-download --popular [--movies-url=url]` - Download only popular
- `weburg-download --series` - Download only series
- `weburg-download --query` - Download first result
- `weburg-download [movie url or id]` - Download movie without popularity check
- `weburg-download [series url or id] [--days=1]` - Download series for last x days
- `weburg-series-add`, `wsa` - Add series to monitoring list
- `weburg-info`, `wi` - Test internal weburg parser

#### Global command options

[](#global-command-options)

- `--config` - set path to config file
- `--dry-run` - don't change any data
- `-v|vv|vvv` - more verbose output
- `--transmission-host` - set transmission host
- `--transmission-port` - set transmission port
- `--transmission-user` - set transmission user
- `--transmission-password` - set transmission password

#### HTTP server for add torrents

[](#http-server-for-add-torrents)

```
node scripts/server-torrent-add.js

```

Then you can add torrents via open urls like [http://localhost:10293/?url=http%3A%2F%2Fbt.weburg.net%2Fgettorrent.php%3Fsecuritykey%3D70c3fcb98000761e78ea2b9c8bedd69e%26user\_id%3D151954%26info\_hash%3D9f67aa271026be1ca2d7c6b4a88f9417455d64f5](http://localhost:10293/?url=http%3A%2F%2Fbt.weburg.net%2Fgettorrent.php%3Fsecuritykey%3D70c3fcb98000761e78ea2b9c8bedd69e%26user_id%3D151954%26info_hash%3D9f67aa271026be1ca2d7c6b4a88f9417455d64f5)

You can also add userscript to your browser, scripts/weburg-torrent-add.user.js

Install
=======

[](#install)

### PHAR automatic (Recommended)

[](#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

[](#phar-manually)

Download latest transmission-cli.phar [here](https://github.com/popstas/transmission-cli/releases/latest), make it executable and put it to bin directory.

### Composer global

[](#composer-global)

```
composer global require popstas/transmission-cli

```

If you cannot execute `transmission-cli` after that, probably you should add ~/.config/composer/vendor/bin to your PATH environment variable as described [here](https://akrabat.com/global-installation-of-php-tools-with-composer/).

### Composer from source:

[](#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
=========

[](#configure)

Default config placement: `~/.transmission-cli.yml`. It creates on first run. 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.

You can use `download-filename-whitelist` and `download-filename-blacklist` lists for filter torrents before download.

#### About torrent duplicates

[](#about-torrent-duplicates)

By default, `transmission-cli` prevents send stats to InfluxDB when you have torrents with same names in your Transmission, because it make stats about these torrents wrong. If it not matters for you, you can use `allow-duplicates` option in config. When `allow-duplicates: true` defined in config, transmission-cli will allow to stats-send with duplicates and don't ask to remove duplicates after `torrent-add` command.

#### Transmission

[](#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

[](#influxdb-and-grafana)

You need to install it for drawing torrent graphics.

**InfluxDB**

Simplest way to install InfluxDB - Docker:

```
docker run --name influxdb -d --restart=always \
    -v /Users/popstas/lib/influxdb:/data \
    -p 8083:8083 -p 8086:8086 \
    influxdb

```

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

**Grafana**

1. Run Grafana with Docker

```
docker run --name grafana -d \
    -v /Users/popstas/lib/grafana:/var/lib/grafana \
    -p 3000:3000 \
    -e "GF_SECURITY_ADMIN_USER=admin" \
    -e "GF_SECURITY_ADMIN_PASSWORD=secret" \
    grafana/grafana

```

2. Add InfluxDB as data source "influxdb" to Grafana, choose database "transmission".
3. Import dashboard - [grafana-torrents.json](docs/grafana-torrents.json)

If you don't want to see graphs, Grafana not necessary.

#### [autocompletion](https://github.com/stecman/symfony-console-completion) for bash/zsh:

[](#autocompletion-for-bashzsh)

```
source
