mirror of https://github.com/Jackett/Jackett
MyAnonamouse: fix and improve search (#797)
This commit is contained in:
parent
0295bc68ab
commit
186136cc86
|
@ -33,7 +33,7 @@ namespace Jackett.Indexers
|
||||||
}
|
}
|
||||||
|
|
||||||
public Myanonamouse(IIndexerManagerService i, IWebClient c, Logger l, IProtectionService ps)
|
public Myanonamouse(IIndexerManagerService i, IWebClient c, Logger l, IProtectionService ps)
|
||||||
: base(name: "Myanonamouse",
|
: base(name: "MyAnonamouse",
|
||||||
description: "Friendliness, Warmth and Sharing",
|
description: "Friendliness, Warmth and Sharing",
|
||||||
link: "https://www.myanonamouse.net/",
|
link: "https://www.myanonamouse.net/",
|
||||||
caps: new TorznabCapabilities(TorznabCatType.Books,
|
caps: new TorznabCapabilities(TorznabCatType.Books,
|
||||||
|
@ -187,22 +187,25 @@ namespace Jackett.Indexers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CQ dom = response.Content;
|
CQ dom = response.Content;
|
||||||
var rows = dom["table[class='newTorTable'] > tbody > tr"];
|
var rows = dom["table[class='newTorTable'] > tbody > tr[id^=\"tdr\"]"];
|
||||||
|
|
||||||
foreach (IDomObject row in rows)
|
foreach (IDomObject row in rows)
|
||||||
{
|
{
|
||||||
CQ torrentData = row.OuterHTML;
|
CQ torrentData = row.OuterHTML;
|
||||||
CQ cells = row.Cq().Find("td");
|
CQ cells = row.Cq().Find("td");
|
||||||
|
|
||||||
if (cells.Any() && torrentData.Find("a[class='directDownload']").Any())
|
string tid = torrentData.Attr("id").Substring(4);
|
||||||
{
|
var qTitle = torrentData.Find("a[class='title']").First();
|
||||||
string title = torrentData.Find("a[class='title']").First().Text().Trim();
|
string title = qTitle.Text().Trim();
|
||||||
|
var details = new Uri(SiteLink + qTitle.Attr("href"));
|
||||||
string author = torrentData.Find("a[class='author']").First().Text().Trim();
|
string author = torrentData.Find("a[class='author']").First().Text().Trim();
|
||||||
Uri link = new Uri(SiteLink + torrentData.Find("a[class='directDownload']").First().Attr("href").Trim().TrimStart('/'));
|
Uri link = new Uri(SiteLink + "tor/download.php?tid="+tid); // DL Link is no long available directly, build it ourself
|
||||||
Uri guid = new Uri(SiteLink + torrentData.Find("a[class='directDownload']").First().Attr("href").Trim().TrimStart('/'));
|
long files = ParseUtil.CoerceLong(cells.Elements.ElementAt(4).Cq().Find("a").Text());
|
||||||
long size = ReleaseInfo.GetBytes(cells.Elements.ElementAt(4).Cq().Text().Split('[')[1].TrimEnd(']'));
|
long size = ReleaseInfo.GetBytes(cells.Elements.ElementAt(4).Cq().Text().Split('[')[1].TrimEnd(']'));
|
||||||
int seeders = ParseUtil.CoerceInt(cells.Elements.ElementAt(6).Cq().Find("p").ElementAt(0).Cq().Text());
|
int seeders = ParseUtil.CoerceInt(cells.Elements.ElementAt(6).Cq().Find("p").ElementAt(0).Cq().Text());
|
||||||
int leechers = ParseUtil.CoerceInt(cells.Elements.ElementAt(6).Cq().Find("p").ElementAt(1).Cq().Text());
|
int leechers = ParseUtil.CoerceInt(cells.Elements.ElementAt(6).Cq().Find("p").ElementAt(1).Cq().Text());
|
||||||
|
long grabs = ParseUtil.CoerceLong(cells.Elements.ElementAt(6).Cq().Find("p").ElementAt(2).Cq().Text());
|
||||||
|
bool freeleech = torrentData.Find("img[alt=\"freeleech\"]").Any();
|
||||||
|
|
||||||
string pubDateStr = cells.Elements.ElementAt(5).Cq().Text().Split('[')[0];
|
string pubDateStr = cells.Elements.ElementAt(5).Cq().Text().Split('[')[0];
|
||||||
DateTime publishDate = DateTime.Parse(pubDateStr).ToLocalTime();
|
DateTime publishDate = DateTime.Parse(pubDateStr).ToLocalTime();
|
||||||
|
@ -215,22 +218,30 @@ namespace Jackett.Indexers
|
||||||
var release = new ReleaseInfo();
|
var release = new ReleaseInfo();
|
||||||
|
|
||||||
release.Title = String.IsNullOrEmpty(author) ? title : String.Format("{0} by {1}", title, author);
|
release.Title = String.IsNullOrEmpty(author) ? title : String.Format("{0} by {1}", title, author);
|
||||||
release.Guid = guid;
|
release.Guid = link;
|
||||||
release.Link = link;
|
release.Link = link;
|
||||||
release.PublishDate = publishDate;
|
release.PublishDate = publishDate;
|
||||||
|
release.Files = files;
|
||||||
release.Size = size;
|
release.Size = size;
|
||||||
release.Description = release.Title;
|
release.Description = release.Title;
|
||||||
release.Seeders = seeders;
|
release.Seeders = seeders;
|
||||||
release.Peers = seeders + leechers;
|
release.Peers = seeders + leechers;
|
||||||
|
release.Grabs = grabs;
|
||||||
release.MinimumRatio = 1;
|
release.MinimumRatio = 1;
|
||||||
release.MinimumSeedTime = 172800;
|
release.MinimumSeedTime = 172800;
|
||||||
release.Category = MapTrackerCatToNewznab(category.ToString());
|
release.Category = MapTrackerCatToNewznab(category.ToString());
|
||||||
release.Comments = guid;
|
release.Comments = details;
|
||||||
|
|
||||||
|
if (freeleech)
|
||||||
|
release.DownloadVolumeFactor = 0;
|
||||||
|
else
|
||||||
|
release.DownloadVolumeFactor = 1;
|
||||||
|
|
||||||
|
release.UploadVolumeFactor = 1;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
OnParseError(response.Content, ex);
|
OnParseError(response.Content, ex);
|
||||||
|
|
Loading…
Reference in New Issue