Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Deluge

Hierarchy

  • Deluge

Implements

  • TorrentClient

Index

Constructors

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

    • options: Partial<TorrentSettings> = {}

    Returns Deluge

Properties

config: TorrentSettings

Methods

  • Parameters

    • label: string

    Returns Promise<DefaultResponse>

  • Parameters

    • password: string

    Returns Promise<BooleanStatus>

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

    Returns Promise<boolean>

    true if valid

  • 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(): Promise<boolean>
  • Returns Promise<boolean>

  • Parameters

    • plugins: string[]

    Returns Promise<DefaultResponse>

  • 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(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

  • Parameters

    • plugins: string[]

    Returns Promise<DefaultResponse>

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

  • Gets host status

    Parameters

    • host: string

      pass host id from this.getHosts()

    Returns Promise<GetHostStatusResponse>

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

    • plugins: string[]

    Returns Promise<PluginInfo>

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

    • id: string

    Returns Promise<NormalizedTorrent>

  • Get list of files for a torrent

    Parameters

    • torrentId: string

    Returns Promise<TorrentFiles>

  • 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(torrentId: string, additionalFields?: string[]): Promise<TorrentStatus>
  • get torrent state/status

    Parameters

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

      fields ex - ['label']

    Returns Promise<TorrentStatus>

  • returns the version ex - 2.0.3-2-201906121747-ubuntu18.04.1

    Returns Promise<StringStatus>

  • Lists methods

    Parameters

    • auth: boolean = true

      disable or enable auth connection

    Returns Promise<ListMethods>

    a list of method names

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

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

    Returns Promise<TorrentListResponse>

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

    Returns Promise<boolean>

    true if success

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

    Returns Promise<boolean>

    true if success

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

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

    Returns Promise<NormalizedTorrent>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • label: string

    Returns Promise<DefaultResponse>

  • 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<T>(method: string, params?: any[], needsAuth?: boolean, autoConnect?: boolean): Promise<Response<T>>
  • Type Parameters

    • T extends object

    Parameters

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

    Returns Promise<Response<T>>

  • resetSession(): void
  • Returns void

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

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

    • torrentId: string
    • label: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>

  • Parameters

    • torrent: string | Buffer

    Returns Promise<UploadResponse>

  • Parameters

    • torrentId: string

    Returns Promise<DefaultResponse>