mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
scenetime: add freeleech filter. resolves #4983
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
|||||||
using CsQuery;
|
using CsQuery;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Models.IndexerConfig;
|
using Jackett.Common.Models.IndexerConfig;
|
||||||
|
using Jackett.Common.Models.IndexerConfig.Bespoke;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
using Jackett.Common.Utils;
|
using Jackett.Common.Utils;
|
||||||
using Jackett.Common.Utils.Clients;
|
using Jackett.Common.Utils.Clients;
|
||||||
@@ -23,9 +24,10 @@ namespace Jackett.Common.Indexers
|
|||||||
private string SearchUrl { get { return SiteLink + "browse.php"; } }
|
private string SearchUrl { get { return SiteLink + "browse.php"; } }
|
||||||
private string DownloadUrl { get { return SiteLink + "download.php/{0}/download.torrent"; } }
|
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; }
|
set { base.configData = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ namespace Jackett.Common.Indexers
|
|||||||
client: w,
|
client: w,
|
||||||
logger: l,
|
logger: l,
|
||||||
p: ps,
|
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");
|
Encoding = Encoding.GetEncoding("iso-8859-1");
|
||||||
Language = "en-us";
|
Language = "en-us";
|
||||||
@@ -183,6 +185,11 @@ namespace Jackett.Common.Indexers
|
|||||||
qParams.Add("search", query.GetQueryString());
|
qParams.Add("search", query.GetQueryString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If Only Freeleech Enabled
|
||||||
|
if (configData.Freeleech.Value)
|
||||||
|
{
|
||||||
|
qParams.Add("freeleech", "on");
|
||||||
|
}
|
||||||
var searchUrl = SearchUrl + "?" + qParams.GetQueryString();
|
var searchUrl = SearchUrl + "?" + qParams.GetQueryString();
|
||||||
|
|
||||||
var results = await RequestStringWithCookies(searchUrl);
|
var results = await RequestStringWithCookies(searchUrl);
|
||||||
|
@@ -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 = "" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user