class

QBittorrent::Api::Transfer

Inherits Reference < Object

The transfer endpoint group (/api/v2/transfer/, see ext/api-map.md §2.4): global transfer statistics, the alternative-speed-limits toggle, the global download/upload rate limits and peer banning.

Built on the Client request helpers; construct it with a client:

transfer = QBittorrent::Api::Transfer.new(client)
transfer.info.dht_nodes # => 67
transfer.download_limit # => 0 (unlimited)
transfer.set_download_limit(1_048_576_i64)

Constructors

new(client : Client)
Source

Instance methods

ban_peers(peers : String) : Nil

POST transfer/banPeers — ban one or more peers. peers is a string of host:port items separated by | (e.g. "1.2.3.4:6881|5.6.7.8:51413").

Source
ban_peers(peers : Array(String)) : Nil

POST transfer/banPeers — ban one or more peers. peers is a string of host:port items separated by | (e.g. "1.2.3.4:6881|5.6.7.8:51413").

Overload taking host:port items as an array; they are joined with |.

Source
download_limit

GET transfer/downloadLimit — global download rate limit in bytes/s (0 = unlimited).

Source
info

GET transfer/info — global transfer statistics as a TransferInfo.

Source
set_download_limit(limit : Int64) : Nil

POST transfer/setDownloadLimit — set the global download rate limit, limit in bytes/s (0 = unlimited). ameba:disable Naming/AccessorMethodName

Source
set_speed_limits_mode(enabled : Bool) : Nil

POST transfer/setSpeedLimitsMode — explicitly set the alternative speed limits (true = on, false = off). qB 5.x explicit setter, an alternative to the toggle above. ameba:disable Naming/AccessorMethodName

Source
set_upload_limit(limit : Int64) : Nil

POST transfer/setUploadLimit — set the global upload rate limit, limit in bytes/s (0 = unlimited). ameba:disable Naming/AccessorMethodName

Source
speed_limits_mode

GET transfer/speedLimitsMode — whether the alternative speed limits are currently active. The API answers with the text "1" (on) or "0" (off); this is exposed here as a Bool (true = alt limits enabled).

Source
toggle_speed_limits_mode

POST transfer/toggleSpeedLimitsMode — flip the alternative speed limits on/off.

Source
upload_limit

GET transfer/uploadLimit — global upload rate limit in bytes/s (0 = unlimited).

Source