mirror of https://github.com/Jackett/Jackett
newpct: adapt torrent download url for maxitorrent domain only (#11863)
Co-authored-by: garfield69 <garfieldsixtynine@gmail.com>
This commit is contained in:
parent
a537018fcc
commit
f322c0ed94
|
@ -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!");
|
||||
|
||||
|
|
Loading…
Reference in New Issue