public int AddFeed(Feed feed) { var newFeed = SendRequest($"{_uTorrentPath}gui/?token={_token}&action=rss-update&feed-id=-1&url={HttpUtility.UrlEncode(feed.FeedUrl)}&alias={HttpUtility.UrlEncode(feed.Alias)}&subscribe=0&smart-filter=0"); var feedResponse = JsonConvert.DeserializeObject<AddFeedResponse>(newFeed); return feedResponse.rss_ident == null ? 0 : int.Parse(feedResponse.rss_ident); }
public int AddFeed(string feedUrl, string feedName, string provider) { var torrent = _torrent.FirstOrDefault( t => t.GetType().FullName.IndexOf(provider, StringComparison.CurrentCultureIgnoreCase) != -1); if (torrent == null) throw new EndpointNotFoundException($"Provider {provider} not found."); var feed = new Feed { Alias = feedName, FeedUrl = feedUrl, HasCustomAlias = true }; return torrent.AddFeed(feed); }