All Projects → grantholle → transmission

grantholle / transmission

Licence: MIT license
Interacts with Transmission with Node and promises 😚

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to transmission

tdpt
Torrent downloading progress on Telegram
Stars: ✭ 32 (+52.38%)
Mutual labels:  transmission, torrents
Monitorrent
Automatic torrents downloader
Stars: ✭ 383 (+1723.81%)
Mutual labels:  transmission, torrents
Transmissionrpc
Golang bindings for Transmission RPC API
Stars: ✭ 35 (+66.67%)
Mutual labels:  transmission, torrents
Torque
🚂 A TUI client for transmission written in pure bash.
Stars: ✭ 169 (+704.76%)
Mutual labels:  transmission
Tremc
Curses interface for transmission
Stars: ✭ 174 (+728.57%)
Mutual labels:  transmission
transmission
Go wrapper for the transmission API
Stars: ✭ 34 (+61.9%)
Mutual labels:  transmission
p2p-audio-and-video-transmission-system
基于P2P的无线音视频传输系统
Stars: ✭ 29 (+38.1%)
Mutual labels:  transmission
Flood
A web UI for rTorrent, qBittorrent and Transmission with a Node.js backend and React frontend. Migrate to v4: https://github.com/jesec/flood/wiki/Migrate-from-older-versions-of-Flood.
Stars: ✭ 1,795 (+8447.62%)
Mutual labels:  transmission
Addarr
Telegram Bot for adding series/movies to Sonarr/Radarr or for changing the download speed of Transmission/Sabnzbd
Stars: ✭ 150 (+614.29%)
Mutual labels:  transmission
transmitter
A WebExtension for the Transmission BitTorrent client
Stars: ✭ 72 (+242.86%)
Mutual labels:  transmission
1337x
✖️ Unofficial API of 1337x.to
Stars: ✭ 78 (+271.43%)
Mutual labels:  torrents
Transgui
🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
Stars: ✭ 2,488 (+11747.62%)
Mutual labels:  transmission
docker-transmission-skip-hash-check
Transmission client with skip hash check and other features
Stars: ✭ 25 (+19.05%)
Mutual labels:  transmission
Peardownloader.js
一个支持多协议、多源、混合P2P-CDN的下载器
Stars: ✭ 170 (+709.52%)
Mutual labels:  transmission
exatorrent
Easy to Use Torrent Client. Can be hosted in Cloud. Files can be streamed in Browser/Media Player.
Stars: ✭ 1,557 (+7314.29%)
Mutual labels:  transmission
Media Docker
all-in-one deployment and configuration for an all-in-one media server, running on docker.
Stars: ✭ 148 (+604.76%)
Mutual labels:  transmission
IMDb-Scout-Mod
Auto search for movie/series on torrent, usenet, ddl, subtitles, streaming, predb and other sites. Adds links to IMDb pages from hundreds various sites. Adds movies/series to Radarr/Sonarr. Adds external ratings from Metacritic, Rotten Tomatoes, Letterboxd, Douban, Allocine. Media Server indicators for Plex, Jellyfin, Emby. Dark theme/style for …
Stars: ✭ 177 (+742.86%)
Mutual labels:  torrents
Alloy
Alloy physical shader framework for Unity.
Stars: ✭ 244 (+1061.9%)
Mutual labels:  transmission
Docker Transmission Openvpn
Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
Stars: ✭ 2,748 (+12985.71%)
Mutual labels:  transmission
FAVITES
FAVITES (FrAmework for VIral Transmission and Evolution Simulation)
Stars: ✭ 33 (+57.14%)
Mutual labels:  transmission

transmission-promise

A transmission-daemon wrapper using promises.

This was adapted from FLYBYME's node-transmission (transmission package on npm). It contains the same functionality, but is an es6 class and it uses promises instead of callbacks.

Installation

npm i --save transmission-promise

Initialization

const Transmission = require('transmission-promise')
const transmission = new Transmission({
  host: 'localhost', // default 'localhost'
  port: 9091, // default 9091
  username: 'username', // default blank
  password: 'password', // default blank
  ssl: true, // default false use https
  url: '/my/other/url', // default '/transmission/rpc'
})

Definition

Status

RPC returns torrent status with an integer from 0 to 7.

Use transmission.status to check the status with a human-readable variable.

transmission.status = {
  STOPPED       : 0,  // Torrent is stopped
  CHECK_WAIT    : 1,  // Queued to check files
  CHECK         : 2,  // Checking files
  DOWNLOAD_WAIT : 3,  // Queued to download
  DOWNLOAD      : 4,  // Downloading
  SEED_WAIT     : 5,  // Queued to seed
  SEED          : 6,  // Seeding
  ISOLATED      : 7   // Torrent can't find peers
}

Functions

Functions that have an ids parameter can usually be passed either a single integer or an array of integers.

The add functions take a second options parameter that would be the arguments passed to Transmission. For example, if you want to set the download directory of the torrent you would pass in "download-dir": "/my/path". See the rpc-spec for more information.

option key           | value type & description
---------------------+-------------------------------------------------
"cookies"            | string      pointer to a string of one or more cookies.
"download-dir"       | string      path to download the torrent to
"filename"           | string      filename or URL of the .torrent file
"metainfo"           | string      base64-encoded .torrent content
"paused"             | boolean     if true, don't start the torrent
"peer-limit"         | number      maximum number of peers
"bandwidthPriority"  | number      torrent's bandwidth tr_priority_t
"files-wanted"       | array       indices of file(s) to download
"files-unwanted"     | array       indices of file(s) to not download
"priority-high"      | array       indices of high-priority file(s)
"priority-low"       | array       indices of low-priority file(s)
"priority-normal"    | array       indices of normal-priority file(s)

addFile(filePath, options = {})

Add torrents to Transmission using a torrent file.

// With just the path
transmission.addFile('path').then(res => ...)

// Include additional options
transmission.addFile('path', {
  'download-dir': '/a/path/different/than/my/settings'
}).then(res => ...)

addUrl(url, options = {})

Alias: add()

Add torrents to Transmission via a magnet link or a url to a torrent file.

transmission.addUrl('url').then(res => ...)

transmission.add('url', options).then(res => ...)

addBase64(string, options = {})

Adds a torrent with a base64 encoded string of a torrent file contents.

transmission.addBase64(myString, options).then(res => ...)

set(ids)

Set a torrent's properties. See the spec for valid options.

transmission.set(id, options).then(() => ...)

You must provide one or more ids. According to the spec, transmission will not respond with a success argument, only an error.

remove(ids, deleteLocalData = false)

Remove torrents. Remove local data by passing true as the second argument.

// Removes the torrent, but keeps local data
transmission.remove(ids).then(res => ...)

// Removes the torrent and downloaded data
transmission.remove(ids, true).then(res => ...)

active()

List of active torrents.

transmission.active().then(res => ...)

get(ids, fields = [])

Gets torrent information. If ids is falsy, it will get all the torrents. The fields array is the desired fields from the spec. By default it will be retrieve all fields.

// A selection of torrents (one or many)
transmission.get(ids).then(res => {
  for (const torrent of res.torrents) {
    //
  }
})

// All torrents and only the upload ratio
transmission.get(false, ['uploadRatio']).then(res => {
  for (const torrent of res.torrents) {
    // torrent.uploadRatio
  }
})

// Get all torrents and remove it if status is stopped.
transmission.get().then(res => {
  for (const torrent of res.torrents) {
    if (torrent.status === transmission.status.STOPPED) {
      transmission.remove(torrent.id).then(() => {
        console.log(`${torrent.name} removed!`)
      })
    }
  }
}).catch(err => console.error(err))

waitForState(id, targetState)

Polls the server and waits for the target state.

State options: STOPPED, CHECK_WAIT, CHECK, DOWNLOAD_WAIT, DOWNLOAD, SEED_WAIT, SEED, ISOLATED

transmission.waitForState(id, 'DOWNLOAD').then(res => {
  // Torrent is downloading!
})

stop(ids)

Stop working torrents.

// Stops a selection of torrents
transmission.stop(ids).then(res => ...)

// Stops all torrents
transmission.stop().then(res => ...)
// or
transmission.stopAll().then(res => ...)

start(ids)

Start working torrents.

// Starts a selection of torrents
transmission.start(ids).then(res => ...)

// Starts all torrents
transmission.start().then(res => ...)
// or
transmission.startAll().then(res => ...)

startNow(ids)

Bypass the download queue, start working torrents immediately.

transmission.startNow(ids).then(res => ...)

verify(ids)

Verify torrent data.

transmission.verify(id).then(res => ...)

rename(ids, path, name)

Renames a file or folder in a torrent. The path argument is the current relative file path that you get from the file information of get(), and name is the new name.

// Get the file information first
transmission.get(id, ['files']).then(res => {
  // Assume it's just one torrent...
  const torrent = res.torrents[0]

  // Iterate over the files
  // Renames all the files to something new
  for (const file of torrent.files) {
    const newName = makeNewName()

    transmission.rename(torrent.id, file.name, newName)
  }

  // Changes the torrent directory name
  const p = require('path')
  const directory = p.dirname(torrent.files[0])

  transmission.rename(torrent.id, directory, makeNewName())
})

reannounce(ids)

Reannounce to the tracker, ask for more peers.

transmission.reannounce(ids).then(res => ...)

session()

Get client session infomation.

transmission.session().then(res => ...)

session(options)

Set session infomation. See the spec for possible options.

transmission.session({ 'download-dir':'/my/path' }).then(res => ...)

sessionStats()

Get client session stats. See the spec for results.

transmission.sessionStat().then(res => ...)

freeSpace(path)

Get free space available on the server for the specified directory.

transmission.freeSpace(path).then(res => ...)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].