1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-23 23:00:51 +00:00

scenetime: add freeleech filter. resolves #4983

This commit is contained in:
Garfield69 2019-03-29 16:32:35 +13:00
parent 656702cde7
commit 9b39e1c3c2
2 changed files with 31 additions and 3 deletions

View file

@ -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);

View file

@ -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 = "" };
}
}
}