Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Deluge

Hierarchy

  • Deluge

Implements

  • TorrentClient

Index

Constructors

constructor

  • new Deluge(options?: Partial<TorrentSettings>): Deluge
  • Parameters

    • options: Partial<TorrentSettings> = {}

    Returns Deluge

Properties

config

config: TorrentSettings

Methods

addLabel

  • addLabel(label: string): Promise<DefaultResponse>
  • Parameters

    • label: string

    Returns Promise<DefaultResponse>

addTorrent

  • addTorrent(torrent: string | Buffer, config?: Partial<AddTorrentOptions>): Promise<AddTorrentResponse>
  • Parameters

    • torrent: string | Buffer
    • config: Partial<AddTorrentOptions> = {}

    Returns Promise<AddTorrentResponse>

addTorrentMagnet

  • addTorrentMagnet(magnet: string, config?: Partial<AddTorrentOptions>): Promise<BooleanStatus>
  • Parameters

    • magnet: string
    • config: Partial<AddTorrentOptions> = {}

    Returns Promise<BooleanStatus>

changePassword

  • changePassword(password: string): Promise<BooleanStatus>
  • Parameters

    • password: string

    Returns Promise<BooleanStatus>

checkSession

  • checkSession(): Promise<boolean>
  • Checks current session is valid

    Returns Promise<boolean>

    true if valid

connect

  • connect(selectedHost?: string, hostIdx?: number): Promise<ListMethods>
  • Connects deluge and returns a list of available methods

    Parameters

    • Optional selectedHost: string
    • hostIdx: number = 0

      index of host to use in result of get hosts

    Returns Promise<ListMethods>

connected

  • connected(): Promise<boolean>
  • Returns Promise<boolean>

disablePlugin

  • disablePlugin(plugins: string[]): Promise<DefaultResponse>
  • Parameters

    • plugins: string[]

    Returns Promise<DefaultResponse>

disconnect

  • disconnect(): Promise<boolean>
  • Disconnects deluge - warning all instances connected to this client will also be disconnected. Other instances may also reconnect. Not really sure why you would want to disconnect

    Returns Promise<boolean>

downloadFromUrl

  • downloadFromUrl(url: string, cookies?: string): Promise<string>
  • Download a torrent from url, pass the result to Deluge.addTorrent

    Parameters

    • url: string
    • cookies: string = ''

    Returns Promise<string>

    file path

enablePlugin

  • enablePlugin(plugins: string[]): Promise<DefaultResponse>
  • Parameters

    • plugins: string[]

    Returns Promise<DefaultResponse>

getAllData

  • getAllData(): Promise<AllClientData>
  • Returns Promise<AllClientData>

getConfig

  • getConfig(): Promise<ConfigResponse>
  • Returns Promise<ConfigResponse>

getHostStatus

  • getHostStatus(host: string): Promise<GetHostStatusResponse>
  • Gets host status

    Parameters

    • host: string

      pass host id from this.getHosts()

    Returns Promise<GetHostStatusResponse>

getHosts

  • getHosts(): Promise<GetHostsResponse>
  • Returns Promise<GetHostsResponse>

getLabels

  • getLabels(): Promise<ListMethods>
  • Returns Promise<ListMethods>

getPluginInfo

  • getPluginInfo(plugins: string[]): Promise<PluginInfo>
  • Parameters

    • plugins: string[]

    Returns Promise<PluginInfo>

getPlugins

  • getPlugins(): Promise<PluginsListResponse>
  • Returns Promise<PluginsListResponse>

getTorrent

  • getTorrent(id: string): Promise<NormalizedTorrent>
  • Parameters

    • id: string

    Returns Promise<NormalizedTorrent>

getTorrentFiles

  • getTorrentFiles(torrentId: string): Promise<TorrentFiles>
  • Get list of files for a torrent

    Parameters

    • torrentId: string

    Returns Promise<TorrentFiles>

getTorrentInfo

  • getTorrentInfo(tmpPath: string): Promise<TorrentInfo>
  • used to get torrent info before adding

    Parameters

    • tmpPath: string

      use path returned from upload torrent looks like '/tmp/delugeweb-DfEsgR/tmpD3rujY.torrent'

    Returns Promise<TorrentInfo>

getTorrentStatus

  • getTorrentStatus(torrentId: string, additionalFields?: string[]): Promise<TorrentStatus>
  • get torrent state/status

    Parameters

    • torrentId: string
    • additionalFields: string[] = []

      fields ex - ['label']

    Returns Promise<TorrentStatus>

getVersion

  • getVersion(): Promise<StringStatus>
  • returns the version ex - 2.0.3-2-201906121747-ubuntu18.04.1

    Returns Promise<StringStatus>

listMethods

  • listMethods(auth?: boolean): Promise<ListMethods>
  • Lists methods

    Parameters

    • auth: boolean = true

      disable or enable auth connection

    Returns Promise<ListMethods>

    a list of method names

listTorrents

  • listTorrents(additionalFields?: string[], filter?: Record<string, string>): Promise<TorrentListResponse>
  • Parameters

    • additionalFields: string[] = []
    • filter: Record<string, string> = {}

    Returns Promise<TorrentListResponse>

login

  • login(): Promise<boolean>
  • Login deluge

    Returns Promise<boolean>

    true if success

logout

  • logout(): Promise<boolean>
  • Logout deluge

    Returns Promise<boolean>

    true if success

normalizedAddTorrent

  • normalizedAddTorrent(torrent: string | Buffer, options?: Partial<AddTorrentOptions>): Promise<NormalizedTorrent>
  • Parameters

    • torrent: string | Buffer
    • options: Partial<AddTorrentOptions> = {}

    Returns Promise<NormalizedTorrent>

pauseTorrent

  • pauseTorrent(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

queueBottom

  • queueBottom(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

queueDown

  • queueDown(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

queueTop

  • queueTop(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

queueUp

  • queueUp(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

removeLabel

  • removeLabel(label: string): Promise<DefaultResponse>
  • Parameters

    • label: string

    Returns Promise<DefaultResponse>

removeTorrent

  • removeTorrent(torrentId: string, removeData?: boolean): Promise<BooleanStatus>
  • Parameters

    • torrentId: string

      torrent id from list torrents

    • removeData: boolean = true

      true will delete all data from disk

    Returns Promise<BooleanStatus>

request

  • request<T>(method: string, params?: any[], needsAuth?: boolean, autoConnect?: boolean): Promise<Response<T>>
  • Type parameters

    • T: object

    Parameters

    • method: string
    • params: any[] = []
    • needsAuth: boolean = true
    • autoConnect: boolean = true

    Returns Promise<Response<T>>

resetSession

  • resetSession(): void
  • Returns void

resumeTorrent

  • resumeTorrent(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

setConfig

  • setConfig(config: Partial<DelugeSettings>): Promise<DefaultResponse>
  • Parameters

    • config: Partial<DelugeSettings>

    Returns Promise<DefaultResponse>

setTorrentLabel

  • setTorrentLabel(torrentId: string, label: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string
    • label: string

    Returns Promise<DefaultResponse>

setTorrentOptions

  • setTorrentOptions(torrentId: string, options?: Partial<TorrentOptions>): Promise<DefaultResponse>
  • Parameters

    • torrentId: string
    • options: Partial<TorrentOptions> = {}

    Returns Promise<DefaultResponse>

setTorrentTrackers

  • setTorrentTrackers(torrentId: string, trackers?: Tracker[]): Promise<DefaultResponse>
  • Parameters

    • torrentId: string
    • trackers: Tracker[] = []

    Returns Promise<DefaultResponse>

updateTorrentTrackers

  • updateTorrentTrackers(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

upload

  • upload(torrent: string | Buffer): Promise<UploadResponse>
  • Parameters

    • torrent: string | Buffer

    Returns Promise<UploadResponse>

verifyTorrent

  • verifyTorrent(torrentId: string): Promise<DefaultResponse>
  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>