Skip to main content

Various scripts to manage transmission

Project description

A set of scripts and functions to help managing a [Transmission]( instance via its RPC interface.

Included Scripts

Below is a list of the scripts along with simple descriptions of their functionality.

This script will scan active torrents for those which qualify to be removed from the client. This tool reads in the config file and uses the tracker rules definitions defined in there to make decisions as to what to remove.

Currently the most interesting script, it provides a vaguely unix-y shell like interpreter. You can chan commands together similar to using pipes in any standard unix-like shell. Filters and commands are separated by | characters.

The main initial command to use is ls. If you give no arguments it will just list out all torrents, similar to ls on a unix command line listing files.

Some filters available:

  • Filter by name: n=prefix_to_search_for
  • Filter by tracker: t=tracker_key_prefix
  • Filter by status: all, active, downloading, seeding, stopped, finished

Sorting options:

  • Sort by: id, progress, name, size, ratio, total speed, up/dl speed, status, queue position, age
  • Reverse sort

Some Commands available:

  • start: Start all the torrents passed to it.
  • stop: Stop all the torrents passed to it.
  • count: Count the current torrents including filtering.
  • any integer: Using any positive integer will limit torrent results to that value.
  • print: print the results in a simple list

Example Syntax and Usage

List torrents filtering by those starting with fred and additionally also active.:

(TS@> ls | n=fred | active
[548] Freddie Gibbs - 2013 - ESGN 18% 0.0 [downloading]
[549] Freddie Gibbs - 2012 - Baby Face Killa (CD) [FLAC] 10% 0.0 [downloading]
[550] Freddie Gibbs - Cold Day In Hell [FLAC] 8% 0.0 [downloading]

Stop all torrents starting with fred.:

(TS@> ls | n=fred | stop
> Stopping 3 torrents.

Start all torrents stopped torrents:

(TS@> ls | stopped | start
> Starting 5 torrents.

Get a total count of torrents registered within the client.:

(TS@> ls | count

An example of limiting output to a specific number of lines, In this case 5.:

(TS@> ls | 5 | count

Counting the number of torrents using the btn tracker.:

(TS@> ls | t=btn | c

Running commands without invoking the REPL prompt. All commands from the REPL interface are supported:

$ --exec "ls|age|r|5"
[667] [DEF] Snowden.2016.720p.BluRay.x264 2% ra: 0.0 up: 0.0 kB/s dn: 95.0 kB/s [downloading]
[666] [BTN] Saturday.Night.Live.S42E10.Casey.Affleck.720p.HDTV 100% ra: 0.0513 up: 16.0 kB/s dn: 0.0 kB/s [seeding]
[665] [BTN] 100% ra: 0.0961 up: 0.0 kB/s dn: 0.0 kB/s [seeding]
[664] [BTN] The.Last.Leg.S09E10.720p.HDTV.mkv 100% ra: 0.1106 up: 0.0 kB/s dn: 0.0 kB/s [seeding]
[663] [BTN] Stephen.Colbert.2016.12.14.Neil.Patrick.Harris.720p 100% ra: 0.1875 up: 0.0 kB/s dn: 0.0 kB/s [seeding]

Filtering by time comparisons. This example shows all torrents that are less than 10 hours old. The time arguments come in 3 parts. The operator (< or >), the duration, a positive integer, and a unit, one of [mhdwMY] which are listed below.

  • m = Minutes
  • h = Hours
  • d = Days
  • w = Weeks
  • M = Months
  • Y = Years

Limiting to torrents less than 10 hours old.:

(TS@> ls | time=<10h
[665] [BTN] [100%/424.1 MB] ra: 0.0961 up: 0.0 kB/s dn: 0.0 kB/s [seeding]
[666] [BTN] Saturday.Night.Live.S42E10.Casey.Affleck.720p.HDTV.x264-BRISK.mkv [100%/1.7 GB] ra: 0.0684 up: 0.0 kB/s dn: 0.0 kB/s [seeding]
[667] [DEF] Snowden.2016.720p.BluRay.x264-SPARKS [100%/7.1 GB] ra: 0.0132 up: 0.0 kB/s dn: 0.0 kB/s [seeding]

Filter to torrents with a age of less than a day, limiting output to 2 results.:

(TS@> ls|time=<1d | 2
[659] [BTN] The.Twilight.Zone.1959.S01.720p.BluRay.x264-aAF [100%/42.2 GB] ra: 0.0 up: 0.0 kB/s dn: 0.0 kB/s [seeding]
[660] [BTN] The.Twilight.Zone.1960.S02.720p.BluRay.x264-aAF [100%/34.0 GB] ra: 0.0 up: 0.0 kB/s dn: 0.0 kB/s [seeding]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (14.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page