mirror of https://github.com/Jackett/Jackett
Rename WebClientStringResult.Content to WebClientStringResult.ContentString
This commit is contained in:
parent
cf34dfec8e
commit
d760350dc0
|
@ -173,7 +173,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
// Parse error page
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var message = dom.QuerySelector(".warning").TextContent.Split('.').Reverse().Skip(1).First();
|
||||
|
||||
// Try left
|
||||
|
@ -558,7 +558,7 @@ namespace Jackett.Common.Indexers
|
|||
results = await RequestStringWithCookiesAndRetry(request, null, null, emulatedBrowserHeaders);
|
||||
|
||||
// Return results from tracker
|
||||
return results.Content;
|
||||
return results.ContentString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -149,7 +149,7 @@ without this configuration the torrent download does not work.<br/>You can find
|
|||
{ "pid", configData.Pid.Value.Trim() }
|
||||
};
|
||||
var result = await PostDataWithCookies(AuthUrl, body, headers: AuthHeaders);
|
||||
var json = JObject.Parse(result.Content);
|
||||
var json = JObject.Parse(result.ContentString);
|
||||
_token = json.Value<string>("token");
|
||||
if (_token == null)
|
||||
throw new Exception(json.Value<string>("message"));
|
||||
|
@ -168,11 +168,11 @@ without this configuration the torrent download does not work.<br/>You can find
|
|||
response = await RequestStringWithCookiesAndRetry(episodeSearchUrl, headers: GetSearchHeaders());
|
||||
}
|
||||
else if (response.Status != HttpStatusCode.OK)
|
||||
throw new Exception($"Unknown error: {response.Content}");
|
||||
throw new Exception($"Unknown error: {response.ContentString}");
|
||||
|
||||
try
|
||||
{
|
||||
var jsonContent = JToken.Parse(response.Content);
|
||||
var jsonContent = JToken.Parse(response.ContentString);
|
||||
foreach (var row in jsonContent.Value<JArray>("data"))
|
||||
{
|
||||
var comments = new Uri(row.Value<string>("url"));
|
||||
|
@ -237,7 +237,7 @@ without this configuration the torrent download does not work.<br/>You can find
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -80,11 +80,11 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
JObject json = null;
|
||||
try
|
||||
{
|
||||
json = JObject.Parse(response.Content);
|
||||
json = JObject.Parse(response.ContentString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Error while parsing json: " + response.Content, ex);
|
||||
throw new Exception("Error while parsing json: " + response.ContentString, ex);
|
||||
}
|
||||
var error = (string)json["error"];
|
||||
if (error != null)
|
||||
|
@ -122,7 +122,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -129,13 +129,13 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
}
|
||||
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, string.Empty, true, SiteLink);
|
||||
await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString != null && response.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var loginResultParser = new HtmlParser();
|
||||
var loginResultDocument = loginResultParser.ParseDocument(response.Content);
|
||||
var loginResultDocument = loginResultParser.ParseDocument(response.ContentString);
|
||||
var loginform = loginResultDocument.QuerySelector("#loginform");
|
||||
if (loginform == null)
|
||||
throw new ExceptionWithConfigData(response.Content, configData);
|
||||
throw new ExceptionWithConfigData(response.ContentString, configData);
|
||||
|
||||
loginform.QuerySelector("table").Remove();
|
||||
var errorMessage = loginform.TextContent.Replace("\n\t", " ").Trim();
|
||||
|
@ -206,7 +206,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
|
||||
try
|
||||
{
|
||||
var json = JObject.Parse(response.Content);
|
||||
var json = JObject.Parse(response.ContentString);
|
||||
foreach (JObject r in json["response"]["results"])
|
||||
{
|
||||
var groupTime = DateTimeUtil.UnixTimestampToDateTime(long.Parse((string)r["groupTime"]));
|
||||
|
@ -266,7 +266,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
};
|
||||
var jsonData = JsonConvert.SerializeObject(body);
|
||||
var result = await PostDataWithCookies(LoginUrl, null, headers: ApiHeaders, rawbody: jsonData);
|
||||
var json = JObject.Parse(result.Content);
|
||||
var json = JObject.Parse(result.ContentString);
|
||||
_token = json.Value<string>("token");
|
||||
if (_token == null)
|
||||
throw new Exception(json.Value<string>("message"));
|
||||
|
@ -112,11 +112,11 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
response = await RequestStringWithCookies(searchUrl, headers: GetSearchHeaders());
|
||||
}
|
||||
else if (response.Status != HttpStatusCode.OK)
|
||||
throw new Exception($"Unknown error in search: {response.Content}");
|
||||
throw new Exception($"Unknown error in search: {response.ContentString}");
|
||||
|
||||
try
|
||||
{
|
||||
var rows = JArray.Parse(response.Content);
|
||||
var rows = JArray.Parse(response.ContentString);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
var id = row.Value<string>("id");
|
||||
|
@ -160,7 +160,7 @@ namespace Jackett.Common.Indexers.Abstract
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace Jackett.Common.Indexers
|
|||
);
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var document = await parser.ParseDocumentAsync(result.Content);
|
||||
var document = await parser.ParseDocumentAsync(result.ContentString);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, IsAuthorized(result), () =>
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = await parser.ParseDocumentAsync(result.Content);
|
||||
var document = await parser.ParseDocumentAsync(result.ContentString);
|
||||
|
||||
foreach (var linkNode in document.QuerySelectorAll(ReleaseLinksSelector))
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -200,7 +200,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = await parser.ParseDocumentAsync(result.Content);
|
||||
var document = await parser.ParseDocumentAsync(result.ContentString);
|
||||
var content = document.GetElementById(ContentId);
|
||||
|
||||
var date = GetDateFromShowPage(url, content);
|
||||
|
@ -247,7 +247,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -510,7 +510,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
private bool IsAuthorized(WebClientStringResult result) =>
|
||||
result.Content.Contains("index.php?action=logout");
|
||||
result.ContentString.Contains("index.php?action=logout");
|
||||
|
||||
private IEnumerable<int> ParseCategories(Uri showUri)
|
||||
{
|
||||
|
@ -535,7 +535,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = await parser.ParseDocumentAsync(response.Content);
|
||||
var document = await parser.ParseDocumentAsync(response.ContentString);
|
||||
|
||||
foreach (var linkNode in document.QuerySelectorAll(searchLinkSelector))
|
||||
{
|
||||
|
@ -545,7 +545,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -163,7 +163,7 @@ namespace Jackett.Common.Indexers
|
|||
throw new WebException($"Anidex search returned unexpected result. Expected 200 OK but got {response.Status}.", WebExceptionStatus.ProtocolError);
|
||||
|
||||
// Search seems to have been a success so parse it
|
||||
return ParseResult(response.Content);
|
||||
return ParseResult(response.ContentString);
|
||||
}
|
||||
|
||||
private IEnumerable<ReleaseInfo> ParseResult(string response)
|
||||
|
|
|
@ -180,9 +180,9 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
// Get the content from the tracker
|
||||
var response = await RequestStringWithCookiesAndRetry(queryUrl);
|
||||
if (!response.Content.StartsWith("{")) // not JSON => error
|
||||
if (!response.ContentString.StartsWith("{")) // not JSON => error
|
||||
throw new ExceptionWithConfigData("unexcepted response (not JSON)", configData);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(response.Content);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(response.ContentString);
|
||||
|
||||
// Parse
|
||||
try
|
||||
|
@ -418,7 +418,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
// Add to the cache
|
||||
|
|
|
@ -82,10 +82,10 @@ namespace Jackett.Common.Indexers
|
|||
var loginPage = await RequestStringWithCookiesAndRetry(LoginUrl, "", LoginUrl);
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector(".ui-state-error").Text().Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -119,7 +119,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl, null, SearchUrlReferer, extraHeaders);
|
||||
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
|
|
|
@ -65,10 +65,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("form#loginform").TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -98,7 +98,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(results.Content);
|
||||
var doc = parser.ParseDocument(results.ContentString);
|
||||
var rows = doc.QuerySelectorAll("table.torrent_table > tbody > tr.torrent");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -101,12 +101,12 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + "?" + qc.GetQueryString();
|
||||
var results = await RequestStringWithCookies(searchUrl);
|
||||
if (string.IsNullOrWhiteSpace(results.Content))
|
||||
if (string.IsNullOrWhiteSpace(results.ContentString))
|
||||
throw new Exception("Empty response. Please, check the Passkey.");
|
||||
|
||||
try
|
||||
{
|
||||
var doc = XDocument.Parse(results.Content);
|
||||
var doc = XDocument.Parse(results.ContentString);
|
||||
|
||||
var errorMsg = doc.Descendants("error").FirstOrDefault()?.Value;
|
||||
if (errorMsg?.Contains("No Results") == true)
|
||||
|
@ -208,7 +208,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -80,10 +80,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, SiteLink);
|
||||
await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString != null && response.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var messageEl = dom.QuerySelectorAll("#loginform");
|
||||
var messages = new List<string>();
|
||||
for (var i = 0; i < 13; i++)
|
||||
|
@ -144,7 +144,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("#torrent_table > tbody > tr.torrent");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -198,7 +198,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
}
|
||||
return releases;
|
||||
|
|
|
@ -114,9 +114,9 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
result.Cookies, result.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
var errorMessage = result.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, ConfigData);
|
||||
});
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
|
@ -269,7 +269,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
const string rowsSelector = "table.torrent_table > tbody > tr:not(tr.colhead)";
|
||||
var searchResultParser = new HtmlParser();
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results.Content);
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results.ContentString);
|
||||
var rows = searchResultDocument.QuerySelectorAll(rowsSelector);
|
||||
ICollection<int> groupCategory = null;
|
||||
string groupTitle = null;
|
||||
|
@ -380,7 +380,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -401,7 +401,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
const string rowsSelector = "table.torrent_table > tbody > tr:not(tr.colhead)";
|
||||
var searchResultParser = new HtmlParser();
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results.Content);
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results.ContentString);
|
||||
var rows = searchResultDocument.QuerySelectorAll(rowsSelector);
|
||||
foreach (var row in rows)
|
||||
try
|
||||
|
@ -509,7 +509,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginForm.Cookies, true, null, SiteLink);
|
||||
var responseContent = response.Content;
|
||||
var responseContent = response.ContentString;
|
||||
await ConfigureIfOK(response.Cookies, responseContent.Contains(LogoutStr), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
|
@ -107,7 +107,7 @@ namespace Jackett.Common.Indexers
|
|||
var searchString = queryCopy.SanitizedSearchTerm;
|
||||
var episodeSearchUrl = SearchUrl + WebUtility.UrlEncode(searchString);
|
||||
var response = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
|
||||
if (!response.Content.Contains(LogoutStr))
|
||||
if (!response.ContentString.Contains(LogoutStr))
|
||||
{
|
||||
//Cookie appears to expire after a period of time or logging in to the site via browser
|
||||
await DoLogin();
|
||||
|
@ -117,7 +117,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll(".torrents tr.torrent, .torrents tr.torrent_alt");
|
||||
ICollection<int> currentCategories = new List<int> {TorznabCatType.TVAnime.ID};
|
||||
|
||||
|
@ -207,7 +207,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -248,7 +248,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var downloadPage = await RequestStringWithCookies(link.ToString());
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(downloadPage.Content);
|
||||
var dom = parser.ParseDocument(downloadPage.ContentString);
|
||||
var downloadLink = dom.QuerySelectorAll(".download_link").First().GetAttribute("href");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(downloadLink))
|
||||
|
|
|
@ -578,7 +578,7 @@ namespace Jackett.Common.Indexers
|
|||
throw new Exception("Request to " + response.Request.Url + " failed (Error " + response.Status + ") - The tracker seems to be down.");
|
||||
}
|
||||
|
||||
if (response.Status == System.Net.HttpStatusCode.Forbidden && response.Content.Contains("<span data-translate=\"complete_sec_check\">Please complete the security check to access</span>"))
|
||||
if (response.Status == System.Net.HttpStatusCode.Forbidden && response.ContentString.Contains("<span data-translate=\"complete_sec_check\">Please complete the security check to access</span>"))
|
||||
{
|
||||
throw new Exception("Request to " + response.Request.Url + " failed (Error " + response.Status + ") - The page is protected by an Cloudflare reCaptcha. The page is in aggressive DDoS mitigation mode or your IP might be blacklisted (e.g. in case of shared VPN IPs). There's no easy way of making it usable with Jackett.");
|
||||
}
|
||||
|
|
|
@ -97,10 +97,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("#login_error").Text().Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -130,7 +130,7 @@ namespace Jackett.Common.Indexers
|
|||
searchUrl += "?" + queryCollection.GetQueryString();
|
||||
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl, null, BrowseUrl);
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace Jackett.Common.Indexers
|
|||
if (loginPage.IsRedirect)
|
||||
return result; // already logged in
|
||||
var parser = new HtmlParser();
|
||||
var cq = parser.ParseDocument(loginPage.Content);
|
||||
var cq = parser.ParseDocument(loginPage.ContentString);
|
||||
var recaptchaSiteKey = cq.QuerySelector(".g-recaptcha")?.GetAttribute("data-sitekey");
|
||||
result.CookieHeader.Value = loginPage.Cookies;
|
||||
result.Captcha.SiteKey = recaptchaSiteKey;
|
||||
|
@ -105,10 +105,10 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var response = await RequestLoginAndFollowRedirect(TakeLoginUrl, pairs, null, true, referer: SiteLink);
|
||||
await ConfigureIfOK(response.Cookies, response.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var errorMessage = dom.QuerySelector("table.detail td.text").FirstChild.TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -147,7 +147,7 @@ namespace Jackett.Common.Indexers
|
|||
foreach (var result in results)
|
||||
try
|
||||
{
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
foreach (var child in dom.QuerySelectorAll("#needseed"))
|
||||
child.Remove();
|
||||
var table = dom.QuerySelector("table[align=center] + br + table > tbody");
|
||||
|
@ -206,7 +206,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var btnResponse = JsonConvert.DeserializeObject<BTNRPCResponse>(response.Content);
|
||||
var btnResponse = JsonConvert.DeserializeObject<BTNRPCResponse>(response.ContentString);
|
||||
|
||||
if (btnResponse?.Result?.Torrents != null)
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -464,7 +464,7 @@ namespace Jackett.Common.Indexers
|
|||
return true; // no error
|
||||
|
||||
var ResultParser = new HtmlParser();
|
||||
var ResultDocument = ResultParser.ParseDocument(loginResult.Content);
|
||||
var ResultDocument = ResultParser.ParseDocument(loginResult.ContentString);
|
||||
foreach (var error in errorBlocks)
|
||||
{
|
||||
var selection = ResultDocument.QuerySelector(error.Selector);
|
||||
|
@ -540,11 +540,11 @@ namespace Jackett.Common.Indexers
|
|||
// request real login page again
|
||||
landingResult = await RequestStringWithCookies(LoginUrl, null, SiteLink);
|
||||
var htmlParser = new HtmlParser();
|
||||
landingResultDocument = htmlParser.ParseDocument(landingResult.Content);
|
||||
landingResultDocument = htmlParser.ParseDocument(landingResult.ContentString);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ExceptionWithConfigData(string.Format("Login failed: Cloudflare clearance failed using cookies {0}: {1}", CookieHeader, ClearanceResult.Content), configData);
|
||||
throw new ExceptionWithConfigData(string.Format("Login failed: Cloudflare clearance failed using cookies {0}: {1}", CookieHeader, ClearanceResult.ContentString), configData);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -655,7 +655,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var captchaUrl = resolvePath("simpleCaptcha.php?numImages=1");
|
||||
var simpleCaptchaResult = await RequestStringWithCookies(captchaUrl.ToString(), null, LoginUrl);
|
||||
var simpleCaptchaJSON = JObject.Parse(simpleCaptchaResult.Content);
|
||||
var simpleCaptchaJSON = JObject.Parse(simpleCaptchaResult.ContentString);
|
||||
var captchaSelection = simpleCaptchaJSON["images"][0]["hash"].ToString();
|
||||
pairs["captchaSelection"] = captchaSelection;
|
||||
pairs["submitme"] = "X";
|
||||
|
@ -818,7 +818,7 @@ namespace Jackett.Common.Indexers
|
|||
if (Login.Test.Selector != null)
|
||||
{
|
||||
var testResultParser = new HtmlParser();
|
||||
var testResultDocument = testResultParser.ParseDocument(testResult.Content);
|
||||
var testResultDocument = testResultParser.ParseDocument(testResult.ContentString);
|
||||
var selection = testResultDocument.QuerySelectorAll(Login.Test.Selector);
|
||||
if (selection.Length == 0)
|
||||
{
|
||||
|
@ -891,7 +891,7 @@ namespace Jackett.Common.Indexers
|
|||
landingResult = await RequestStringWithCookies(LoginUrl.AbsoluteUri, null, SiteLink);
|
||||
|
||||
var htmlParser = new HtmlParser();
|
||||
landingResultDocument = htmlParser.ParseDocument(landingResult.Content);
|
||||
landingResultDocument = htmlParser.ParseDocument(landingResult.ContentString);
|
||||
|
||||
var hasCaptcha = false;
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ namespace Jackett.Common.Indexers
|
|||
if (response.IsRedirect && SearchPath.Followredirect)
|
||||
await FollowIfRedirect(response);
|
||||
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
|
||||
|
||||
try
|
||||
|
@ -1378,7 +1378,7 @@ namespace Jackett.Common.Indexers
|
|||
if (response.IsRedirect && SearchPath.Followredirect)
|
||||
await FollowIfRedirect(response);
|
||||
|
||||
results = response.Content;
|
||||
results = response.ContentString;
|
||||
SearchResultDocument = SearchResultParser.ParseDocument(results);
|
||||
}
|
||||
|
||||
|
@ -1801,7 +1801,7 @@ namespace Jackett.Common.Indexers
|
|||
var response = await RequestStringWithCookies(link.ToString());
|
||||
if (response.IsRedirect)
|
||||
response = await RequestStringWithCookies(response.RedirectingTo);
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
var searchResultParser = new HtmlParser();
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results);
|
||||
var downloadElement = searchResultDocument.QuerySelector(selector);
|
||||
|
|
|
@ -125,18 +125,18 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var preotectedLink = dom.QuerySelector("a[service=BitTorrent]").GetAttribute("href");
|
||||
preotectedLink = SiteLink + preotectedLink.TrimStart('/');
|
||||
|
||||
results = await RequestStringWithCookies(preotectedLink);
|
||||
dom = parser.ParseDocument(results.Content);
|
||||
dom = parser.ParseDocument(results.ContentString);
|
||||
var magnetUrl = dom.QuerySelector("a[href^=magnet]").GetAttribute("href");
|
||||
return await base.Download(new Uri(magnetUrl));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -149,7 +149,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
|
||||
var rows = dom.QuerySelectorAll("div.home_post_cont");
|
||||
foreach (var row in rows)
|
||||
|
@ -189,7 +189,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
|
||||
switch (json)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ namespace Jackett.Common.Indexers
|
|||
catch (Exception e)
|
||||
{
|
||||
logger.Error("checkResponse() Error: ", e.Message);
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
//var json = JArray.Parse(results.Content);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(results.Content);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(results.ContentString);
|
||||
foreach (var row in json ?? System.Linq.Enumerable.Empty<dynamic>())
|
||||
{
|
||||
var release = new ReleaseInfo();
|
||||
|
@ -215,7 +215,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, configData.CookieHeader.Value);
|
||||
var parser = new HtmlParser();
|
||||
var cq = parser.ParseDocument(loginPage.Content);
|
||||
var cq = parser.ParseDocument(loginPage.ContentString);
|
||||
var recaptchaSiteKey = cq.QuerySelector(".g-recaptcha")?.GetAttribute("data-sitekey");
|
||||
if (recaptchaSiteKey != null)
|
||||
{
|
||||
|
@ -151,10 +151,10 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var result = await RequestLoginAndFollowRedirect(AjaxLoginUrl, pairs, configData.CookieHeader.Value, true, SiteLink, LoginUrl);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var errorMessage = parser.ParseDocument(result.Content);
|
||||
var errorMessage = parser.ParseDocument(result.ContentString);
|
||||
throw new ExceptionWithConfigData(errorMessage.Text(), configData);
|
||||
});
|
||||
|
||||
|
@ -190,11 +190,11 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
try
|
||||
{
|
||||
releases.AddRange(contentToReleaseInfos(query, results.Content));
|
||||
releases.AddRange(contentToReleaseInfos(query, results.ContentString));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -103,12 +103,12 @@ namespace Jackett.Common.Indexers
|
|||
var result = await RequestStringWithCookies(url);
|
||||
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
try
|
||||
{
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
|
||||
var table = doc.QuerySelector("table.table");
|
||||
if (table == null)
|
||||
|
@ -136,7 +136,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
page++; // update page number
|
||||
|
@ -156,10 +156,10 @@ namespace Jackett.Common.Indexers
|
|||
var result = await RequestStringWithCookies(downloadUrl);
|
||||
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
downloadUrl = GetDownloadLink(doc);
|
||||
}
|
||||
var content = await base.Download(new Uri(downloadUrl));
|
||||
|
@ -208,10 +208,10 @@ namespace Jackett.Common.Indexers
|
|||
var result = await RequestStringWithCookies(commentsLink);
|
||||
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
|
||||
var tables = doc.QuerySelectorAll("table.table");
|
||||
foreach (var table in tables)
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
await ConfigureIfOK(result.Cookies, result.Cookies != null, () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
var errorMessage = result.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
||||
|
@ -187,7 +187,7 @@ namespace Jackett.Common.Indexers
|
|||
var lastDate = DateTime.Now;
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(results.Content);
|
||||
var doc = parser.ParseDocument(results.ContentString);
|
||||
var rows = doc.QuerySelectorAll("table[id='sortabletable'] > tbody > tr");
|
||||
|
||||
foreach (var row in rows.Skip(1))
|
||||
|
@ -281,7 +281,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument((string)json["contenido"]);
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,13 +155,13 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(result.Content);
|
||||
var doc = parser.ParseDocument(result.ContentString);
|
||||
var magnetLink = doc.QuerySelector("a[id=en_desc]").GetAttribute("href");
|
||||
return Encoding.UTF8.GetBytes(magnetLink);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace Jackett.Common.Indexers.Feeds
|
|||
};
|
||||
var result = await webclient.GetString(request);
|
||||
|
||||
var results = ParseFeedForResults(result.Content);
|
||||
var results = ParseFeedForResults(result.ContentString);
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace Jackett.Common.Indexers
|
|||
{"Authorization", "Basic " + auth}
|
||||
};
|
||||
var response = await RequestStringWithCookies(searchUrl, headers: headers);
|
||||
return response.Content;
|
||||
return response.ContentString;
|
||||
}
|
||||
catch (Exception inner)
|
||||
{
|
||||
|
|
|
@ -67,10 +67,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("td.mf_content").TextContent;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table[cellpadding=2] > tbody > tr:has(td.row3)");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||
var parser = new HtmlParser();
|
||||
var cq = parser.ParseDocument(loginPage.Content);
|
||||
var cq = parser.ParseDocument(loginPage.ContentString);
|
||||
var captcha = cq.QuerySelector(".g-recaptcha"); // invisible recaptcha
|
||||
if (captcha != null)
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ namespace Jackett.Common.Indexers
|
|||
{"cookieuser", "1"}
|
||||
};
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("images/loading.gif") == true,
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("images/loading.gif") == true,
|
||||
() => throw new ExceptionWithConfigData("Couldn't login", configData));
|
||||
Thread.Sleep(2);
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
|
@ -208,7 +208,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(data.Content);
|
||||
var dom = parser.ParseDocument(data.ContentString);
|
||||
var rows = dom.QuerySelectorAll("tr.box_torrent");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -254,7 +254,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(data.Content, ex);
|
||||
OnParseError(data.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -278,7 +278,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var results = await RequestStringWithCookies(site.ToString());
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("#listtable > tbody > tr");
|
||||
foreach (var row in rows.Skip(1))
|
||||
{
|
||||
|
@ -288,7 +288,7 @@ namespace Jackett.Common.Indexers
|
|||
var address = link.GetAttribute("href");
|
||||
if (string.IsNullOrEmpty(address))
|
||||
continue;
|
||||
var realDom = parser.ParseDocument(results.Content);
|
||||
var realDom = parser.ParseDocument(results.ContentString);
|
||||
return realDom.QuerySelector("#content:nth-child(1) > h1").TextContent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace Jackett.Common.Indexers
|
|||
var RowsSelector = ".torrent_table > tbody > tr";
|
||||
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.Content);
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.ContentString);
|
||||
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
||||
|
||||
var stickyGroup = false;
|
||||
|
@ -321,7 +321,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -91,10 +91,10 @@ namespace Jackett.Common.Indexers
|
|||
var loginPage = await RequestStringWithCookies(SiteLink, string.Empty);
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, SiteLink, SiteLink);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var messageEl = dom.QuerySelector("body > div");
|
||||
var errorMessage = messageEl.TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -131,7 +131,7 @@ namespace Jackett.Common.Indexers
|
|||
response = await RequestStringWithCookiesAndRetry(searchUrl, null, BrowseUrl);
|
||||
}
|
||||
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
|
|
|
@ -187,11 +187,11 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
json = JObject.Parse(response.Content);
|
||||
json = JObject.Parse(response.ContentString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Error while parsing json: " + response.Content, ex);
|
||||
throw new Exception("Error while parsing json: " + response.ContentString, ex);
|
||||
}
|
||||
|
||||
if ((int)json["status"] != 0)
|
||||
|
|
|
@ -87,11 +87,11 @@ namespace Jackett.Common.Indexers
|
|||
// Send Post
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: LoginUrl);
|
||||
|
||||
await ConfigureIfOK(response.Cookies, response.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var errorStr = "You have {0} remaining login attempts";
|
||||
var remainingAttemptSpan = new Regex(string.Format(errorStr, "(.*?)"))
|
||||
.Match(loginPage.Content).Groups[1].ToString();
|
||||
.Match(loginPage.ContentString).Groups[1].ToString();
|
||||
var attempts = Regex.Replace(remainingAttemptSpan, "<.*?>", string.Empty);
|
||||
var errorMessage = string.Format(errorStr, attempts);
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -124,7 +124,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var resultParser = new HtmlParser();
|
||||
var searchResultDocument = resultParser.ParseDocument(response.Content);
|
||||
var searchResultDocument = resultParser.ParseDocument(response.ContentString);
|
||||
var rows = searchResultDocument.QuerySelectorAll("table.lista > tbody > tr");
|
||||
|
||||
foreach (var row in rows)
|
||||
|
@ -177,7 +177,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace Jackett.Common.Indexers
|
|||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, null, LoginUrl);
|
||||
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("If your browser doesn't have javascript enabled") == true,
|
||||
result.Cookies, result.ContentString?.Contains("If your browser doesn't have javascript enabled") == true,
|
||||
() => throw new ExceptionWithConfigData("Couldn't login", configData));
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
|
||||
var userInfo = dom.QuerySelector("table.navus tr");
|
||||
var userRank = userInfo.Children[1].TextContent.Replace("Rank:", string.Empty).Trim();
|
||||
|
@ -234,7 +234,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -84,10 +84,10 @@ namespace Jackett.Common.Indexers
|
|||
CookieHeader = string.Empty;
|
||||
var result = await RequestLoginAndFollowRedirect(LoginPostUrl, pairs, CookieHeader, true, null, SiteLink);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("OK") == true, () =>
|
||||
result.Cookies, result.ContentString?.Contains("OK") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.TextContent.Trim();
|
||||
errorMessage += " attempts left. Please check your credentials.";
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -109,7 +109,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll(".browse > div > div");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -76,11 +76,11 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
if (response.Content.Contains("Nothing was found"))
|
||||
if (response.ContentString.Contains("Nothing was found"))
|
||||
return releases;
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var resultLinks = dom.QuerySelectorAll("ul > li > a");
|
||||
var uniqueShowLinks = new HashSet<string>();
|
||||
foreach (var resultLink in resultLinks)
|
||||
|
@ -97,7 +97,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -116,11 +116,11 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
if (response.Content.Contains("Nothing was found"))
|
||||
if (response.ContentString.Contains("Nothing was found"))
|
||||
return releases;
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var latestresults = dom.QuerySelectorAll("ul > li > a");
|
||||
foreach (var resultLink in latestresults)
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -151,7 +151,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var match = Regex.Match(response.Content, "(var hs_showid = )([0-9]*)(;)", RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(response.ContentString, "(var hs_showid = )([0-9]*)(;)", RegexOptions.IgnoreCase);
|
||||
if (match.Success == false)
|
||||
return releases;
|
||||
|
||||
|
@ -169,7 +169,7 @@ namespace Jackett.Common.Indexers
|
|||
while (true)
|
||||
{
|
||||
var showApiResponse = await RequestStringWithCookiesAndRetry(apiUrl + "&nextid=" + nextId);
|
||||
var showApiDom = parser.ParseDocument(showApiResponse.Content);
|
||||
var showApiDom = parser.ParseDocument(showApiResponse.ContentString);
|
||||
var releaseRowResults = showApiDom.QuerySelectorAll("div.rls-info-container");
|
||||
rows.AddRange(releaseRowResults);
|
||||
nextId++;
|
||||
|
@ -215,7 +215,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + "?" + qc.GetQueryString();
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl, null, SearchUrl);
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
|
||||
if (results == null || !results.Contains("/lout.php"))
|
||||
throw new Exception("The user is not logged in. It is possible that the cookie has expired or you made a mistake when copying it. Please check the settings.");
|
||||
|
|
|
@ -104,9 +104,9 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
|
||||
await ConfigureIfOK(response.Cookies, response.Content.Contains("You have successfully logged in"), () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString.Contains("You have successfully logged in"), () =>
|
||||
{
|
||||
var errorMessage = response.Content;
|
||||
var errorMessage = response.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
||||
|
@ -124,7 +124,7 @@ namespace Jackett.Common.Indexers
|
|||
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
||||
// Occasionally the cookies become invalid, login again if that happens
|
||||
if (results.Content.Contains("You do not have permission to access this page."))
|
||||
if (results.ContentString.Contains("You do not have permission to access this page."))
|
||||
{
|
||||
await ApplyConfiguration(null);
|
||||
results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
@ -133,7 +133,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
|
||||
var rows = dom.QuerySelectorAll("#sortabletable tr:has(a[href*=\"details.php?id=\"])");
|
||||
foreach (var row in rows)
|
||||
|
@ -192,7 +192,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new Exception("Response code error. HTTP code: " + result.Status);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
if (!(json is JObject) || !(json["response"] is JObject) || !(json["response"]["docs"] is JArray))
|
||||
throw new Exception("Response format error");
|
||||
return (JArray)json["response"]["docs"];
|
||||
|
@ -164,7 +164,7 @@ namespace Jackett.Common.Indexers
|
|||
catch (Exception e)
|
||||
{
|
||||
logger.Error("ParseResponse Error: ", e.Message);
|
||||
throw new ExceptionWithConfigData(result.Content, ConfigData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, ConfigData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,11 +99,11 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, SearchUrl, LandingUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true,
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true,
|
||||
() =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var warningNode = dom.QuerySelector("#loginform > .warning");
|
||||
var errorMessage = warningNode?.TextContent.Trim().Replace("\n\t", " ");
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -166,7 +166,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(searchPage.Content);
|
||||
var dom = parser.ParseDocument(searchPage.ContentString);
|
||||
var albumRows = dom.QuerySelectorAll("table#torrent_table > tbody > tr:has(strong > a[href*=\"torrents.php?id=\"])");
|
||||
foreach (var row in albumRows)
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(searchPage.Content, ex);
|
||||
OnParseError(searchPage.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace Jackett.Common.Indexers
|
|||
// looks like after some failed login attempts there's a captcha
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(loginPage.Content);
|
||||
var document = parser.ParseDocument(loginPage.ContentString);
|
||||
var qCaptchaImg = document.QuerySelector("img#captcha_pictcha");
|
||||
if (qCaptchaImg != null)
|
||||
{
|
||||
|
@ -160,9 +160,9 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(ApiUrl, data, CookieHeader, true, SiteLink, ApiUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("\"success\":true"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("\"success\":true"), () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
var errorMessage = result.ContentString;
|
||||
if (errorMessage.Contains("\"error\":2"))
|
||||
errorMessage = "Captcha is incorrect";
|
||||
if (errorMessage.Contains("\"error\":3"))
|
||||
|
@ -184,12 +184,12 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var response = await PostDataWithCookies(url: ApiUrl, data: data);
|
||||
logger.Debug("Logout result: " + response.Content);
|
||||
logger.Debug("Logout result: " + response.ContentString);
|
||||
|
||||
var isOK = response.Status == System.Net.HttpStatusCode.OK;
|
||||
if (!isOK)
|
||||
{
|
||||
logger.Error("Logout failed with response: " + response.Content);
|
||||
logger.Error("Logout failed with response: " + response.ContentString);
|
||||
}
|
||||
|
||||
return isOK;
|
||||
|
@ -215,11 +215,11 @@ namespace Jackett.Common.Indexers
|
|||
private async Task<WebClientStringResult> RequestStringAndRelogin(string url)
|
||||
{
|
||||
var results = await RequestStringWithCookies(url);
|
||||
if (results.Content.Contains("503 Service"))
|
||||
if (results.ContentString.Contains("503 Service"))
|
||||
{
|
||||
throw new ExceptionWithConfigData(results.Content, configData);
|
||||
throw new ExceptionWithConfigData(results.ContentString, configData);
|
||||
}
|
||||
else if (results.Content.Contains("href=\"/login\""))
|
||||
else if (results.ContentString.Contains("href=\"/login\""))
|
||||
{
|
||||
// Re-login
|
||||
await ApplyConfiguration(null);
|
||||
|
@ -288,7 +288,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
logger.Debug("> Searching: " + searchString);
|
||||
var response = await PostDataWithCookies(url: ApiUrl, data: data);
|
||||
if (response.Content == null)
|
||||
if (response.ContentString == null)
|
||||
{
|
||||
logger.Debug("> Empty series response for query: " + searchString);
|
||||
continue;
|
||||
|
@ -296,7 +296,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var json = JToken.Parse(response.Content);
|
||||
var json = JToken.Parse(response.ContentString);
|
||||
if (json == null || json.Type == JTokenType.Array)
|
||||
{
|
||||
logger.Debug("> Invalid response for query: " + searchString);
|
||||
|
@ -378,7 +378,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
}
|
||||
while (--searchKeywords > 0);
|
||||
|
@ -399,7 +399,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(results.Content);
|
||||
var document = parser.ParseDocument(results.ContentString);
|
||||
var rows = document.QuerySelectorAll("div.row");
|
||||
|
||||
foreach (var row in rows)
|
||||
|
@ -413,7 +413,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -428,7 +428,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(results.Content);
|
||||
var document = parser.ParseDocument(results.ContentString);
|
||||
|
||||
var playButton = document.QuerySelector("div.external-btn");
|
||||
if (playButton != null && !playButton.ClassList.Contains("inactive"))
|
||||
|
@ -460,7 +460,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -476,7 +476,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(results.Content);
|
||||
var document = parser.ParseDocument(results.ContentString);
|
||||
var seasons = document.QuerySelectorAll("div.serie-block");
|
||||
var rowSelector = "table.movie-parts-list > tbody > tr";
|
||||
|
||||
|
@ -604,7 +604,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -627,19 +627,19 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
// Get redirection page with generated link on it. This link can't be constructed manually as it contains Hash field and hashing algo is unknown.
|
||||
var results = await RequestStringWithCookies(url);
|
||||
if (results.Content == null)
|
||||
if (results.ContentString == null)
|
||||
{
|
||||
throw new ExceptionWithConfigData("Empty response from " + url, configData);
|
||||
}
|
||||
if (results.Content == "log in first")
|
||||
if (results.ContentString == "log in first")
|
||||
{
|
||||
throw new ExceptionWithConfigData(results.Content, configData);
|
||||
throw new ExceptionWithConfigData(results.ContentString, configData);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(results.Content);
|
||||
var document = parser.ParseDocument(results.ContentString);
|
||||
var meta = document.QuerySelector("meta");
|
||||
var metaContent = meta.GetAttribute("content");
|
||||
|
||||
|
@ -649,7 +649,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
// Failure path
|
||||
|
@ -665,7 +665,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(results.Content);
|
||||
var document = parser.ParseDocument(results.ContentString);
|
||||
var rows = document.QuerySelectorAll("div.inner-box--item");
|
||||
|
||||
logger.Debug("> Parsing " + rows.Count().ToString() + " releases");
|
||||
|
@ -756,7 +756,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -103,15 +103,15 @@ namespace Jackett.Common.Indexers
|
|||
// Eg https://www.mejortorrentt.net/peli-descargar-torrent-11995-Harry-Potter-y-la-piedra-filosofal.html
|
||||
var result = await RequestStringWithCookies(downloadUrl);
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
downloadUrl = SiteLink + dom.QuerySelector("a[href*=\"sec=descargas\"]").GetAttribute("href");
|
||||
|
||||
// Eg https://www.mejortorrentt.net/secciones.php?sec=descargas&ap=contar&tabla=peliculas&id=11995&link_bajar=1
|
||||
result = await RequestStringWithCookies(downloadUrl);
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
dom = parser.ParseDocument(result.Content);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
dom = parser.ParseDocument(result.ContentString);
|
||||
downloadUrl = SiteLink + dom.QuerySelector("a[href^=\"/tor/\"]").GetAttribute("href");
|
||||
|
||||
// Eg https://www.mejortorrentt.net/tor/peliculas/Harry_Potter_1_y_la_Piedra_Filosofal_MicroHD_1080p.torrent
|
||||
|
@ -125,11 +125,11 @@ namespace Jackett.Common.Indexers
|
|||
var url = SiteLink + NewTorrentsUrl;
|
||||
var result = await RequestStringWithCookies(url);
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
try
|
||||
{
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
|
||||
var container = doc.QuerySelector("#main_table_center_center1 table div");
|
||||
var parsedCommentsLink = new List<string>();
|
||||
|
@ -167,7 +167,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -182,12 +182,12 @@ namespace Jackett.Common.Indexers
|
|||
var url = SiteLink + SearchUrl + "?" + qc.GetQueryString();
|
||||
var result = await RequestStringWithCookies(url);
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
try
|
||||
{
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
|
||||
var table = doc.QuerySelector("#main_table_center_center2 table table");
|
||||
// check the search term is valid
|
||||
|
@ -214,7 +214,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -261,10 +261,10 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var result = await RequestStringWithCookies(commentsLink);
|
||||
if (result.Status != HttpStatusCode.OK)
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
var searchResultParser = new HtmlParser();
|
||||
var doc = searchResultParser.ParseDocument(result.Content);
|
||||
var doc = searchResultParser.ParseDocument(result.ContentString);
|
||||
|
||||
var rows = doc.QuerySelectorAll("#main_table_center_center1 table table table tr");
|
||||
foreach (var row in rows)
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var response = JsonConvert.DeserializeObject<MilkieResponse>(jsonResponse.Content);
|
||||
var response = JsonConvert.DeserializeObject<MilkieResponse>(jsonResponse.ContentString);
|
||||
|
||||
var dlQueryParams = new NameValueCollection
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
OnParseError(jsonResponse.Content, ex);
|
||||
OnParseError(jsonResponse.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -63,13 +63,13 @@ namespace Jackett.Common.Indexers
|
|||
var preRequest = await RequestStringWithCookiesAndRetry(LoginUrl, string.Empty);
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, preRequest.Cookies, true, SearchUrl, SiteLink);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("status\":\"success\""), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("status\":\"success\""), () =>
|
||||
{
|
||||
if (result.Content.Contains("Your IP address has been banned."))
|
||||
if (result.ContentString.Contains("Your IP address has been banned."))
|
||||
throw new ExceptionWithConfigData("Your IP address has been banned.", ConfigData);
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
foreach (var element in dom.QuerySelectorAll("#loginform > table"))
|
||||
element.Remove();
|
||||
var errorMessage = dom.QuerySelector("#loginform").TextContent.Trim().Replace("\n\t", " ");
|
||||
|
@ -145,7 +145,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(response.Content);
|
||||
var document = parser.ParseDocument(response.ContentString);
|
||||
var groups = document.QuerySelectorAll(".torrent_table > tbody > tr.group");
|
||||
var torrents = document.QuerySelectorAll(".torrent_table > tbody > tr.torrent");
|
||||
|
||||
|
@ -243,7 +243,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,10 +79,10 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Cookies.Contains("pass=") && !result.Cookies.Contains("deleted"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.Cookies.Contains("pass=") && !result.Cookies.Contains("deleted"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("div.myFrame-content").InnerHtml;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -127,7 +127,7 @@ namespace Jackett.Common.Indexers
|
|||
response = await RequestStringWithCookies(searchUrl);
|
||||
}
|
||||
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
|
|
|
@ -200,12 +200,12 @@ namespace Jackett.Common.Indexers
|
|||
urlSearch += $"?{qParams.GetQueryString()}";
|
||||
|
||||
var response = await RequestStringWithCookiesAndRetry(urlSearch);
|
||||
if (response.Content.StartsWith("Error"))
|
||||
throw new Exception(response.Content);
|
||||
if (response.ContentString.StartsWith("Error"))
|
||||
throw new Exception(response.ContentString);
|
||||
|
||||
try
|
||||
{
|
||||
var jsonContent = JObject.Parse(response.Content);
|
||||
var jsonContent = JObject.Parse(response.ContentString);
|
||||
var sitelink = new Uri(SiteLink);
|
||||
|
||||
var error = jsonContent.Value<string>("error");
|
||||
|
@ -281,7 +281,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -113,10 +113,10 @@ namespace Jackett.Common.Indexers
|
|||
pairs.Add("2factor", configData.TwoFactor.Value);
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: SiteLink);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("profile.php") == true, () =>
|
||||
result.Cookies, result.ContentString?.Contains("profile.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var msgContainer = dom.QuerySelector("#hibauzenet table tbody tr")?.Children[1];
|
||||
throw new ExceptionWithConfigData(msgContainer?.TextContent ?? "Error while trying to login.", configData);
|
||||
});
|
||||
|
@ -168,7 +168,7 @@ namespace Jackett.Common.Indexers
|
|||
pairs.Add("kivalasztott_tipus[]", string.Join(",", cats));
|
||||
var results = await PostDataWithCookiesAndRetry(SearchUrl, pairs.ToEnumerable(true));
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
|
||||
// find number of torrents / page
|
||||
var torrentPerPage = dom.QuerySelectorAll(".box_torrent").Length;
|
||||
|
@ -214,7 +214,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll(".box_torrent").Skip(previouslyParsedOnPage).Take(limit - alreadyFound);
|
||||
|
||||
var key = ParseUtil.GetArgumentFromQueryString(
|
||||
|
@ -333,7 +333,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -60,12 +60,12 @@ namespace Jackett.Common.Indexers
|
|||
CookieHeader = string.Empty;
|
||||
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl);
|
||||
|
||||
await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(response.Cookies, response.ContentString != null && response.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var document = parser.ParseDocument(response.Content);
|
||||
var document = parser.ParseDocument(response.ContentString);
|
||||
var messageEl = document.QuerySelector("form > span[class='warning']");
|
||||
var errorMessage = response.Content;
|
||||
var errorMessage = response.ContentString;
|
||||
if (messageEl != null)
|
||||
errorMessage = messageEl.TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -75,14 +75,14 @@ namespace Jackett.Common.Indexers
|
|||
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
||||
{
|
||||
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
|
||||
if (!loggedInCheck.Content.Contains("logout.php")) // re-login
|
||||
if (!loggedInCheck.ContentString.Contains("logout.php")) // re-login
|
||||
await DoLogin();
|
||||
|
||||
// #6413
|
||||
var url = $"{SearchUrl}&searchtext={WebUtility.UrlEncode(query.GetQueryString())}";
|
||||
|
||||
var response = await RequestStringWithCookiesAndRetry(url);
|
||||
var releases = ParseResponse(response.Content);
|
||||
var releases = ParseResponse(response.ContentString);
|
||||
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var results = await RequestStringWithCookiesAndRetry(linkParam.AbsoluteUri);
|
||||
|
||||
var uriLink = ExtractDownloadUri(results.Content, linkParam.AbsoluteUri);
|
||||
var uriLink = ExtractDownloadUri(results.ContentString, linkParam.AbsoluteUri);
|
||||
if (uriLink == null)
|
||||
throw new Exception("Download link not found!");
|
||||
|
||||
|
@ -212,10 +212,10 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var pageUrl = SiteLink + string.Format(_dailyUrl, pg);
|
||||
var results = await RequestStringWithCookiesAndRetry(pageUrl);
|
||||
if (results == null || string.IsNullOrEmpty(results.Content))
|
||||
if (results == null || string.IsNullOrEmpty(results.ContentString))
|
||||
break;
|
||||
|
||||
var items = ParseDailyContent(results.Content);
|
||||
var items = ParseDailyContent(results.ContentString);
|
||||
if (items == null || !items.Any())
|
||||
break;
|
||||
|
||||
|
@ -305,13 +305,13 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
// Episodes list
|
||||
var results = await RequestStringWithCookiesAndRetry(uri.AbsoluteUri);
|
||||
var seriesEpisodesUrl = ParseSeriesListContent(results.Content, seriesName);
|
||||
var seriesEpisodesUrl = ParseSeriesListContent(results.ContentString, seriesName);
|
||||
|
||||
// TV serie list
|
||||
if (!string.IsNullOrEmpty(seriesEpisodesUrl))
|
||||
{
|
||||
results = await RequestStringWithCookiesAndRetry(seriesEpisodesUrl);
|
||||
var items = ParseEpisodesListContent(results.Content);
|
||||
var items = ParseEpisodesListContent(results.ContentString);
|
||||
if (items != null && items.Any())
|
||||
releases.AddRange(items);
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var results = await PostDataWithCookies(searchJsonUrl, queryCollection);
|
||||
var items = ParseSearchJsonContent(results.Content, year);
|
||||
var items = ParseSearchJsonContent(results.ContentString, year);
|
||||
if (!items.Any())
|
||||
break;
|
||||
|
||||
|
|
|
@ -111,10 +111,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("table.tableinborder").InnerHtml;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -161,7 +161,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table.testtable> tbody > tr:has(td.tableb)");
|
||||
|
||||
foreach (var row in rows)
|
||||
|
@ -219,7 +219,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace Jackett.Common.Indexers
|
|||
// Checking ...
|
||||
Output("\n-> Checking logged-in state....");
|
||||
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
|
||||
if (!loggedInCheck.Content.Contains("logout.php"))
|
||||
if (!loggedInCheck.ContentString.Contains("logout.php"))
|
||||
{
|
||||
// Cookie expired, renew session on provider
|
||||
Output("-> Not logged, login now...\n");
|
||||
|
@ -263,7 +263,7 @@ namespace Jackett.Common.Indexers
|
|||
// Getting results & Store content
|
||||
var response = await RequestStringWithCookiesAndRetry(request, ConfigData.CookieHeader.Value);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -260,7 +260,7 @@ namespace Jackett.Common.Indexers
|
|||
// Checking ...
|
||||
Output("\n-> Checking logged-in state....");
|
||||
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
|
||||
if (!loggedInCheck.Content.Contains("logout.php"))
|
||||
if (!loggedInCheck.ContentString.Contains("logout.php"))
|
||||
{
|
||||
// Cookie expired, renew session on provider
|
||||
Output("-> Not logged, login now...\n");
|
||||
|
@ -318,7 +318,7 @@ namespace Jackett.Common.Indexers
|
|||
// Getting results & Store content
|
||||
var response = await RequestStringWithCookiesAndRetry(request, ConfigData.CookieHeader.Value);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -101,10 +101,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, string.Empty, false, null, null, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("/odjava"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("/odjava"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("div.obvet > span.najvecji").TextContent.Trim(); // Prijava ni uspela! obvestilo
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -145,7 +145,7 @@ namespace Jackett.Common.Indexers
|
|||
await FollowIfRedirect(results, null, null, null, true);
|
||||
|
||||
// are we logged in?
|
||||
if (!results.Content.Contains("/odjava"))
|
||||
if (!results.ContentString.Contains("/odjava"))
|
||||
{
|
||||
await ApplyConfiguration(null);
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ namespace Jackett.Common.Indexers
|
|||
var RowsSelector = "div.list > div[name=\"torrrow\"]";
|
||||
|
||||
var ResultParser = new HtmlParser();
|
||||
var SearchResultDocument = ResultParser.ParseDocument(results.Content);
|
||||
var SearchResultDocument = ResultParser.ParseDocument(results.ContentString);
|
||||
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
||||
foreach (var Row in Rows)
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
//Iterate over the releases for each movie
|
||||
var jsResults = JObject.Parse(results.Content);
|
||||
var jsResults = JObject.Parse(results.ContentString);
|
||||
foreach (var movie in jsResults["Movies"])
|
||||
{
|
||||
var movieTitle = (string)movie["Title"];
|
||||
|
@ -248,7 +248,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace Jackett.Common.Indexers
|
|||
CookieHeader = ""; // clear old cookies
|
||||
|
||||
var result1 = await RequestStringWithCookies(CaptchaUrl);
|
||||
var json1 = JObject.Parse(result1.Content);
|
||||
var json1 = JObject.Parse(result1.ContentString);
|
||||
var captchaSelection = json1["images"][0]["hash"];
|
||||
|
||||
var pairs = new Dictionary<string, string> {
|
||||
|
@ -88,7 +88,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var result2 = await RequestLoginAndFollowRedirect(LoginUrl, pairs, result1.Cookies, true, null, null, true);
|
||||
|
||||
await ConfigureIfOK(result2.Cookies, result2.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result2.Cookies, result2.ContentString.Contains("logout.php"), () =>
|
||||
throw new ExceptionWithConfigData("Login Failed", configData));
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table.main > tbody > tr");
|
||||
foreach (var row in rows.Skip(1))
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||
var LoginParser = new HtmlParser();
|
||||
var LoginDocument = LoginParser.ParseDocument(loginPage.Content);
|
||||
var LoginDocument = LoginParser.ParseDocument(loginPage.ContentString);
|
||||
|
||||
configData.CaptchaCookie.Value = loginPage.Cookies;
|
||||
|
||||
|
@ -103,10 +103,10 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, configData.CaptchaCookie.Value, true);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var LoginParser = new HtmlParser();
|
||||
var LoginDocument = LoginParser.ParseDocument(result.Content);
|
||||
var LoginDocument = LoginParser.ParseDocument(result.ContentString);
|
||||
var errorMessage = LoginDocument.QuerySelector("span.warning[id!=\"no-cookies\"]:has(br)").TextContent;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -148,7 +148,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var IMDBRegEx = new Regex(@"tt(\d+)", RegexOptions.Compiled);
|
||||
var hParser = new HtmlParser();
|
||||
var ResultDocument = hParser.ParseDocument(results.Content);
|
||||
var ResultDocument = hParser.ParseDocument(results.ContentString);
|
||||
try
|
||||
{
|
||||
var Groups = ResultDocument.QuerySelectorAll("div.browsePoster");
|
||||
|
@ -207,7 +207,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
await ConfigureIfOK(result.Cookies, result.Cookies?.Contains("id=") == true, () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
var errorMessage = result.ContentString;
|
||||
if (errorMessage.Contains("Error!"))
|
||||
errorMessage = "E-mail or password is incorrect";
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
|
@ -112,10 +112,10 @@ namespace Jackett.Common.Indexers
|
|||
result = await RequestStringWithCookiesAndRetry(searchUrl, null, SearchUrl);
|
||||
}
|
||||
|
||||
if (!result.Content.StartsWith("{")) // not JSON => error
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
if (!result.ContentString.StartsWith("{")) // not JSON => error
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
try
|
||||
{
|
||||
var torrents = json["torrents"]; // latest torrents
|
||||
|
|
|
@ -185,7 +185,7 @@ namespace Jackett.Common.Indexers
|
|||
configData.CookieHeader.Value = null;
|
||||
var response = await RequestStringWithCookies(LoginUrl);
|
||||
var LoginResultParser = new HtmlParser();
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(response.Content);
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(response.ContentString);
|
||||
var captchaimg = LoginResultDocument.QuerySelector("img[src*=\"/captcha/\"]");
|
||||
if (captchaimg != null)
|
||||
{
|
||||
|
@ -226,12 +226,12 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("Вы зашли как:"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("Вы зашли как:"), () =>
|
||||
{
|
||||
logger.Debug(result.Content);
|
||||
logger.Debug(result.ContentString);
|
||||
var errorMessage = "Unknown error message, please report";
|
||||
var LoginResultParser = new HtmlParser();
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(result.Content);
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(result.ContentString);
|
||||
var errormsg = LoginResultDocument.QuerySelector("h4[class=\"warnColor1 tCenter mrg_16\"]");
|
||||
if (errormsg != null)
|
||||
errorMessage = errormsg.TextContent;
|
||||
|
@ -261,7 +261,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + "?" + queryCollection.GetQueryString();
|
||||
var results = await RequestStringWithCookies(searchUrl);
|
||||
if (!results.Content.Contains("Вы зашли как:"))
|
||||
if (!results.ContentString.Contains("Вы зашли как:"))
|
||||
{
|
||||
// re login
|
||||
await ApplyConfiguration(null);
|
||||
|
@ -272,7 +272,7 @@ namespace Jackett.Common.Indexers
|
|||
var RowsSelector = "table#tor-tbl > tbody > tr";
|
||||
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.Content);
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.ContentString);
|
||||
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
||||
foreach (var Row in Rows)
|
||||
{
|
||||
|
@ -327,7 +327,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -338,7 +338,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var downloadlink = link;
|
||||
var response = await RequestStringWithCookies(link.ToString());
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results);
|
||||
var downloadSelector = "a[class=\"dl-stub dl-link\"]";
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace Jackett.Common.Indexers
|
|||
var loginCookies = result.Cookies;
|
||||
await FollowIfRedirect(result, LoginUrl, null, loginCookies);
|
||||
|
||||
await ConfigureIfOK(loginCookies, result.Content?.Contains("logout.php") == true,
|
||||
await ConfigureIfOK(loginCookies, result.ContentString?.Contains("logout.php") == true,
|
||||
() => throw new ExceptionWithConfigData("Login failed", configData));
|
||||
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
|
@ -211,7 +211,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table > tbody > tr.browse");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -258,7 +258,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace Jackett.Common.Indexers
|
|||
await RenewalTokenAsync();
|
||||
|
||||
var response = await RequestStringWithCookiesAndRetry(BuildSearchUrl(query));
|
||||
var jsonContent = JObject.Parse(response.Content);
|
||||
var jsonContent = JObject.Parse(response.ContentString);
|
||||
var errorCode = jsonContent.Value<int>("error_code");
|
||||
switch (errorCode)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ namespace Jackett.Common.Indexers
|
|||
case 4: // invalid token
|
||||
await RenewalTokenAsync(true); // force renewal token
|
||||
response = await RequestStringWithCookiesAndRetry(BuildSearchUrl(query));
|
||||
jsonContent = JObject.Parse(response.Content);
|
||||
jsonContent = JObject.Parse(response.ContentString);
|
||||
break;
|
||||
case 10: // imdb not found, see issue #1486
|
||||
case 20: // no results found
|
||||
|
@ -139,7 +139,7 @@ namespace Jackett.Common.Indexers
|
|||
// because we can't distinguish between search without results and api malfunction
|
||||
return retry ? await PerformQueryWithRetry(query, false) : releases;
|
||||
default:
|
||||
throw new Exception("Unknown error code: " + errorCode + " response: " + response.Content);
|
||||
throw new Exception("Unknown error code: " + errorCode + " response: " + response.ContentString);
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -196,7 +196,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -264,7 +264,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var tokenUrl = ApiEndpoint + "?" + qc.GetQueryString();
|
||||
var result = await RequestStringWithCookiesAndRetry(tokenUrl);
|
||||
var json = JObject.Parse(result.Content);
|
||||
var json = JObject.Parse(result.ContentString);
|
||||
_token = json.Value<string>("token");
|
||||
_lastTokenFetch = DateTime.Now;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace Jackett.Common.Indexers
|
|||
var homePageLoad = await RequestLoginAndFollowRedirect(LandingPageURL, new Dictionary<string, string> { }, null, true, null, SiteLink);
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, homePageLoad.Cookies, true, null, LandingPageURL);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("/logout.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("/logout.php") == true, () =>
|
||||
throw new ExceptionWithConfigData("Login failed! Check the username and password. If they are ok, try logging on the website.", configData));
|
||||
|
||||
// Store RSS key from feed generator page
|
||||
|
@ -208,7 +208,7 @@ namespace Jackett.Common.Indexers
|
|||
{ "feed", "dl" }
|
||||
};
|
||||
var rssPage = await PostDataWithCookies(GetRSSKeyUrl, rssParams, result.Cookies);
|
||||
var match = Regex.Match(rssPage.Content, "(?<=passkey\\=)([a-zA-z0-9]*)");
|
||||
var match = Regex.Match(rssPage.ContentString, "(?<=passkey\\=)([a-zA-z0-9]*)");
|
||||
configData.RSSKey.Value = match.Success ? match.Value : string.Empty;
|
||||
if (string.IsNullOrWhiteSpace(configData.RSSKey.Value))
|
||||
throw new Exception("Failed to get RSS Key");
|
||||
|
@ -233,7 +233,7 @@ namespace Jackett.Common.Indexers
|
|||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
{
|
||||
var rssPage = await RequestStringWithCookiesAndRetry(RSSUrl + configData.RSSKey.Value);
|
||||
var rssDoc = XDocument.Parse(rssPage.Content);
|
||||
var rssDoc = XDocument.Parse(rssPage.ContentString);
|
||||
|
||||
foreach (var item in rssDoc.Descendants("item"))
|
||||
{
|
||||
|
@ -316,7 +316,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("#torrents-table > tbody > tr");
|
||||
|
||||
foreach (var row in rows.Skip(1))
|
||||
|
@ -363,7 +363,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1512,7 +1512,7 @@ namespace Jackett.Common.Indexers
|
|||
configData.CookieHeader.Value = null;
|
||||
var response = await RequestStringWithCookies(LoginUrl);
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(response.Content);
|
||||
var doc = parser.ParseDocument(response.ContentString);
|
||||
var captchaimg = doc.QuerySelector("img[src^=\"https://static.t-ru.org/captcha/\"]");
|
||||
if (captchaimg != null)
|
||||
{
|
||||
|
@ -1557,12 +1557,12 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("id=\"logged-in-username\""), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("id=\"logged-in-username\""), () =>
|
||||
{
|
||||
logger.Debug(result.Content);
|
||||
logger.Debug(result.ContentString);
|
||||
var errorMessage = "Unknown error message, please report";
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(result.Content);
|
||||
var doc = parser.ParseDocument(result.ContentString);
|
||||
var errormsg = doc.QuerySelector("h4[class=\"warnColor1 tCenter mrg_16\"]");
|
||||
if (errormsg != null)
|
||||
errorMessage = errormsg.TextContent;
|
||||
|
@ -1592,7 +1592,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + "?" + queryCollection.GetQueryString();
|
||||
var results = await RequestStringWithCookies(searchUrl);
|
||||
if (!results.Content.Contains("id=\"logged-in-username\""))
|
||||
if (!results.ContentString.Contains("id=\"logged-in-username\""))
|
||||
{
|
||||
// re login
|
||||
await ApplyConfiguration(null);
|
||||
|
@ -1601,7 +1601,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(results.Content);
|
||||
var doc = parser.ParseDocument(results.ContentString);
|
||||
var rows = doc.QuerySelectorAll("table#tor-tbl > tbody > tr");
|
||||
foreach (var row in rows)
|
||||
try
|
||||
|
@ -1696,7 +1696,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -93,12 +93,12 @@ namespace Jackett.Common.Indexers
|
|||
var searchUrl = SearchUrl + qc.GetQueryString();
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
||||
if (response.Content?.Contains("User not found or passkey not set") == true)
|
||||
if (response.ContentString?.Contains("User not found or passkey not set") == true)
|
||||
throw new Exception("The passkey is invalid. Check the indexer configuration.");
|
||||
|
||||
try
|
||||
{
|
||||
var jsonContent = JArray.Parse(response.Content);
|
||||
var jsonContent = JArray.Parse(response.ContentString);
|
||||
foreach (var item in jsonContent)
|
||||
{
|
||||
var title = item.Value<string>("name");
|
||||
|
@ -136,7 +136,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(loginPage.Content);
|
||||
var dom = parser.ParseDocument(loginPage.ContentString);
|
||||
var recaptcha = dom.QuerySelector(".g-recaptcha");
|
||||
if (recaptcha != null)
|
||||
{
|
||||
|
@ -167,10 +167,10 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("logout.php"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("td.text").TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -201,15 +201,15 @@ namespace Jackett.Common.Indexers
|
|||
var results = await RequestStringWithCookies(searchUrl);
|
||||
|
||||
// response without results (the message is misleading)
|
||||
if (results.Content?.Contains("slow down geek!!!") == true)
|
||||
if (results.ContentString?.Contains("slow down geek!!!") == true)
|
||||
return new List<ReleaseInfo>();
|
||||
|
||||
// not logged in
|
||||
if (results.Content == null || !results.Content.Contains("/logout.php"))
|
||||
if (results.ContentString == null || !results.ContentString.Contains("/logout.php"))
|
||||
throw new Exception("The user is not logged in. It is possible that the cookie has expired or you " +
|
||||
"made a mistake when copying it. Please check the settings.");
|
||||
|
||||
return ParseResponse(query, results.Content);
|
||||
return ParseResponse(query, results.ContentString);
|
||||
}
|
||||
|
||||
private List<ReleaseInfo> ParseResponse(TorznabQuery query, string htmlResponse)
|
||||
|
|
|
@ -65,11 +65,11 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
// Get cookie
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("glyphicon-log-out") == true,
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("glyphicon-log-out") == true,
|
||||
() => throw new ExceptionWithConfigData("The username and password entered do not match.", configData));
|
||||
var rssProfile = await RequestStringWithCookiesAndRetry(RSSProfile);
|
||||
var parser = new HtmlParser();
|
||||
var rssDom = parser.ParseDocument(rssProfile.Content);
|
||||
var rssDom = parser.ParseDocument(rssProfile.ContentString);
|
||||
configData.RSSKey.Value = rssDom.QuerySelector(".col-sm-9:nth-of-type(1)").TextContent.Trim();
|
||||
if (string.IsNullOrWhiteSpace(configData.RSSKey.Value))
|
||||
throw new ExceptionWithConfigData("Failed to find RSS key.", configData);
|
||||
|
@ -92,7 +92,7 @@ namespace Jackett.Common.Indexers
|
|||
results = await PostDataWithCookiesAndRetry(SearchUrl, pairs, null, TorrentsUrl);
|
||||
results = await ReloginIfNecessary(results);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var shows = dom.QuerySelectorAll("div.show[data-id]");
|
||||
foreach (var show in shows)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ namespace Jackett.Common.Indexers
|
|||
results = await RequestStringWithCookies(searchUrl);
|
||||
results = await ReloginIfNecessary(results);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll(
|
||||
string.IsNullOrWhiteSpace(queryString) ? "#torrent-table tr" : "table tr");
|
||||
var globalFreeleech =
|
||||
|
@ -161,7 +161,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
foreach (var release in releases)
|
||||
release.Category = release.Title.Contains("1080p") || release.Title.Contains("720p")
|
||||
|
@ -172,7 +172,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
private async Task<WebClientStringResult> ReloginIfNecessary(WebClientStringResult response)
|
||||
{
|
||||
if (response.Content.Contains("onclick=\"document.location='logout'\""))
|
||||
if (response.ContentString.Contains("onclick=\"document.location='logout'\""))
|
||||
return response;
|
||||
|
||||
await ApplyConfiguration(null);
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
xmlDoc.LoadXml(result.Content);
|
||||
xmlDoc.LoadXml(result.ContentString);
|
||||
foreach (XmlNode node in xmlDoc.GetElementsByTagName("item"))
|
||||
{
|
||||
//TODO revisit for refactoring
|
||||
|
@ -105,7 +105,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(result.Content, ex);
|
||||
OnParseError(result.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
var json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
if (!(json is JObject) || !(json["results"] is JArray) || json["results"] == null)
|
||||
throw new Exception("Server error");
|
||||
return (JArray)json["results"];
|
||||
|
@ -88,7 +88,7 @@ namespace Jackett.Common.Indexers
|
|||
catch (Exception e)
|
||||
{
|
||||
logger.Error("CheckResponse() Error: ", e.Message);
|
||||
throw new ExceptionWithConfigData(result.Content, ConfigData);
|
||||
throw new ExceptionWithConfigData(result.ContentString, ConfigData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl1, pairs, null, true, null, SiteLink);
|
||||
var tokenRegex = new Regex(@"name=\\""a\\"" value=\\""([^""]+)\\""");
|
||||
var matches = tokenRegex.Match(result.Content);
|
||||
var matches = tokenRegex.Match(result.ContentString);
|
||||
if (!matches.Success)
|
||||
throw new Exception("Error parsing the login form");
|
||||
var token = matches.Groups[1].Value;
|
||||
|
@ -116,12 +116,12 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
result = await RequestLoginAndFollowRedirect(LoginUrl2, pairs, result.Cookies, true, null, SiteLink);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("/browse.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("/browse.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("h5")?.TextContent;
|
||||
if (result.Content.Contains("Wrong Captcha!"))
|
||||
if (result.ContentString.Contains("Wrong Captcha!"))
|
||||
errorMessage = "Captcha required due to a failed login attempt. Login via a browser to whitelist your IP and then reconfigure Jackett.";
|
||||
throw new Exception(errorMessage);
|
||||
});
|
||||
|
@ -152,7 +152,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + string.Join("/", qc);
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
if (!response.Content.Contains("/logout.php")) // re-login
|
||||
if (!response.ContentString.Contains("/logout.php")) // re-login
|
||||
{
|
||||
await DoLogin();
|
||||
response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
@ -161,7 +161,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll("div.boxContent > table > tbody > tr");
|
||||
|
||||
foreach (var row in rows)
|
||||
|
@ -205,7 +205,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
//var json = JArray.Parse(results.Content);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(results.Content);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(results.ContentString);
|
||||
foreach (var row in json ?? System.Linq.Enumerable.Empty<dynamic>())
|
||||
{
|
||||
var release = new ReleaseInfo();
|
||||
|
@ -205,7 +205,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: SiteLink);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("Főoldal") == true,
|
||||
result.Cookies, result.ContentString?.Contains("Főoldal") == true,
|
||||
() => throw new ExceptionWithConfigData("Error while trying to login.", configData));
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ namespace Jackett.Common.Indexers
|
|||
* First 3 items per page are total results, results per page, and results this page
|
||||
* There is also a tail of ~4 items after the results for some reason. Looks like \1\\\
|
||||
*/
|
||||
var parameters = results.Content.Split('\\');
|
||||
var parameters = results.ContentString.Split('\\');
|
||||
var torrentsThisPage = int.Parse(parameters[2]);
|
||||
var maxTorrents = Math.Min(torrentsThisPage, limit - alreadyFound);
|
||||
var rows = parameters.Skip(3) //Skip pages info
|
||||
|
@ -164,7 +164,7 @@ namespace Jackett.Common.Indexers
|
|||
queryParams["now"] = DateTimeUtil.DateTimeToUnixTimestamp(DateTime.UtcNow)
|
||||
.ToString(CultureInfo.InvariantCulture);
|
||||
var filesList = (await RequestStringWithCookiesAndRetry(SearchUrl + "?" + queryParams.GetQueryString()))
|
||||
.Content;
|
||||
.ContentString;
|
||||
var firstFileName = filesList.Split(
|
||||
new[]
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -216,7 +216,7 @@ namespace Jackett.Common.Indexers
|
|||
private async Task PopulateImdbMapAsync()
|
||||
{
|
||||
var result = await RequestStringWithCookiesAndRetry(BrowseUrl);
|
||||
foreach (Match match in _seriesInfoMatch.Matches(result.Content))
|
||||
foreach (Match match in _seriesInfoMatch.Matches(result.ContentString))
|
||||
{
|
||||
var internalId = int.Parse(match.Groups["seriesID"].Value);
|
||||
var imdbId = long.Parse(match.Groups["ImdbId"].Value);
|
||||
|
@ -282,7 +282,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var results = await RequestStringWithCookiesAndRetry(SearchUrl + "?" + queryParams.GetQueryString());
|
||||
// Parse page Information from result
|
||||
var content = results.Content;
|
||||
var content = results.ContentString;
|
||||
var splits = content.Split('\\');
|
||||
var totalFound = int.Parse(splits[0]);
|
||||
var torrentPerPage = int.Parse(splits[1]);
|
||||
|
|
|
@ -64,10 +64,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true, () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("form#loginform").TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -100,7 +100,7 @@ namespace Jackett.Common.Indexers
|
|||
var seasonRegEx = new Regex(@$"Season\s+0*{query.Season}[^\d]", RegexOptions.IgnoreCase);
|
||||
|
||||
var parser = new HtmlParser();
|
||||
var doc = parser.ParseDocument(results.Content);
|
||||
var doc = parser.ParseDocument(results.ContentString);
|
||||
var rows = doc.QuerySelectorAll("table.torrent_table > tbody > tr.torrent");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -194,12 +194,12 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout=true"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("logout=true"), () =>
|
||||
{
|
||||
logger.Debug(result.Content);
|
||||
logger.Debug(result.ContentString);
|
||||
var errorMessage = "Unknown error message, please report";
|
||||
var LoginResultParser = new HtmlParser();
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(result.Content);
|
||||
var LoginResultDocument = LoginResultParser.ParseDocument(result.ContentString);
|
||||
var errormsg = LoginResultDocument.QuerySelector("h4[class=\"warnColor1 tCenter mrg_16\"]");
|
||||
if (errormsg != null)
|
||||
errorMessage = errormsg.TextContent;
|
||||
|
@ -233,7 +233,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var searchUrl = SearchUrl + "?" + queryCollection.GetQueryString();
|
||||
var results = await RequestStringWithCookies(searchUrl);
|
||||
if (!results.Content.Contains("logout=true"))
|
||||
if (!results.ContentString.Contains("logout=true"))
|
||||
{
|
||||
// re login
|
||||
await ApplyConfiguration(null);
|
||||
|
@ -244,7 +244,7 @@ namespace Jackett.Common.Indexers
|
|||
var RowsSelector = "table.forumline > tbody > tr[class*=prow]";
|
||||
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.Content);
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.ContentString);
|
||||
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
||||
foreach (var Row in Rows)
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -63,9 +63,9 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("Logged in as: "), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("Logged in as: "), () =>
|
||||
{
|
||||
var errorMessage = result.Content;
|
||||
var errorMessage = result.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
|
@ -110,7 +110,7 @@ namespace Jackett.Common.Indexers
|
|||
var RowsSelector = "div.borderwrap:has(div.maintitle) > table > tbody > tr:has(a[href*=\"index.php?showtopic=\"])";
|
||||
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.Content);
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results.ContentString);
|
||||
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
||||
foreach (var Row in Rows)
|
||||
{
|
||||
|
@ -195,7 +195,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -204,7 +204,7 @@ namespace Jackett.Common.Indexers
|
|||
public override async Task<byte[]> Download(Uri link)
|
||||
{
|
||||
var response = await RequestStringWithCookies(link.ToString());
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results);
|
||||
var downloadSelector = "a[title=\"Download attachment\"]";
|
||||
|
|
|
@ -92,12 +92,12 @@ namespace Jackett.Common.Indexers
|
|||
var loginPage = await RequestStringWithCookies(SiteLink, string.Empty);
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, SiteLink, SiteLink);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content?.Contains("my.php") == true, () =>
|
||||
result.Cookies, result.ContentString?.Contains("my.php") == true, () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var messageEl = dom.QuerySelector("td.embedded");
|
||||
var errorMessage = messageEl != null ? messageEl.TextContent : result.Content;
|
||||
var errorMessage = messageEl != null ? messageEl.TextContent : result.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
|
@ -138,7 +138,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table > tbody:has(tr > td.colhead) > tr:not(:has(td.colhead))");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var rows = JsonConvert.DeserializeObject<dynamic>(results.Content);
|
||||
var rows = JsonConvert.DeserializeObject<dynamic>(results.ContentString);
|
||||
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -109,13 +109,13 @@ namespace Jackett.Common.Indexers
|
|||
pairs.Add("proofcode", configData.CaptchaText.Value);
|
||||
var result = await RequestLoginAndFollowRedirect(
|
||||
IndexUrl, pairs, configData.CaptchaCookie.Value, true, referer: IndexUrl, accumulateCookies: true);
|
||||
if (result.Content == null || (!result.Content.Contains("login_complete") &&
|
||||
!result.Content.Contains("index.php?strWebValue=account&strWebAction=logout")))
|
||||
if (result.ContentString == null || (!result.ContentString.Contains("login_complete") &&
|
||||
!result.ContentString.Contains("index.php?strWebValue=account&strWebAction=logout")))
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessageEl = dom.QuerySelector("table > tbody > tr > td[valign=top][width=100%]");
|
||||
var errorMessage = errorMessageEl != null ? errorMessageEl.InnerHtml : result.Content;
|
||||
var errorMessage = errorMessageEl != null ? errorMessageEl.InnerHtml : result.ContentString;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(IndexUrl, string.Empty);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(loginPage.Content);
|
||||
var dom = parser.ParseDocument(loginPage.ContentString);
|
||||
var qCaptchaImg = dom.QuerySelector("td.tablea > img");
|
||||
if (qCaptchaImg != null)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var dom = parser.ParseDocument(response.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table.torrenttable > tbody > tr");
|
||||
foreach (var row in rows.Skip(1))
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(loginPage.Content);
|
||||
var dom = parser.ParseDocument(loginPage.ContentString);
|
||||
var captcha = dom.QuerySelector(".g-recaptcha");
|
||||
if (captcha != null)
|
||||
{
|
||||
|
@ -169,10 +169,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl);
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("/user/account/logout"), () =>
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("/user/account/logout"), () =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector("p.text-danger:contains(\"Error:\")").TextContent.Trim();
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -200,7 +200,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
||||
if (results.Content.Contains("/user/account/login")) // re-login
|
||||
if (results.ContentString.Contains("/user/account/login")) // re-login
|
||||
{
|
||||
await DoLogin();
|
||||
results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
@ -208,7 +208,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var rows = (JArray)((JObject)JsonConvert.DeserializeObject(results.Content))["torrentList"];
|
||||
var rows = (JArray)((JObject)JsonConvert.DeserializeObject(results.ContentString))["torrentList"];
|
||||
foreach (var row in rows)
|
||||
{
|
||||
var title = row["name"].ToString();
|
||||
|
@ -249,7 +249,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -125,9 +125,9 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var jsonData = JsonConvert.SerializeObject(data);
|
||||
var result = await PostDataWithCookies(APIUrl + endpoint, null, null, SiteLink, APIHeaders, jsonData);
|
||||
if (!result.Content.StartsWith("{")) // not JSON => error
|
||||
throw new ExceptionWithConfigData(result.Content, configData);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(result.Content);
|
||||
if (!result.ContentString.StartsWith("{")) // not JSON => error
|
||||
throw new ExceptionWithConfigData(result.ContentString, configData);
|
||||
dynamic json = JsonConvert.DeserializeObject<dynamic>(result.ContentString);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace Jackett.Common.Indexers
|
|||
LoadValuesFromJson(configJson);
|
||||
var loginPage = await RequestStringWithCookies(TokenUrl);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(loginPage.Content);
|
||||
var dom = parser.ParseDocument(loginPage.ContentString);
|
||||
var token = dom.QuerySelector("form.form-horizontal > span");
|
||||
var csrf = token.Children[1].GetAttribute("value");
|
||||
var pairs = new Dictionary<string, string>
|
||||
|
@ -119,10 +119,10 @@ namespace Jackett.Common.Indexers
|
|||
};
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, accumulateCookies: true);
|
||||
await ConfigureIfOK(
|
||||
result.Cookies, result.Content.Contains("/logout.php?"),
|
||||
result.Cookies, result.ContentString.Contains("/logout.php?"),
|
||||
() =>
|
||||
{
|
||||
var errorDom = parser.ParseDocument(result.Content);
|
||||
var errorDom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = errorDom.QuerySelector("td.colhead2").InnerHtml;
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
|
@ -150,12 +150,12 @@ namespace Jackett.Common.Indexers
|
|||
queryCollection.Add($"cat[{cat}]", "1");
|
||||
searchUrl += "?" + queryCollection.GetQueryString();
|
||||
var response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
var results = response.Content;
|
||||
var results = response.ContentString;
|
||||
if (!results.Contains("/logout.php?"))
|
||||
{
|
||||
await ApplyConfiguration(null);
|
||||
response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
results = response.Content;
|
||||
results = response.ContentString;
|
||||
}
|
||||
|
||||
try
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace Jackett.Common.Indexers
|
|||
CookieHeader = "";
|
||||
|
||||
var result1 = await RequestStringWithCookies(CaptchaUrl);
|
||||
var json1 = JObject.Parse(result1.Content);
|
||||
var json1 = JObject.Parse(result1.ContentString);
|
||||
var captchaSelection = json1["images"][0]["hash"];
|
||||
|
||||
var pairs = new Dictionary<string, string> {
|
||||
|
@ -124,8 +124,8 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
var result2 = await RequestLoginAndFollowRedirect(LoginUrl, pairs, result1.Cookies, true, null, null, true);
|
||||
|
||||
await ConfigureIfOK(result2.Cookies, result2.Content.Contains("/logout.php"),
|
||||
() => throw new ExceptionWithConfigData(result2.Content, configData));
|
||||
await ConfigureIfOK(result2.Cookies, result2.ContentString.Contains("/logout.php"),
|
||||
() => throw new ExceptionWithConfigData(result2.ContentString, configData));
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.Content);
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table.torrent_table > tbody > tr");
|
||||
var globalFreeleech = dom.QuerySelector("legend:contains(\"Freeleech\")+ul > li > b:contains(\"Freeleech\")") != null;
|
||||
foreach (var row in rows.Skip(1))
|
||||
|
@ -242,7 +242,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
OnParseError(results.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
try
|
||||
{
|
||||
var jsonStart = response.Content;
|
||||
var jsonStart = response.ContentString;
|
||||
var jsonContent = JArray.Parse(jsonStart);
|
||||
|
||||
foreach (var torrent in jsonContent)
|
||||
|
@ -156,7 +156,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
return releases;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var loginPage = await RequestStringWithCookies(LandingUrl);
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(loginPage.Content);
|
||||
var dom = parser.ParseDocument(loginPage.ContentString);
|
||||
var qCaptchaImg = dom.QuerySelector("img#regimage");
|
||||
if (qCaptchaImg != null)
|
||||
{
|
||||
|
@ -169,11 +169,11 @@ namespace Jackett.Common.Indexers
|
|||
|
||||
//var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, SiteLink, true);
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, SearchUrl, LandingUrl, true);
|
||||
await ConfigureIfOK(result.Cookies, result.Content?.Contains("logout.php") == true,
|
||||
await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("logout.php") == true,
|
||||
() =>
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(result.Content);
|
||||
var dom = parser.ParseDocument(result.ContentString);
|
||||
var errorMessage = dom.QuerySelector(".left_side table:nth-of-type(1) tr:nth-of-type(2)")?.TextContent.Trim().Replace("\n\t", " ");
|
||||
if (string.IsNullOrWhiteSpace(errorMessage))
|
||||
errorMessage = dom.QuerySelector("div.notification-body").TextContent.Trim().Replace("\n\t", " ");
|
||||
|
@ -190,7 +190,7 @@ namespace Jackett.Common.Indexers
|
|||
{"showrows", "50"}
|
||||
};
|
||||
var rssPage = await PostDataWithCookies(GetRSSKeyUrl, rssParams, result.Cookies);
|
||||
var match = Regex.Match(rssPage.Content, "(?<=secret_key\\=)([a-zA-z0-9]*)");
|
||||
var match = Regex.Match(rssPage.ContentString, "(?<=secret_key\\=)([a-zA-z0-9]*)");
|
||||
configData.RSSKey.Value = match.Success ? match.Value : string.Empty;
|
||||
if (string.IsNullOrWhiteSpace(configData.RSSKey.Value))
|
||||
throw new Exception("Failed to get RSS Key");
|
||||
|
@ -238,7 +238,7 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(searchPage.Content);
|
||||
var dom = parser.ParseDocument(searchPage.ContentString);
|
||||
var rows = dom.QuerySelectorAll("table#sortabletable > tbody > tr:has(div > a[href*=\"details.php?id=\"])");
|
||||
foreach (var row in rows)
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(searchPage.Content, ex);
|
||||
OnParseError(searchPage.ContentString, ex);
|
||||
}
|
||||
|
||||
if (!CookieHeader.Trim().Equals(prevCook.Trim()))
|
||||
|
|
|
@ -490,10 +490,10 @@ namespace Jackett.Common.Indexers
|
|||
// Request our first page
|
||||
var results = await webclient.GetString(myIndexRequest);
|
||||
if (results.Status == HttpStatusCode.InternalServerError) // See issue #2110
|
||||
throw new Exception("Internal Server Error (" + results.Content + "), probably you reached the API limits, please reduce the number of queries");
|
||||
throw new Exception("Internal Server Error (" + results.ContentString + "), probably you reached the API limits, please reduce the number of queries");
|
||||
|
||||
// Return results from tracker
|
||||
return results.Content;
|
||||
return results.ContentString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -104,8 +104,8 @@ namespace Jackett.Common.Indexers
|
|||
try
|
||||
{
|
||||
// returned content might start with an html error message, remove it first
|
||||
var jsonStart = response.Content.IndexOf('{');
|
||||
var jsonContentStr = response.Content.Remove(0, jsonStart);
|
||||
var jsonStart = response.ContentString.IndexOf('{');
|
||||
var jsonContentStr = response.ContentString.Remove(0, jsonStart);
|
||||
|
||||
var jsonContent = JObject.Parse(jsonContentStr);
|
||||
|
||||
|
@ -209,7 +209,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(response.Content, ex);
|
||||
OnParseError(response.ContentString, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Jackett.Common.Services
|
|||
Encoding = Encoding.UTF8
|
||||
};
|
||||
var result = await WebClient.GetString(request);
|
||||
var movie = JsonConvert.DeserializeObject<Movie>(result.Content);
|
||||
var movie = JsonConvert.DeserializeObject<Movie>(result.ContentString);
|
||||
|
||||
return movie;
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace Jackett.Common.Services
|
|||
logger.Error("Failed to get the release list: " + response.Status);
|
||||
}
|
||||
|
||||
var releases = JsonConvert.DeserializeObject<List<Release>>(response.Content);
|
||||
var releases = JsonConvert.DeserializeObject<List<Release>>(response.ContentString);
|
||||
|
||||
if (!serverConfig.UpdatePrerelease)
|
||||
{
|
||||
|
|
|
@ -152,13 +152,13 @@ namespace Jackett.Common.Utils.Clients
|
|||
if (result.Content != null)
|
||||
decodedContent = encoding.GetString(result.Content);
|
||||
|
||||
stringResult.Content = decodedContent;
|
||||
stringResult.ContentString = decodedContent;
|
||||
logger.Debug(string.Format("WebClient({0}): Returning {1} => {2}", ClientType, result.Status, (result.IsRedirect ? result.RedirectingTo + " " : "") + (decodedContent == null ? "<NULL>" : decodedContent)));
|
||||
|
||||
if (stringResult.Headers.TryGetValue("server", out var server))
|
||||
{
|
||||
if (server[0] == "cloudflare-nginx")
|
||||
stringResult.Content = BrowserUtil.DecodeCloudFlareProtectedEmailFromHTML(stringResult.Content);
|
||||
stringResult.ContentString = BrowserUtil.DecodeCloudFlareProtectedEmailFromHTML(stringResult.ContentString);
|
||||
}
|
||||
return stringResult;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@ namespace Jackett.Common.Utils.Clients
|
|||
{
|
||||
public class WebClientStringResult : BaseWebResult
|
||||
{
|
||||
public string Content { get; set; }
|
||||
public string ContentString { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,18 +73,18 @@ namespace Jackett.Server
|
|||
// TODO: fix deprecation warning (remove #pragma to see the build warning)
|
||||
Mapper.Initialize(cfg =>
|
||||
{
|
||||
cfg.CreateMap<WebClientByteResult, WebClientStringResult>().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((be, str) =>
|
||||
cfg.CreateMap<WebClientByteResult, WebClientStringResult>().ForMember(x => x.ContentString, opt => opt.Ignore()).AfterMap((be, str) =>
|
||||
{
|
||||
var encoding = be.Request.Encoding ?? Encoding.UTF8;
|
||||
str.Content = encoding.GetString(be.Content);
|
||||
str.ContentString = encoding.GetString(be.Content);
|
||||
});
|
||||
|
||||
cfg.CreateMap<WebClientStringResult, WebClientByteResult>().ForMember(x => x.Content, opt => opt.Ignore()).AfterMap((str, be) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(str.Content))
|
||||
if (!string.IsNullOrEmpty(str.ContentString))
|
||||
{
|
||||
var encoding = str.Request.Encoding ?? Encoding.UTF8;
|
||||
be.Content = encoding.GetBytes(str.Content);
|
||||
be.Content = encoding.GetBytes(str.ContentString);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue