コード例 #1
0
        private async void setContent(Torrent torrent)
        {
            wb.NavigateToString("Description downloading...");
            TorrentDetail details = await T411Service.Details(int.Parse(torrent.Id));

            wb.NavigateToString(details.Description);
        }
コード例 #2
0
        public async Task <DownloadRequestResultModel> Download(string siteId, string relativeUrl)
        {
            Site site = SiteProvider.GetById(siteId) ?? throw new ArgumentException("Unknown site: " + siteId);

            TorrentDetail detail = _torrentFinder.GetTorrentDetail(site, relativeUrl);
            Torrent       t      = await _delugedConnection.Daemon.AddTorrentMagnetAsync(detail.MagnetLinks.ElementAt(0));

            return(new DownloadRequestResultModel());
        }
コード例 #3
0
ファイル: T411Service.cs プロジェクト: j4kim/Flan411
        /// <summary>
        /// Get the detail of a particular torrent.
        /// </summary>
        /// <param name="id">The id of the torrent</param>
        /// <returns>A TorrentDetail object containing an HTML formatted description</returns>
        public static async Task <TorrentDetail> Details(int id)
        {
            using (var httpClient = new HttpClient())
            {
                httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", TOKEN);
                string strResult = await httpClient.GetStringAsync($"{HOST_NAME}/torrents/details/{id}");

                JObject       result        = JsonConvert.DeserializeObject(strResult) as JObject;
                TorrentDetail torrentDetail = result.ToObject <TorrentDetail>();

                return(torrentDetail);
            }
        }