From f322c0ed943b323e9bad4acc0249ef84f2c6825d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jim=C3=A9nez?= <54005397+javierjp93@users.noreply.github.com> Date: Sat, 5 Jun 2021 12:01:54 +0200 Subject: [PATCH] newpct: adapt torrent download url for maxitorrent domain only (#11863) Co-authored-by: garfield69 --- src/Jackett.Common/Indexers/NewPCT.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Jackett.Common/Indexers/NewPCT.cs b/src/Jackett.Common/Indexers/NewPCT.cs index 7180acf9f..62919277f 100644 --- a/src/Jackett.Common/Indexers/NewPCT.cs +++ b/src/Jackett.Common/Indexers/NewPCT.cs @@ -101,7 +101,8 @@ namespace Jackett.Common.Indexers public override string[] AlternativeSiteLinks { get; protected set; } = { "https://pctmix.com/", "https://pctmix1.com/", - "https://pctreload1.com/" + "https://pctreload1.com/", + "https://maxitorrent.com" }; public override string[] LegacySiteLinks { get; protected set; } = { @@ -115,8 +116,7 @@ namespace Jackett.Common.Indexers "http://pctnew.com/", "https://descargas2020.org/", "https://pctnew.org/", - "https://pctreload.com/", - "https://maxitorrent.com" + "https://pctreload.com/" }; public NewPCT(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps, @@ -180,9 +180,12 @@ namespace Jackett.Common.Indexers public override async Task Download(Uri linkParam) { - var results = await RequestWithCookiesAndRetryAsync(linkParam.AbsoluteUri); + var downloadLink = new Regex("maxitorrent.com").Match(linkParam.AbsoluteUri).Success + ? linkParam.AbsoluteUri.Replace("/descargar/", "/descargar/torrent/") + : linkParam.AbsoluteUri; - var uriLink = ExtractDownloadUri(results.ContentString, linkParam.AbsoluteUri); + var results = await RequestWithCookiesAndRetryAsync(downloadLink); + var uriLink = ExtractDownloadUri(results.ContentString, downloadLink); if (uriLink == null) throw new Exception("Download link not found!");