newpct: adapt torrent download url for maxitorrent domain only (#11863)

Co-authored-by: garfield69 <garfieldsixtynine@gmail.com>
This commit is contained in:
Javier Jiménez 2021-06-05 12:01:54 +02:00 committed by GitHub
parent a537018fcc
commit f322c0ed94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -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<byte[]> 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!");