QBittorrent::Api::Rss
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
Instance methods
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.
POST rss/addFolder — creates an RSS folder at path (backslash-nested,
e.g. "News\\Tech"). Fails with 409 if the item already exists.
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 }
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.
GET rss/matchingArticles — the articles matched by the rule
rule_name, as a map of feed name to matching article titles.
POST rss/moveItem — moves/renames the item at item_path to
dest_path. Fails with 409 on a bad source or existing destination.
POST rss/refreshItem — triggers a refresh of the feed or folder at
item_path.
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.
POST rss/renameRule — renames the rule rule_name to new_rule_name.
POST rss/setFeedURL — changes the URL of the feed at path to url
(qB 5.x addition).
POST rss/setRule — creates or replaces the auto-downloading rule named
rule_name with rule_def (serialized to the ruleDef form field).