mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
TorrentLeech: avoid unnecessary login checks
This commit is contained in:
@@ -107,13 +107,6 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
||||||
{
|
{
|
||||||
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
|
|
||||||
if (!loggedInCheck.Content.Contains("/user/account/logout"))
|
|
||||||
{
|
|
||||||
//Cookie appears to expire after a period of time or logging in to the site via browser
|
|
||||||
await DoLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
var releases = new List<ReleaseInfo>();
|
var releases = new List<ReleaseInfo>();
|
||||||
var searchString = query.GetQueryString();
|
var searchString = query.GetQueryString();
|
||||||
searchString = searchString.Replace('-', ' '); // remove dashes as they exclude search strings
|
searchString = searchString.Replace('-', ' '); // remove dashes as they exclude search strings
|
||||||
@@ -142,6 +135,14 @@ namespace Jackett.Indexers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||||
|
|
||||||
|
if (!results.Content.Contains("/user/account/logout"))
|
||||||
|
{
|
||||||
|
//Cookie appears to expire after a period of time or logging in to the site via browser
|
||||||
|
await DoLogin();
|
||||||
|
results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CQ dom = results.Content;
|
CQ dom = results.Content;
|
||||||
|
Reference in New Issue
Block a user