mirror of https://github.com/Jackett/Jackett
SpeedCD: add support for IMDB search
This commit is contained in:
parent
cf1a6ff39d
commit
fbe4d5f1a7
|
@ -43,6 +43,8 @@ namespace Jackett.Indexers
|
|||
Language = "en-us";
|
||||
Type = "private";
|
||||
|
||||
TorznabCaps.SupportsImdbSearch = true;
|
||||
|
||||
AddCategoryMapping("1", TorznabCatType.MoviesOther);
|
||||
AddCategoryMapping("42", TorznabCatType.Movies);
|
||||
AddCategoryMapping("32", TorznabCatType.Movies);
|
||||
|
@ -101,19 +103,16 @@ namespace Jackett.Indexers
|
|||
|
||||
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
||||
{
|
||||
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
|
||||
if (!loggedInCheck.Content.Contains("/logout.php"))
|
||||
{
|
||||
//Cookie appears to expire after a period of time or logging in to the site via browser
|
||||
await DoLogin();
|
||||
}
|
||||
|
||||
|
||||
var releases = new List<ReleaseInfo>();
|
||||
|
||||
NameValueCollection qParams = new NameValueCollection();
|
||||
|
||||
if (!string.IsNullOrEmpty(query.GetQueryString()))
|
||||
if (!string.IsNullOrWhiteSpace(query.ImdbID))
|
||||
{
|
||||
qParams.Add("search", query.ImdbID);
|
||||
qParams.Add("d", "on");
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(query.GetQueryString()))
|
||||
{
|
||||
qParams.Add("search", query.GetQueryString());
|
||||
}
|
||||
|
@ -131,6 +130,12 @@ namespace Jackett.Indexers
|
|||
}
|
||||
|
||||
var response = await RequestStringWithCookiesAndRetry(urlSearch);
|
||||
if (!response.Content.Contains("/logout.php"))
|
||||
{
|
||||
//Cookie appears to expire after a period of time or logging in to the site via browser
|
||||
await DoLogin();
|
||||
response = await RequestStringWithCookiesAndRetry(urlSearch);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue