@ctrl/qbittorrent 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/qbittorrent.d.ts +7 -1
- package/dist/src/qbittorrent.js +13 -0
- package/dist/src/types.d.ts +24 -0
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
2
2
|
import type { Options as GotOptions, Response } from 'got';
|
3
3
|
import type { AddTorrentOptions as NormalizedAddTorrentOptions, AllClientData, NormalizedTorrent, TorrentClient, TorrentSettings } from '@ctrl/shared-torrent';
|
4
|
-
import type { AddMagnetOptions, AddTorrentOptions, BuildInfo, Preferences, Torrent, TorrentCategories, TorrentFile, TorrentFilePriority, TorrentFilters, TorrentPieceState, TorrentProperties, TorrentTrackers, WebSeed } from './types.js';
|
4
|
+
import type { AddMagnetOptions, AddTorrentOptions, BuildInfo, Preferences, Torrent, TorrentCategories, TorrentFile, TorrentFilePriority, TorrentFilters, TorrentPeersResponse, TorrentPieceState, TorrentProperties, TorrentTrackers, WebSeed } from './types.js';
|
5
5
|
export declare class QBittorrent implements TorrentClient {
|
6
6
|
config: TorrentSettings;
|
7
7
|
/**
|
@@ -197,6 +197,12 @@ export declare class QBittorrent implements TorrentClient {
|
|
197
197
|
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#minimal-torrent-priority}
|
198
198
|
*/
|
199
199
|
bottomPriority(hashes: string | string[] | 'all'): Promise<boolean>;
|
200
|
+
/**
|
201
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-peers-data}
|
202
|
+
* @param rid - Response ID. If not provided, rid=0 will be assumed. If the given rid is
|
203
|
+
* different from the one of last server reply, full_update will be true (see the server reply details for more info)
|
204
|
+
*/
|
205
|
+
torrentPeers(hash: string, rid?: number): Promise<TorrentPeersResponse>;
|
200
206
|
/**
|
201
207
|
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#login}
|
202
208
|
*/
|
package/dist/src/qbittorrent.js
CHANGED
@@ -550,6 +550,19 @@ export class QBittorrent {
|
|
550
550
|
await this.request('/torrents/bottomPrio', 'POST', undefined, undefined, params);
|
551
551
|
return true;
|
552
552
|
}
|
553
|
+
/**
|
554
|
+
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-peers-data}
|
555
|
+
* @param rid - Response ID. If not provided, rid=0 will be assumed. If the given rid is
|
556
|
+
* different from the one of last server reply, full_update will be true (see the server reply details for more info)
|
557
|
+
*/
|
558
|
+
async torrentPeers(hash, rid) {
|
559
|
+
const params = { hash };
|
560
|
+
if (rid) {
|
561
|
+
params.rid = rid;
|
562
|
+
}
|
563
|
+
const res = await this.request('/sync/torrentPeers', 'GET', params);
|
564
|
+
return res.body;
|
565
|
+
}
|
553
566
|
/**
|
554
567
|
* {@link https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#login}
|
555
568
|
*/
|
package/dist/src/types.d.ts
CHANGED
@@ -1234,4 +1234,28 @@ export interface Preferences {
|
|
1234
1234
|
*/
|
1235
1235
|
utp_tcp_mixed_mode: number;
|
1236
1236
|
}
|
1237
|
+
export interface TorrentPeersResponse {
|
1238
|
+
full_update: boolean;
|
1239
|
+
peers: Peers;
|
1240
|
+
rid: number;
|
1241
|
+
show_flags: boolean;
|
1242
|
+
}
|
1243
|
+
type Peers = Record<string, TorrentPeer>;
|
1244
|
+
export interface TorrentPeer {
|
1245
|
+
client?: string;
|
1246
|
+
connection?: string;
|
1247
|
+
country?: string;
|
1248
|
+
country_code?: string;
|
1249
|
+
dl_speed?: number;
|
1250
|
+
downloaded?: number;
|
1251
|
+
files?: string;
|
1252
|
+
flags?: string;
|
1253
|
+
flags_desc?: string;
|
1254
|
+
ip?: string;
|
1255
|
+
port?: number;
|
1256
|
+
progress?: number;
|
1257
|
+
relevance?: number;
|
1258
|
+
up_speed?: number;
|
1259
|
+
uploaded?: number;
|
1260
|
+
}
|
1237
1261
|
export {};
|