diff --git a/src/Jackett.Common/Indexers/SpeedCD.cs b/src/Jackett.Common/Indexers/SpeedCD.cs index f1e53d406..78e5cdee2 100644 --- a/src/Jackett.Common/Indexers/SpeedCD.cs +++ b/src/Jackett.Common/Indexers/SpeedCD.cs @@ -37,8 +37,6 @@ namespace Jackett.Common.Indexers public override TorznabCapabilities TorznabCaps => SetCapabilities(); - private string LoginUrl1 => SiteLink + "login"; - private string LoginUrl2 => SiteLink + "login/API"; private string SearchUrl => SiteLink + "browse/"; private new ConfigurationDataSpeedCD configData => (ConfigurationDataSpeedCD)base.configData; @@ -51,10 +49,10 @@ namespace Jackett.Common.Indexers p: ps, cacheService: cs, configData: new ConfigurationDataSpeedCD( - @"Speed.Cd have increased their security. If you are having problems please check the security tab in your + @"Speed.Cd have increased their security. If you are having problems please check the security tab in your Speed.Cd profile. Eg. Geo Locking, your seedbox may be in a different country to the one where you login via your web browser.

For best results, change the 'Torrents per page' setting to 100 in
'Profile Settings > Torrents'. -

This site may use Cloudflare DDoS Protection, therefore Jackett requires
This site may use Cloudflare DDoS Protection, therefore Jackett requires
FlareSolverr to access it.")) { } @@ -127,24 +125,38 @@ namespace Jackett.Common.Indexers private async Task DoLogin() { // first request with username - var pairs = new Dictionary - { - { "username", configData.Username.Value } - }; - var result = await RequestLoginAndFollowRedirect(LoginUrl1, pairs, null, true, null, SiteLink); + var result = await RequestLoginAndFollowRedirect( + $"{SiteLink.TrimEnd('/')}/checkpoint/API", + new Dictionary + { + { "username", configData.Username.Value } + }, + null, + true, + null, + SiteLink); + var tokenRegex = new Regex(@"name=\\""a\\"" value=\\""([^""]+)\\"""); var matches = tokenRegex.Match(result.ContentString); if (!matches.Success) + { throw new Exception("Error parsing the login form"); + } + var token = matches.Groups[1].Value; // second request with token and password - pairs = new Dictionary - { - { "pwd", configData.Password.Value }, - { "a", token } - }; - result = await RequestLoginAndFollowRedirect(LoginUrl2, pairs, result.Cookies, true, null, SiteLink); + result = await RequestLoginAndFollowRedirect( + $"{SiteLink.TrimEnd('/')}/checkpoint/", + new Dictionary + { + { "pwd", configData.Password.Value }, + { "a", token } + }, + result.Cookies, + true, + null, + SiteLink); await ConfigureIfOK(result.Cookies, result.ContentString?.Contains("/browse.php") == true, () => { @@ -153,7 +165,9 @@ namespace Jackett.Common.Indexers var errorMessage = dom.QuerySelector("h5")?.TextContent; if (result.ContentString.Contains("Wrong Captcha!")) + { errorMessage = "Captcha required due to a failed login attempt. Login via a browser to whitelist your IP and then reconfigure Jackett."; + } throw new Exception(errorMessage ?? "Login failed."); }); @@ -168,13 +182,19 @@ namespace Jackett.Common.Indexers var catList = MapTorznabCapsToTrackers(query); foreach (var cat in catList) + { qc.Add(cat); + } if (configData.Freeleech.Value) + { qc.Add("freeleech"); + } if (configData.ExcludeArchives.Value) + { qc.Add("norar"); + } if (query.IsImdbQuery) { @@ -185,7 +205,9 @@ namespace Jackett.Common.Indexers term += $" {query.GetEpisodeSearchString()}"; if (query.Season > 0 && string.IsNullOrEmpty(query.Episode)) + { term += "*"; + } } qc.Add("deep"); @@ -197,7 +219,9 @@ namespace Jackett.Common.Indexers var term = query.GetQueryString(); if (!string.IsNullOrWhiteSpace(query.GetEpisodeSearchString()) && query.Season > 0 && string.IsNullOrEmpty(query.Episode)) + { term += "*"; + } qc.Add("q"); qc.Add(WebUtilityHelpers.UrlEncode(term.Trim(), Encoding));