#web-api #bittorrent #qbittorrent #torrent #api #web #qbit

qbit-rs

A Rust library for interacting with qBittorrent's Web API

15 releases

new 0.4.6 Oct 29, 2024
0.4.4 Sep 14, 2024
0.4.3 Jul 3, 2024
0.4.1 Nov 29, 2023
0.3.6 May 29, 2023

#432 in Network programming

Download history 8/week @ 2024-07-15 10/week @ 2024-07-22 82/week @ 2024-07-29 32/week @ 2024-08-05 53/week @ 2024-08-12 1/week @ 2024-08-19 6/week @ 2024-08-26 155/week @ 2024-09-09 78/week @ 2024-09-16 61/week @ 2024-09-23 28/week @ 2024-09-30 191/week @ 2024-10-07 20/week @ 2024-10-14 1/week @ 2024-10-21 145/week @ 2024-10-28

359 downloads per month

MIT license

115KB
2.5K SLoC

Qbit-rs

crates.io docs.rs github

A Rust library for interacting with qBittorrent's Web API.

Implemented according to WebUI API (qBittorrent 4.1).

Usage

Add dependency by running:

cargo add qbit-rs

or manually add to Cargo.toml:

[dependencies]
qbit-rs = "0.4"

Then use it in your code:

use qbit_rs::Qbit;
use qbit_rs::model::Credential;

let credential = Credential::new("username", "password");
let api = Qbit::new("http://my-qb-instance.domain", credential);
let torrents = api.get_version().await;

or use the builder pattern:

use qbit_rs::Qbit;

let api = Qbit::builder()
    .endpoint("http://my-qb-instance.domain")
    .cookie("SID=1234567890")
    .build();
let torrents = api.get_version().await;

For more methods, see Qbit.

API Coverage

Most of the API is covered, except RSS and Search. PR is welcomed if you need that part of the API. The following is a list of the implementation status:

  1. Authentication
    1. Login
    2. Logout
  2. Application
    1. Get application version
    2. Get API version
    3. Get build info
    4. Shutdown application
    5. Get application preferences
    6. Set application preferences
    7. Get default save path
  3. Log
    1. Get log
    2. Get peer log
  4. Sync
    1. Get main data
    2. Get torrent peers data
  5. Transfer info
    1. Get global transfer info
    2. Get alternative speed limits state
    3. Toggle alternative speed limits
    4. Get global download limit
    5. Set global download limit
    6. Get global upload limit
    7. Set global upload limit
    8. Ban peers
  6. Torrent management
    1. Get torrent list
    2. Get torrent generic properties
    3. Get torrent trackers
    4. Get torrent web seeds
    5. Get torrent contents
    6. Get torrent pieces' states
    7. Get torrent pieces' hashes
    8. Add new torrent
    9. Pause torrents
    10. Resume torrents
    11. Delete torrents
    12. Recheck torrents
    13. Reannounce torrents
    14. Edit trackers
    15. Remove trackers
    16. Add peers
    17. Add trackers to torrent
    18. Increase torrent priority
    19. Decrease torrent priority
    20. Maximal torrent priority
    21. Minimal torrent priority
    22. Set file priority
    23. Get torrent download limit
    24. Set torrent download limit
    25. Set torrent share limit
    26. Get torrent upload limit
    27. Set torrent upload limit
    28. Set torrent location
    29. Set torrent name
    30. Set torrent category
    31. Get all categories
    32. Add new category
    33. Edit category
    34. Remove categories
    35. Add torrent tags
    36. Remove torrent tags
    37. Get all tags
    38. Create tags
    39. Delete tags
    40. Set automatic torrent management
    41. Toggle sequential download
    42. Set first/last piece priority
    43. Set force start
    44. Set super seeding
    45. Rename file
    46. Rename folder
  7. RSS (experimental)
    1. Add folder
    2. Add feed
    3. Remove item
    4. Move item
    5. Get all items
    6. Mark as read
    7. Refresh item
    8. Set auto-downloading rule
    9. Rename auto-downloading rule
    10. Remove auto-downloading rule
    11. Get all auto-downloading rules
    12. Get all articles matching a rule
  8. Search
    1. Start search
    2. Stop search
    3. Get search status
    4. Get search results
    5. Delete search
    6. Get search plugins
    7. Install search plugin
    8. Uninstall search plugin
    9. Enable search plugin
    10. Update search plugins
  9. Undocumented
    1. Export torrent[^1]

[^1]: The endpoint is added in this PR

Dependencies

~6–21MB
~333K SLoC