Skip to content

Commit

Permalink
cinecalidad: switch to new site cine-calidad.com (#11627) resolves #6081
Browse files Browse the repository at this point in the history
  • Loading branch information
razorblade446 committed Apr 28, 2021
1 parent c862fab commit 72585f9
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions src/Jackett.Common/Indexers/Cinecalidad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public class Cinecalidad : BaseWebIndexer
{
private const int MaxItemsPerPage = 15;
private const int MaxSearchPageLimit = 6; // 15 items per page * 6 pages = 90
private string _language;

public override string[] AlternativeSiteLinks { get; protected set; } = {
public override string[] LegacySiteLinks { get; protected set; } = {
"https://www.cinecalidad.to/",
"https://www.cinecalidad.im/", // working but outdated, maybe copycat
"https://www.cinecalidad.is/",
"https://www.cinecalidad.li/",
"https://www.cinecalidad.eu/",
Expand All @@ -34,18 +35,14 @@ public class Cinecalidad : BaseWebIndexer
"https://cinecalidad.mrunblock.icu/"
};

public override string[] LegacySiteLinks { get; protected set; } = {
"https://www.cinecalidad.to/",
"https://www.cinecalidad.im/" // working but outdated, maybe copycat
};

public Cinecalidad(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
ICacheService cs)
: base(id: "cinecalidad",
name: "Cinecalidad",
description: "Películas Full HD en Castellano y Latino Dual.",
link: "https://www.cinecalidad.is/",
caps: new TorznabCapabilities {
description: "Películas Full HD en Latino y Inglés Dual.",
link: "https://www.cine-calidad.com/",
caps: new TorznabCapabilities
{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
Expand All @@ -59,24 +56,12 @@ public class Cinecalidad : BaseWebIndexer
Language = "es-es";
Type = "public";

var language = new 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 = (SingleSelectConfigurationItem)configData.GetDynamic("language");
_language = language?.Value ?? "castellano";
}

public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
Expand All @@ -95,8 +80,6 @@ protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuer
var releases = new List<ReleaseInfo>();

var templateUrl = SiteLink;
if (_language.Equals("castellano"))
templateUrl += "espana/";
templateUrl += "{0}"; // placeholder for page

var maxPages = 2; // we scrape only 2 pages for recent torrents
Expand Down Expand Up @@ -137,7 +120,7 @@ public override async Task<byte[]> Download(Uri link)
{
var parser = new HtmlParser();
var dom = parser.ParseDocument(results.ContentString);
var protectedLink = dom.QuerySelector("a[service=BitTorrent]").GetAttribute("href");
var protectedLink = dom.QuerySelector("li:contains('Torrent')").ParentElement.GetAttribute("href");
if (protectedLink.Contains("/ouo.io/"))
{
// protected link =>
Expand Down Expand Up @@ -178,11 +161,11 @@ private List<ReleaseInfo> ParseReleases(WebResult response, TorznabQuery query)
var title = qImg.GetAttribute("title");
if (!CheckTitleMatchWords(query.GetQueryString(), title))
continue; // skip if it doesn't contain all words
title += _language.Equals("castellano") ? " MULTi/SPANiSH" : " MULTi/LATiN SPANiSH";
title += " 1080p BDRip x264";
title += " MULTi LATiN SPANiSH 1080p BDRip x264";

var poster = new Uri(GetAbsoluteUrl(qImg.GetAttribute("src")));
var link = new Uri(GetAbsoluteUrl(row.QuerySelector("a").GetAttribute("href")));
var extract = row.QuerySelector("noscript").InnerHtml.Split('\'');
var link = new Uri(GetAbsoluteUrl(extract[1]));

var release = new ReleaseInfo
{
Expand Down

0 comments on commit 72585f9

Please sign in to comment.