torrentmafya: fix download links. resolves #9874 (#9884)

This commit is contained in:
Diego Heras 2020-10-18 14:49:24 +02:00 committed by GitHub
parent b6e88536c8
commit 05380e3519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 11 deletions

View File

@ -121,15 +121,6 @@ namespace Jackett.Common.Indexers
var sizeContent = mainColumn.QuerySelector("span.boyut")?.TextContent; var sizeContent = mainColumn.QuerySelector("span.boyut")?.TextContent;
var magnetLink = mainColumn.QuerySelector("a[href^=\"magnet:?xt=\"]")?.GetAttribute("href"); var magnetLink = mainColumn.QuerySelector("a[href^=\"magnet:?xt=\"]")?.GetAttribute("href");
var fileLink = mainColumn.QuerySelector("a[title^=\"İndir\"]")?.GetAttribute("href"); var fileLink = mainColumn.QuerySelector("a[title^=\"İndir\"]")?.GetAttribute("href");
var rowLink = (Uri)null;
if (!string.IsNullOrEmpty(magnetLink))
{
rowLink = new Uri(magnetLink);
} else if (!string.IsNullOrEmpty(fileLink))
{
rowLink = new Uri(fileLink);
}
var detailsLink = new Uri(firstColumn.QuerySelector("a").GetAttribute("href")); var detailsLink = new Uri(firstColumn.QuerySelector("a").GetAttribute("href"));
var category = ParseReleaseCategory(firstColumn.QuerySelector("i")?.ClassList); var category = ParseReleaseCategory(firstColumn.QuerySelector("i")?.ClassList);
var seederContent = mainColumn.QuerySelector("span.sayiGonderen")?.TextContent; var seederContent = mainColumn.QuerySelector("span.sayiGonderen")?.TextContent;
@ -140,14 +131,15 @@ namespace Jackett.Common.Indexers
{ {
Title = firstColumn.QuerySelector("a")?.TextContent, Title = firstColumn.QuerySelector("a")?.TextContent,
Comments = detailsLink, Comments = detailsLink,
Guid = detailsLink,
Link = string.IsNullOrWhiteSpace(fileLink) ? null : new Uri(fileLink),
MagnetUri = string.IsNullOrWhiteSpace(magnetLink) ? null : new Uri(magnetLink),
PublishDate = ParseReleasePublishDate(row.col2), PublishDate = ParseReleasePublishDate(row.col2),
Category = category, Category = category,
Seeders = seeders, Seeders = seeders,
Peers = seeders + leechers, Peers = seeders + leechers,
DownloadVolumeFactor = 0, DownloadVolumeFactor = 0,
UploadVolumeFactor = 1, UploadVolumeFactor = 1,
Link = rowLink,
Guid = rowLink,
Size = !string.IsNullOrEmpty(sizeContent) ? ReleaseInfo.GetBytes(sizeContent) : 0 Size = !string.IsNullOrEmpty(sizeContent) ? ReleaseInfo.GetBytes(sizeContent) : 0
}; };
} }