scenetime: check expired cookie. resolves #8359 (#8374)

This commit is contained in:
Diego Heras
2020-04-26 21:24:05 +02:00
committed by GitHub
parent 1a82f2400d
commit 51263fb2d1

View File

@@ -24,15 +24,10 @@ namespace Jackett.Common.Indexers
private string SearchUrl => SiteLink + "browse.php";
private string DownloadUrl => SiteLink + "download.php/{0}/download.torrent";
private new ConfigurationDataSceneTime configData
{
get => (ConfigurationDataSceneTime)base.configData;
set => base.configData = value;
}
private new ConfigurationDataSceneTime configData => (ConfigurationDataSceneTime)base.configData;
public SceneTime(IIndexerConfigurationService configService, WebClient w, Logger l, IProtectionService ps)
: base(name: "SceneTime",
: base("SceneTime",
description: "Always on time",
link: "https://www.scenetime.com/",
caps: new TorznabCapabilities(),
@@ -118,8 +113,7 @@ namespace Jackett.Common.Indexers
result.Captcha.SiteKey = recaptcha.GetAttribute("data-sitekey");
return result;
}
else
{
var stdResult = new ConfigurationDataBasicLogin
{
SiteLink = { Value = configData.SiteLink.Value },
@@ -129,7 +123,6 @@ namespace Jackett.Common.Indexers
};
return stdResult;
}
}
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{
@@ -147,7 +140,7 @@ namespace Jackett.Common.Indexers
{
var results = await PerformQuery(new TorznabQuery());
if (!results.Any())
throw new Exception("Your cookie did not work");
throw new Exception("Found 0 results in the tracker");
IsConfigured = true;
SaveConfig();
@@ -194,6 +187,10 @@ namespace Jackett.Common.Indexers
var searchUrl = SearchUrl + "?" + qParams.GetQueryString();
var results = await RequestStringWithCookies(searchUrl);
if (results.Content == null || !results.Content.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.");
var releases = ParseResponse(query, results.Content);
return releases;