mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
cinecalidad: new layout and castellano language (#12676)
This commit is contained in:
@@ -22,8 +22,10 @@ namespace Jackett.Common.Indexers
|
||||
{
|
||||
private const int MaxItemsPerPage = 15;
|
||||
private const int MaxSearchPageLimit = 6; // 15 items per page * 6 pages = 90
|
||||
private string _language;
|
||||
|
||||
public override string[] LegacySiteLinks { get; protected set; } = {
|
||||
"https://cinecalidad.website/",
|
||||
"https://www.cinecalidad.to/",
|
||||
"https://www.cinecalidad.im/", // working but outdated, maybe copycat
|
||||
"https://www.cinecalidad.is/",
|
||||
@@ -39,8 +41,8 @@ namespace Jackett.Common.Indexers
|
||||
ICacheService cs)
|
||||
: base(id: "cinecalidad",
|
||||
name: "Cinecalidad",
|
||||
description: "Películas Full HD en Latino y Inglés Dual.",
|
||||
link: "https://cinecalidad.website/",
|
||||
description: "Películas Full HD en Castellano y Latino Dual.",
|
||||
link: "https://www.cinecalidad.lat/",
|
||||
caps: new TorznabCapabilities
|
||||
{
|
||||
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
|
||||
@@ -56,9 +58,29 @@ namespace Jackett.Common.Indexers
|
||||
Language = "es-ES";
|
||||
Type = "public";
|
||||
|
||||
var language = new ConfigurationData.SingleSelectConfigurationItem(
|
||||
"Select language", new Dictionary<string, string>
|
||||
{
|
||||
{"castellano", "Castilian Spanish"},
|
||||
{"latino", "Latin American Spanish"}
|
||||
})
|
||||
{
|
||||
Value = "castellano"
|
||||
};
|
||||
configData.AddDynamic("language", language);
|
||||
|
||||
AddCategoryMapping(1, TorznabCatType.MoviesHD);
|
||||
}
|
||||
|
||||
public override void LoadValuesFromJson(JToken jsonConfig, bool useProtectionService = false)
|
||||
{
|
||||
{
|
||||
base.LoadValuesFromJson(jsonConfig, useProtectionService);
|
||||
var language = (ConfigurationData.SingleSelectConfigurationItem)configData.GetDynamic("language");
|
||||
_language = language?.Value ?? "castellano";
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||
{
|
||||
LoadValuesFromJson(configJson);
|
||||
@@ -75,6 +97,8 @@ namespace Jackett.Common.Indexers
|
||||
var releases = new List<ReleaseInfo>();
|
||||
|
||||
var templateUrl = SiteLink;
|
||||
if (_language.Equals("castellano"))
|
||||
templateUrl += "espana/";
|
||||
templateUrl += "{0}?s="; // placeholder for page
|
||||
|
||||
var maxPages = 2; // we scrape only 2 pages for recent torrents
|
||||
@@ -115,7 +139,12 @@ namespace Jackett.Common.Indexers
|
||||
{
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(results.ContentString);
|
||||
var protectedLink = dom.QuerySelector("li:contains('Torrent')").ParentElement.GetAttribute("href");
|
||||
var linkParent = dom.QuerySelector("li:contains('Torrent')").ParentElement;
|
||||
var protectedLink = linkParent.GetAttribute("data-res");
|
||||
if (protectedLink != null)
|
||||
protectedLink = "protect/v.php?i=" + protectedLink;
|
||||
else
|
||||
protectedLink = linkParent.GetAttribute("href");
|
||||
if (protectedLink.Contains("/ouo.io/"))
|
||||
{
|
||||
// protected link =>
|
||||
@@ -156,9 +185,10 @@ namespace Jackett.Common.Indexers
|
||||
var title = qImg.GetAttribute("title");
|
||||
if (!CheckTitleMatchWords(query.GetQueryString(), title))
|
||||
continue; // skip if it doesn't contain all words
|
||||
title += " MULTi LATiN SPANiSH 1080p BDRip x264";
|
||||
title += _language.Equals("castellano") ? " MULTi/SPANiSH" : " MULTi/LATiN SPANiSH";
|
||||
title += " 1080p BDRip x264";
|
||||
|
||||
var poster = new Uri(GetAbsoluteUrl(qImg.GetAttribute("data-large")));
|
||||
var poster = new Uri(GetAbsoluteUrl(qImg.GetAttribute("data-src")));
|
||||
var link = new Uri(row.QuerySelector("a.postItem__back-link").GetAttribute("href"));
|
||||
|
||||
var release = new ReleaseInfo
|
||||
|
Reference in New Issue
Block a user