mirror of
https://github.com/Jackett/Jackett
synced 2025-03-10 14:14:25 +00:00
bjshare: fix re-login on every redirect (#9112)
This commit is contained in:
parent
e863537ac2
commit
67bf90d0bd
1 changed files with 7 additions and 2 deletions
|
@ -219,6 +219,11 @@ namespace Jackett.Common.Indexers
|
|||
return title;
|
||||
}
|
||||
|
||||
private bool IsSessionIsClosed(WebClientStringResult result)
|
||||
{
|
||||
return result.IsRedirect && result.RedirectingTo.Contains("login.php");
|
||||
}
|
||||
|
||||
private string FixSearchTerm(TorznabQuery query)
|
||||
{
|
||||
if (query.IsImdbQuery)
|
||||
|
@ -253,7 +258,7 @@ namespace Jackett.Common.Indexers
|
|||
queryCollection.Add("filter_cat[" + cat + "]", "1");
|
||||
searchUrl += "?" + queryCollection.GetQueryString();
|
||||
var results = await RequestStringWithCookies(searchUrl);
|
||||
if (results.IsRedirect)
|
||||
if (IsSessionIsClosed(results))
|
||||
{
|
||||
// re-login
|
||||
await ApplyConfiguration(null);
|
||||
|
@ -385,7 +390,7 @@ namespace Jackett.Common.Indexers
|
|||
{
|
||||
var releases = new List<ReleaseInfo>();
|
||||
var results = await RequestStringWithCookies(TodayUrl);
|
||||
if (results.IsRedirect)
|
||||
if (IsSessionIsClosed(results))
|
||||
{
|
||||
// re-login
|
||||
await ApplyConfiguration(null);
|
||||
|
|
Loading…
Add table
Reference in a new issue