protected virtual IList <ReleaseInfo> FetchPage(IndexerRequest request, IParseIndexerResponse parser) { var response = FetchIndexerResponse(request); try { return(parser.ParseResponse(response).ToList()); } catch (Exception ex) { ex.WithData(response.HttpResponse, 128 * 1024); _logger.Trace("Unexpected Response content ({0} bytes): {1}", response.HttpResponse.ResponseData.Length, response.HttpResponse.Content); throw; } }
protected virtual IList <ReleaseInfo> FetchPage(IndexerRequest request, IParseIndexerResponse parser) { var url = request.Url; _logger.Debug("Downloading Feed " + request.Url); var response = new IndexerResponse(request, _httpClient.Execute(request.HttpRequest)); if (response.HttpResponse.Headers.ContentType != null && response.HttpResponse.Headers.ContentType.Contains("text/html") && request.HttpRequest.Headers.Accept != null && !request.HttpRequest.Headers.Accept.Contains("text/html")) { throw new WebException("Indexer responded with html content. Site is likely blocked or unavailable."); } return(parser.ParseResponse(response).ToList()); }
private TorrentInfo[] ParseResponse(IParseIndexerResponse parser, IndexerResponse response) { try { var releases = parser.ParseResponse(response).Cast<TorrentInfo>().ToArray(); return releases; } catch (Exception ex) { _logger.Debug(ex, "Unable to parse indexer feed: " + ex.Message); throw new UnsupportedFeedException("Unable to parse indexer: " + ex.Message); } }
protected virtual IList <ReleaseInfo> FetchPage(IndexerRequest request, IParseIndexerResponse parser) { var response = FetchIndexerResponse(request); return(parser.ParseResponse(response).ToList()); }