mejortorrent: dont dump the whole html into the error message when status=500

This commit is contained in:
Garfield69 2024-08-29 06:28:15 +12:00
parent 5857f00b0d
commit f61401069c
1 changed files with 18 additions and 2 deletions

View File

@ -153,7 +153,16 @@ namespace Jackett.Common.Indexers.Definitions
var url = SiteLink + NewTorrentsUrl; var url = SiteLink + NewTorrentsUrl;
var result = await RequestWithCookiesAsync(url); var result = await RequestWithCookiesAsync(url);
if (result.Status != HttpStatusCode.OK) if (result.Status != HttpStatusCode.OK)
{
if (result.Status == HttpStatusCode.InternalServerError)
{
throw new ExceptionWithConfigData("HTTP 500 Internal Server Error", configData);
}
else
{
throw new ExceptionWithConfigData(result.ContentString, configData); throw new ExceptionWithConfigData(result.ContentString, configData);
}
}
try try
{ {
var searchResultParser = new HtmlParser(); var searchResultParser = new HtmlParser();
@ -207,7 +216,14 @@ namespace Jackett.Common.Indexers.Definitions
var url = SiteLink + SearchUrl + i + "?" + qc.GetQueryString(); var url = SiteLink + SearchUrl + i + "?" + qc.GetQueryString();
var result = await RequestWithCookiesAsync(url); var result = await RequestWithCookiesAsync(url);
if (result.Status != HttpStatusCode.OK) if (result.Status != HttpStatusCode.OK)
if (result.Status == HttpStatusCode.InternalServerError)
{
throw new ExceptionWithConfigData("HTTP 500 Internal Server Error", configData);
}
else
{
throw new ExceptionWithConfigData(result.ContentString, configData); throw new ExceptionWithConfigData(result.ContentString, configData);
}
try try
{ {
var searchResultParser = new HtmlParser(); var searchResultParser = new HtmlParser();