diff --git a/src/Jackett.Common/Indexers/AwesomeHD.cs b/src/Jackett.Common/Indexers/AwesomeHD.cs index 21893e3e7..b4f196b41 100644 --- a/src/Jackett.Common/Indexers/AwesomeHD.cs +++ b/src/Jackett.Common/Indexers/AwesomeHD.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Xml.Linq; using Jackett.Common.Models; @@ -18,6 +19,7 @@ namespace Jackett.Common.Indexers { private string SearchUrl => SiteLink + "searchapi.php"; private string TorrentUrl => SiteLink + "torrents.php"; + private readonly Regex _removeYearRegex = new Regex(@" [\(\[]?(19|20)\d{2}[\)\]]?$", RegexOptions.Compiled); private new ConfigurationDataPasskey configData => (ConfigurationDataPasskey)base.configData; public AwesomeHD(IIndexerConfigurationService configService, Utils.Clients.WebClient c, Logger l, IProtectionService ps) @@ -75,10 +77,13 @@ namespace Jackett.Common.Indexers } else if (!string.IsNullOrWhiteSpace(query.GetQueryString())) { - var searchTerm = query.SearchTerm; // not use query.GetQueryString(), because it includes the season - if (query.Season > 0) // search for tv series + // not use query.GetQueryString(), because it includes the season + var searchTerm = query.SearchTerm; + // search for tv series + if (query.Season > 0) searchTerm += $": Season {query.Season:D2}"; - + // remove the year, it's not supported in the api + searchTerm = _removeYearRegex.Replace(searchTerm, ""); qc.Add("action", "titlesearch"); qc.Add("title", searchTerm); }