@ctrl/rtorrent
    Preparing search index...

    Interface RTorrentClient

    rTorrent client interface

    interface RTorrentClient {
        config: TorrentClientConfig;
        state: TorrentClientState;
        addTorrent(
            torrent: string | Uint8Array<ArrayBufferLike>,
            options?: any,
        ): Promise<unknown>;
        addTorrentFromFile(
            fileContent: Uint8Array,
            options?: AddTorrentFileOptions,
        ): Promise<boolean>;
        addTorrentFromUrl(
            url: string,
            options?: AddTorrentUrlOptions,
        ): Promise<boolean>;
        addTorrentToView(hash: string, view: string): Promise<boolean>;
        checkHash(hash: string): Promise<boolean>;
        exportState(): TorrentClientState;
        getAllData(): Promise<AllClientData>;
        getAllTorrents(): Promise<RTorrentTorrent[]>;
        getDownloadRateLimit(hash: string): Promise<number>;
        getGlobalDownloadRateLimit(): Promise<number>;
        getGlobalUploadRateLimit(): Promise<number>;
        getSystemInfo(): Promise<RTorrentSystemInfo>;
        getTorrent(id: any): Promise<NormalizedTorrent>;
        getTorrentFiles(hash: string): Promise<RTorrentFile[]>;
        getTorrentPeers(hash: string): Promise<RTorrentPeer[]>;
        getTorrentProperties(hash: string): Promise<Partial<RTorrentTorrent>>;
        getTorrentRaw(hash: string): Promise<RTorrentTorrent | null>;
        getTorrentTrackers(hash: string): Promise<RTorrentTracker[]>;
        getUploadRateLimit(hash: string): Promise<number>;
        getVersion(): Promise<string>;
        getViews(): Promise<RTorrentView[]>;
        hasTorrent(hash: string): Promise<boolean>;
        normalizedAddTorrent(
            torrent: string | Uint8Array<ArrayBuffer>,
            options?: Partial<AddTorrentOptions>,
        ): Promise<NormalizedTorrent>;
        pauseTorrent(hash: string | string[]): Promise<void>;
        queueDown(id: any): Promise<unknown>;
        queueUp(id: any): Promise<unknown>;
        removeTorrent(
            hash: string | string[],
            deleteFiles?: boolean,
        ): Promise<void>;
        removeTorrentFromView(hash: string, view: string): Promise<boolean>;
        resumeTorrent(hash: string | string[]): Promise<void>;
        setFilePriority(
            hash: string,
            index: number,
            priority: RTorrentFilePriority,
        ): Promise<boolean>;
        setGlobalDownloadRateLimit(bytesPerSecond: number): Promise<boolean>;
        setGlobalUploadRateLimit(bytesPerSecond: number): Promise<boolean>;
        setThrottleGroup(
            name: string,
            downKiB?: number,
            upKiB?: number,
        ): Promise<boolean>;
        setTorrentLabel(hash: string, label: string): Promise<boolean>;
        setTorrentPriority(
            hash: string,
            priority: RTorrentPriority,
        ): Promise<boolean>;
        setTorrentThrottle(hash: string, name: string): Promise<boolean>;
        setTrackerEnabled(
            hash: string,
            index: number,
            enabled: boolean,
        ): Promise<boolean>;
        startTorrent(hash: string): Promise<boolean>;
        stopTorrent(hash: string): Promise<boolean>;
    }

    Hierarchy

    • TorrentClient
      • RTorrentClient

    Implemented by

    Index
    config: TorrentClientConfig
    state: TorrentClientState
    • Parameters

      • torrent: string | Uint8Array<ArrayBufferLike>
      • Optionaloptions: any

      Returns Promise<unknown>

    • Export the current state of the client. Can be restored with createFromState.

      Returns TorrentClientState

    • Returns all torrent data. Data has been normalized

      Returns Promise<AllClientData>

    • Throws a TorrentClientError with the torrent_not_found code when the torrent doesn't exist

      Parameters

      • id: any

      Returns Promise<NormalizedTorrent>

    • Parameters

      • torrent: string | Uint8Array<ArrayBuffer>
      • Optionaloptions: Partial<AddTorrentOptions>

      Returns Promise<NormalizedTorrent>

    • Move one or more torrents down the queue, clients resolve with void. Throws torrent_not_found when a torrent doesn't exist, throws when the client has no queue

      Parameters

      • id: any

      Returns Promise<unknown>

    • Move one or more torrents up the queue, clients resolve with void. Throws torrent_not_found when a torrent doesn't exist, throws when the client has no queue

      Parameters

      • id: any

      Returns Promise<unknown>

    • Remove torrent, throws when a torrent doesn't exist. Deleting files is not supported and throws https://github.com/rakshasa/rtorrent/wiki/Commands#erase

      Parameters

      • hash: string | string[]
      • OptionaldeleteFiles: boolean

      Returns Promise<void>