FileList: fix download link and some more improvements (#760)

This commit is contained in:
kaso17 2016-11-28 16:03:22 +01:00 committed by GitHub
parent 88f73f185c
commit da2a252848
1 changed files with 21 additions and 14 deletions

View File

@ -45,7 +45,7 @@ namespace Jackett.Indexers
AddCategoryMapping(24, TorznabCatType.TVAnime); AddCategoryMapping(24, TorznabCatType.TVAnime);
AddCategoryMapping(11, TorznabCatType.Audio); AddCategoryMapping(11, TorznabCatType.Audio);
AddCategoryMapping(15, TorznabCatType.TV); AddCategoryMapping(15, TorznabCatType.TV);
//AddCategoryMapping(18, TorznabCatType.); Other AddCategoryMapping(18, TorznabCatType.Other);
AddCategoryMapping(16, TorznabCatType.TVDocumentary); AddCategoryMapping(16, TorznabCatType.TVDocumentary);
AddCategoryMapping(25, TorznabCatType.Movies3D); AddCategoryMapping(25, TorznabCatType.Movies3D);
AddCategoryMapping(20, TorznabCatType.MoviesBluRay); AddCategoryMapping(20, TorznabCatType.MoviesBluRay);
@ -56,7 +56,7 @@ namespace Jackett.Indexers
AddCategoryMapping(1, TorznabCatType.MoviesSD); AddCategoryMapping(1, TorznabCatType.MoviesSD);
AddCategoryMapping(10, TorznabCatType.Console); AddCategoryMapping(10, TorznabCatType.Console);
AddCategoryMapping(9, TorznabCatType.PCGames); AddCategoryMapping(9, TorznabCatType.PCGames);
//AddCategoryMapping(17, TorznabCatType); Linux No cat AddCategoryMapping(17, TorznabCatType.PC);
AddCategoryMapping(22, TorznabCatType.PCPhoneOther); //Apps/mobile AddCategoryMapping(22, TorznabCatType.PCPhoneOther); //Apps/mobile
AddCategoryMapping(8, TorznabCatType.PC); AddCategoryMapping(8, TorznabCatType.PC);
AddCategoryMapping(21, TorznabCatType.TVHD); AddCategoryMapping(21, TorznabCatType.TVHD);
@ -108,22 +108,23 @@ namespace Jackett.Indexers
try try
{ {
CQ dom = results; CQ dom = results;
var globalFreeLeech = dom.Find("div.globalFreeLeech").Any();
var rows = dom[".torrentrow"]; var rows = dom[".torrentrow"];
foreach (var row in rows) foreach (var row in rows)
{ {
var release = new ReleaseInfo(); var release = new ReleaseInfo();
var qRow = row.Cq(); var qRow = row.Cq();
var qTitleLink = qRow.Find(".torrenttable:eq(1) a").First(); var qTitleLink = qRow.Find(".torrenttable:eq(1) a").First();
release.Title = qRow.Find(".torrenttable:eq(1) a b").Text().Trim(); release.Title = qRow.Find(".torrenttable:eq(1) a").Attr("title");
release.Description = release.Title; release.Description = release.Title;
release.Guid = new Uri(SiteLink + qTitleLink.Attr("href")); release.Guid = new Uri(SiteLink + qTitleLink.Attr("href"));
release.Comments = release.Guid; release.Comments = release.Guid;
//22:05:3716/02/2013 //22:05:3716/02/2013
var dateStr = qRow.Find(".torrenttable:eq(5)").Text().Trim(); var dateStr = qRow.Find(".torrenttable:eq(5)").Text().Trim()+" +0200";
release.PublishDate = DateTime.ParseExact(dateStr, "H:mm:ssdd/MM/yyyy", CultureInfo.InvariantCulture).AddHours(-2); release.PublishDate = DateTime.ParseExact(dateStr, "H:mm:ssdd/MM/yyyy zzz", CultureInfo.InvariantCulture);
var qLink = qRow.Find(".torrenttable:eq(2) a").First(); var qLink = qRow.Find("a[href^=\"download.php?id=\"]").First();
release.Link = new Uri(SiteLink + qLink.Attr("href")); release.Link = new Uri(SiteLink + qLink.Attr("href"));
var sizeStr = qRow.Find(".torrenttable:eq(6)").Text().Trim(); var sizeStr = qRow.Find(".torrenttable:eq(6)").Text().Trim();
@ -135,9 +136,16 @@ namespace Jackett.Indexers
var catId = qRow.Find(".torrenttable:eq(0) a").First().Attr("href").Substring(15); var catId = qRow.Find(".torrenttable:eq(0) a").First().Attr("href").Substring(15);
release.Category = MapTrackerCatToNewznab(catId); release.Category = MapTrackerCatToNewznab(catId);
// Skip other var grabs = qRow.Find(".torrenttable:eq(7)").First().Get(0).FirstChild;
if (release.Category != 0) release.Grabs = ParseUtil.CoerceLong(catId);
{
if (globalFreeLeech || row.Cq().Find("img[alt=\"FreeLeech\"]").Any())
release.DownloadVolumeFactor = 0;
else
release.DownloadVolumeFactor = 1;
release.UploadVolumeFactor = 1;
// Skip Romanian releases // Skip Romanian releases
if (release.Category == TorznabCatType.MoviesForeign.ID && !configData.IncludeRomanianReleases.Value) if (release.Category == TorznabCatType.MoviesForeign.ID && !configData.IncludeRomanianReleases.Value)
continue; continue;
@ -145,7 +153,6 @@ namespace Jackett.Indexers
releases.Add(release); releases.Add(release);
} }
} }
}
catch (Exception ex) catch (Exception ex)
{ {
OnParseError(results, ex); OnParseError(results, ex);