Hierarchy

  • TransmissionClient

Implements

Constructors

Methods

  • Adds a magnet to the Transmission RPC endpoint

    Parameters

    Returns Promise<{
        hashString: string;
        id: number;
        name: string;
    }>

    The info of the torrent that was added

    Example

    client.addMagnet({
    magnet: 'magnet-link',
    downloadDir: '/path/to/download/dir',
    pause: true,
    });

    When downloadDir is not specified, Transmission will use the default download directory as specified in the Transmission daemon's settings.

    By default torrent will be added in a started state, to add it in a paused state, set paused to true.

  • Fetch the lists of recently active torrents from the Transmission RPC

    The method returns two lists of torrents, the first called removed contains the ids of torrents that were removed, the second called torrents contains the info of the torrents that were added or updated.

    Parameters

    Returns Promise<GetRecentlyActiveTorrentsOutput>

    The lists of recently active torrents

    Example

    const recentlyActiveTorrents = await client.getRecentlyActiveTorrents();
    

    When getting torrents you can also select which fields you want to receive by passing in a list of fields:

    Example

    const torrents = await client.getRecentlyActiveTorrents({
    fields: ['id', 'name', 'status'],
    });

    If no fields are specified, all fields will be returned. For a full list of fields see AllTorrentFields.

  • Gets the current Transmission session, which includes the information about the Transmission server and the current session.

    Returns Promise<{
        alt-speed-down: number;
        alt-speed-enabled: boolean;
        alt-speed-time-begin: number;
        alt-speed-time-day: number;
        alt-speed-time-enabled: boolean;
        alt-speed-time-end: number;
        alt-speed-up: number;
        blocklist-enabled: boolean;
        blocklist-size: number;
        blocklist-url: string;
        cache-size-mb: number;
        config-dir: string;
        dht-enabled: boolean;
        download-dir: string;
        download-dir-free-space: number;
        download-queue-enabled: boolean;
        download-queue-size: number;
        encryption: string;
        idle-seeding-limit: number;
        idle-seeding-limit-enabled: boolean;
        incomplete-dir: string;
        incomplete-dir-enabled: boolean;
        lpd-enabled: boolean;
        peer-limit-global: number;
        peer-limit-per-torrent: number;
        peer-port: number;
        peer-port-random-on-start: boolean;
        pex-enabled: boolean;
        port-forwarding-enabled: boolean;
        queue-stalled-enabled: boolean;
        queue-stalled-minutes: number;
        rename-partial-files: boolean;
        rpc-version: number;
        rpc-version-minimum: number;
        script-torrent-done-enabled: boolean;
        script-torrent-done-filename: string;
        seed-queue-enabled: boolean;
        seed-queue-size: number;
        seedRatioLimit: number;
        seedRatioLimited: boolean;
        session-id: string;
        speed-limit-down: number;
        speed-limit-down-enabled: boolean;
        speed-limit-up: number;
        speed-limit-up-enabled: boolean;
        start-added-torrents: boolean;
        trash-original-torrent-files: boolean;
        units: { 'memory-bytes': number; 'memory-units': string[]; 'size-bytes': number; 'size-units': string[]; 'speed-bytes': number; 'speed-units': string[]; };
        utp-enabled: boolean;
        version: string;
    }>

    The current Transmission session

  • Gets a list of torrents from the Transmission RPC endpoint

    If no ids are specified, all torrents will be returned.

    Parameters

    Returns Promise<{
        activityDate?: number;
        addedDate?: number;
        comment?: string;
        corruptEver?: number;
        creator?: string;
        desiredAvailable?: number;
        doneDate?: number;
        downloadDir?: string;
        downloadLimit?: number;
        downloadLimited?: boolean;
        downloadedEver?: number;
        error?: number;
        errorString?: string;
        eta?: number;
        etaIdle?: number;
        fileStats?: ({ bytesCompleted: number; priority: number; wanted: boolean; })[];
        files?: ({ name: string; length: number; bytesCompleted: number; })[];
        hashString?: string;
        haveUnchecked?: number;
        haveValid?: number;
        honorsSessionLimits?: boolean;
        id: number;
        isFinished?: boolean;
        isPrivate?: boolean;
        isStalled?: boolean;
        labels?: unknown[];
        leftUntilDone?: number;
        magnetLink?: string;
        manualAnnounceTime?: number;
        maxConnectedPeers?: number;
        metadataPercentComplete?: number;
        name?: string;
        peer-limit?: number;
        peers?: unknown[];
        peersConnected?: number;
        peersFrom?: { fromCache: number; fromDht: number; fromIncoming: number; fromLpd: number; fromLtep: number; fromPex: number; fromTracker: number; };
        peersGettingFromUs?: number;
        peersSendingToUs?: number;
        percentDone?: number;
        priorities?: number[];
        queuePosition?: number;
        rateDownload?: number;
        rateUpload?: number;
        recheckProgress?: number;
        secondsDownloading?: number;
        secondsSeeding?: number;
        seedIdleLimit?: number;
        seedRatioLimit?: number;
        seedRatioMode?: number;
        sizeWhenDone?: number;
        status?: "STOPPED" | "QUEUED_CHECK" | "CHECKING" | "QUEUED_DOWNLOAD" | "DOWNLOADING" | "QUEUED_SEED" | "SEEDING";
        totalSize?: number;
        trackers?: ({ id: number; announce: string; scrape: string; tier: number; })[];
        uploadRatio?: number;
        uploadedEver?: number;
        wanted?: number[];
        webseeds?: string[];
        webseedsSendingToUs?: number;
    }[]>

    A list of torrents from the Transmission RPC endpoint

    Example

    // List all torrents currently in Transmission
    const torrents = await client.getTorrents();
    // List torrents with ids 1 and 2
    const torrents = await client.getTorrents({
    ids: [1, 2],
    });

    When getting torrents you can also select which fields you want to receive by passing in a list of fields:

    Example

    const torrents = await client.getTorrents({
    fields: ['id', 'name', 'status'],
    });

    If no fields are specified, all fields will be returned. For a full list of fields see AllTorrentFields.

  • Pings the Transmission RPC endpoint to ensure it is available. If the endpoint is not available or the response is not as expected, an error is thrown.

    Returns Promise<void>

  • Remove one or more torrents from the Transmission RPC endpoint

    You can remove torrents by addressing them by their id:

    Parameters

    Returns Promise<void>

    Example

    // Remove torrent with id 1
    await client.removeTorrents({
    ids: 1,
    });
    // Remove torrents with ids 1 and 2
    await client.removeTorrents({
    ids: [1, 2],
    });
    // Remove torrent and delete downloaded data
    await client.removeTorrents({
    ids: 1,
    deleteLocalData: true,
    });

    When removing torrents you can also set the deleteLocalData option to true to delete the downloaded data.

  • Starts one or more torrents on the Transmission RPC endpoint

    You can start torrents by addressing them by their id:

    Parameters

    Returns Promise<void>

    Example

    // Start torrent with id 1
    await client.startTorrents({
    ids: 1,
    });
    // Start torrents with ids 1 and 2
    await client.startTorrents({
    ids: [1, 2],
    });

    Optionally you can also start the torrents immediately by setting the now option to true.

    If no ids are specified, all torrents will be started.

  • Stops one or more torrents on the Transmission RPC endpoint

    You can stop torrents by addressing them by their id:

    Parameters

    Returns Promise<void>

    Example

    // Stop torrent with id 1
    await client.stopTorrents({
    ids: 1,
    });
    // Stop torrents with ids 1 and 2
    await client.stopTorrents({
    ids: [1, 2],
    });

    If no ids are specified, all torrents will be stopped.

Generated using TypeDoc