diff --git a/src/Jackett.Common/Indexers/SceneTime.cs b/src/Jackett.Common/Indexers/SceneTime.cs index 4d73f502a..bd298ab68 100644 --- a/src/Jackett.Common/Indexers/SceneTime.cs +++ b/src/Jackett.Common/Indexers/SceneTime.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using CsQuery; using Jackett.Common.Models; using Jackett.Common.Models.IndexerConfig; +using Jackett.Common.Models.IndexerConfig.Bespoke; using Jackett.Common.Services.Interfaces; using Jackett.Common.Utils; using Jackett.Common.Utils.Clients; @@ -23,9 +24,10 @@ namespace Jackett.Common.Indexers private string SearchUrl { get { return SiteLink + "browse.php"; } } private string DownloadUrl { get { return SiteLink + "download.php/{0}/download.torrent"; } } - private new ConfigurationDataRecaptchaLogin configData + + private new ConfigurationDataSceneTime configData { - get { return (ConfigurationDataRecaptchaLogin)base.configData; } + get { return (ConfigurationDataSceneTime)base.configData; } set { base.configData = value; } } @@ -38,7 +40,7 @@ namespace Jackett.Common.Indexers client: w, logger: l, p: ps, - configData: new ConfigurationDataRecaptchaLogin("For best results, change the 'Torrents per page' setting to the maximum in your profile on the SceneTime webpage.")) + configData: new ConfigurationDataSceneTime()) { Encoding = Encoding.GetEncoding("iso-8859-1"); Language = "en-us"; @@ -183,6 +185,11 @@ namespace Jackett.Common.Indexers qParams.Add("search", query.GetQueryString()); } + // If Only Freeleech Enabled + if (configData.Freeleech.Value) + { + qParams.Add("freeleech", "on"); + } var searchUrl = SearchUrl + "?" + qParams.GetQueryString(); var results = await RequestStringWithCookies(searchUrl); diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs new file mode 100644 index 000000000..65d4d7cb3 --- /dev/null +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataSceneTime.cs @@ -0,0 +1,21 @@ +namespace Jackett.Common.Models.IndexerConfig.Bespoke +{ + public class ConfigurationDataSceneTime : ConfigurationData + { + public StringItem Username { get; private set; } + public StringItem Password { get; private set; } + public RecaptchaItem Captcha { get; private set; } + public BoolItem Freeleech { get; private set; } + public DisplayItem Instructions { get; private set; } + + public ConfigurationDataSceneTime() + : base() + { + Username = new StringItem { Name = "Username" }; + Password = new StringItem { Name = "Password" }; + Captcha = new RecaptchaItem() { Name = "Recaptcha" }; + Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false }; + Instructions = new DisplayItem("For best results, change the 'Torrents per page' setting to the maximum in your profile on the SceneTime webpage.") { Name = "" }; + } + } +}