private static void OnTimerElapsed(object state) { var provider = (IServiceProvider)state; var reader = new RssReader("https://ncore.cc/rss/rssdd.xml"); var items = reader.ReadAsync().Result; var downloader = new TorrentDownloader(); DataAccess.SaveItems(items).Wait(); var cookie = "PHPSESSID=m54jhv4al6rv082mr6vpdimr50;"; var qtorrent = provider.GetService <QBitTorrentManager>(); qtorrent.StartTorrent(new Uri(items[4].Link), cookie).Wait(); }
public void OnTimer() { //return () => //{ var reader = new RssReader("https://ncore.cc/rss/rssdd.xml"); var items = Task.Run(reader.ReadAsync).Result; var downloader = new TorrentDownloader(); DataAccess.SaveItems(items).Wait(); var cookie = "PHPSESSID=m54jhv4al6rv082mr6vpdimr50;"; //var qtorrent = provider.GetService<QBitTorrentManager>(); //qtorrent.StartTorrent(new Uri(items[4].Link), cookie).Wait(); //}; }