Example #1
0
        private async Task <List <Torrent> > GetTopAsync(string uri)
        {
            string page = await GetRawResponseAsync(uri);

            var result = TopPageParser.ParseTopToday(page);

            return(result);
        }
Example #2
0
        public async Task <TorrentDetails> GetTorrentDetailsAsync(int id)
        {
            string page = await GetRawResponseAsync("/torrents/?id=" + id);

            var result = TopPageParser.ParseTorrentDetails(page);

            result.Id = id;
            return(result);
        }
Example #3
0
        public async Task <QueryResult> GetQueryAsync(string query, QueryOptions options)
        {
            string uri  = $"/torrents/search/?search={query.Replace(" ", "%20")}&{ToQueryString(options)}";
            string page = await GetRawResponseAsync(uri);

            var result = TopPageParser.ParseQueryResult(page);

            result.Total  = options.Limit * 20;
            result.Limit  = options.Limit;
            result.Offset = options.Offset;
            result.Query  = query;
            return(result);
        }