mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
newpct: adapt torrent download url for maxitorrent domain only (#11863)
Co-authored-by: garfield69 <garfieldsixtynine@gmail.com>
This commit is contained in:
@@ -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!");
|
||||
|
||||
|
Reference in New Issue
Block a user