class

QBittorrent::Api::Rss

Inherits Reference < Object

The rss endpoint group (/api/v2/rss/): RSS feeds/folders, their items, and the auto-downloading rules engine.

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

rss = QBittorrent::Api::Rss.new(client)
rss.add_feed("https://example.com/feed.xml", "News")
rss.items(with_data: true) # => Hash(String, JSON::Any) tree
rss.rules                  # => Hash(String, Model::RssRule)

The rss/items response is a heterogeneous, recursively nested tree (folders contain folders and feeds); #items returns it as Hash(String, JSON::Any) so it parses reliably regardless of depth. Use Model::RssFeed/Model::RssArticle to typed-deserialize an individual feed node once located (see #items).

Constructors

new(client : Client)
Source

Instance methods

add_feed(url : String, path : String = "") : Nil

POST rss/addFeed — subscribes to the feed at url. path is the destination folder path/name for the new feed (empty for the root). Fails with 409 if the item already exists.

Source
add_folder(path : String) : Nil

POST rss/addFolder — creates an RSS folder at path (backslash-nested, e.g. "News\\Tech"). Fails with 409 if the item already exists.

Source
items(with_data : Bool | Nil = nil) : Hash(String, JSON::Any)

GET rss/items — the full RSS items tree (nested folders and feeds).

Returned as Hash(String, JSON::Any): each key is a folder or feed name. A folder value is a nested object of the same shape; a feed value is an object matching Model::RssFeed. When with_data is true, feed nodes include their articles array; otherwise articles are omitted.

To work with a located feed node as a typed model:

tree = rss.items(with_data: true)
feed = QBittorrent::Model::RssFeed.from_json(tree["My Feed"].to_json)
feed.articles.try &.each { |a| puts a.title }
Source
mark_as_read(item_path : String, article_id : String | Nil = nil) : Nil

POST rss/markAsRead — marks the article article_id of the feed at item_path as read. When article_id is nil, marks all articles of the feed (or all feeds under a folder) as read.

Source
matching_articles(rule_name : String) : Hash(String, Array(String))

GET rss/matchingArticles — the articles matched by the rule rule_name, as a map of feed name to matching article titles.

Source
move_item(item_path : String, dest_path : String) : Nil

POST rss/moveItem — moves/renames the item at item_path to dest_path. Fails with 409 on a bad source or existing destination.

Source
refresh_item(item_path : String) : Nil

POST rss/refreshItem — triggers a refresh of the feed or folder at item_path.

Source
remove_item(path : String) : Nil

POST rss/removeItem — removes the folder or feed at path (and, for a folder, everything under it). Fails with 409 if it does not exist.

Source
remove_rule(rule_name : String) : Nil

POST rss/removeRule — deletes the rule named rule_name.

Source
rename_rule(rule_name : String, new_rule_name : String) : Nil

POST rss/renameRule — renames the rule rule_name to new_rule_name.

Source
rules

GET rss/rules — all auto-downloading rules, keyed by rule name.

Source
set_feed_url(path : String, url : String) : Nil

POST rss/setFeedURL — changes the URL of the feed at path to url (qB 5.x addition).

Source
set_rule(rule_name : String, rule_def : Model::RssRule) : Nil

POST rss/setRule — creates or replaces the auto-downloading rule named rule_name with rule_def (serialized to the ruleDef form field).

Source
set_rule(rule_name : String, rule_def : String) : Nil

POST rss/setRule — creates or replaces the auto-downloading rule named rule_name with rule_def (serialized to the ruleDef form field).

Overload taking a pre-serialized JSON object string for ruleDef.

Source