mirror of
https://github.com/Jackett/Jackett
synced 2025-01-31 20:02:08 +00:00
parent
0046fb2a13
commit
ca8fbd081d
1 changed files with 24 additions and 10 deletions
|
@ -18,11 +18,11 @@ namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
class MejorTorrent : BaseWebIndexer
|
class MejorTorrent : BaseWebIndexer
|
||||||
{
|
{
|
||||||
public static Uri WebUri = new Uri("http://www.mejortorrentt.org/");
|
private static Uri WebUri = new Uri("http://www.mejortorrentt.org/");
|
||||||
public static Uri DownloadUri = new Uri(WebUri, "secciones.php?sec=descargas&ap=contar_varios");
|
private static Uri DownloadUri = new Uri(WebUri, "secciones.php?sec=descargas&ap=contar_varios");
|
||||||
private static Uri SearchUriBase = new Uri(WebUri, "secciones.php");
|
private static Uri SearchUriBase = new Uri(WebUri, "secciones.php");
|
||||||
public static Uri NewTorrentsUri = new Uri(WebUri, "secciones.php?sec=ultimos_torrents");
|
private static Uri NewTorrentsUri = new Uri(WebUri, "secciones.php?sec=ultimos_torrents");
|
||||||
public static Encoding MEEncoding = Encoding.GetEncoding("utf-8");
|
private static Encoding MEEncoding = Encoding.GetEncoding("utf-8");
|
||||||
|
|
||||||
public override string[] LegacySiteLinks { get; protected set; } = new string[] {
|
public override string[] LegacySiteLinks { get; protected set; } = new string[] {
|
||||||
"http://www.mejortorrent.org/",
|
"http://www.mejortorrent.org/",
|
||||||
|
@ -74,7 +74,7 @@ namespace Jackett.Common.Indexers
|
||||||
return await PerformQuery(query, 0);
|
return await PerformQuery(query, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query, int attempts)
|
private async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query, int attempts)
|
||||||
{
|
{
|
||||||
query = query.Clone();
|
query = query.Clone();
|
||||||
|
|
||||||
|
@ -404,9 +404,14 @@ namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
public IEnumerable<Uri> Extract(IHtmlDocument html)
|
public IEnumerable<Uri> Extract(IHtmlDocument html)
|
||||||
{
|
{
|
||||||
return html.QuerySelectorAll("a[href*=\".torrent\"]")
|
List<Uri> uris = new List<Uri>();
|
||||||
.Select(e => e.Attributes["href"].Value)
|
foreach(var elem in html.QuerySelectorAll("a[onclick*=\"/uploads/\"]")) {
|
||||||
.Select(link => new Uri(WebUri, link));
|
var onclick = elem.Attributes["onclick"].Value;
|
||||||
|
var table = onclick.Split(new string[] {"table: '"}, StringSplitOptions.None)[1].Split(new string[] {"'"}, StringSplitOptions.None)[0];
|
||||||
|
var name = onclick.Split(new string[] {"name: '"}, StringSplitOptions.None)[1].Split(new string[] {"'"}, StringSplitOptions.None)[0];
|
||||||
|
uris.Add(new Uri(WebUri, "/uploads/torrents/" + table + "/" + name));
|
||||||
|
}
|
||||||
|
return uris;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +463,7 @@ namespace Jackett.Common.Indexers
|
||||||
public MTReleaseInfo()
|
public MTReleaseInfo()
|
||||||
{
|
{
|
||||||
this.Category = new List<int>();
|
this.Category = new List<int>();
|
||||||
this.Grabs = 5;
|
this.Grabs = null;
|
||||||
this.Files = 1;
|
this.Files = 1;
|
||||||
this.PublishDate = new DateTime();
|
this.PublishDate = new DateTime();
|
||||||
this.Peers = 1;
|
this.Peers = 1;
|
||||||
|
@ -682,6 +687,12 @@ namespace Jackett.Common.Indexers
|
||||||
release.TitleOriginal += " (" + year + ")";
|
release.TitleOriginal += " (" + year + ")";
|
||||||
} catch { }
|
} catch { }
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
var grabsStr = selectors.Where(s => s.TextContent.ToLower().Contains("total descargas"))
|
||||||
|
.First().NextSibling.TextContent.Trim();
|
||||||
|
release.Grabs = long.Parse(grabsStr.Replace(".", string.Empty));
|
||||||
|
} catch { }
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var dateStr = selectors.Where(s => s.TextContent.ToLower().Contains("fecha"))
|
var dateStr = selectors.Where(s => s.TextContent.ToLower().Contains("fecha"))
|
||||||
.First().NextSibling.TextContent.Trim();
|
.First().NextSibling.TextContent.Trim();
|
||||||
|
@ -759,7 +770,10 @@ namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return new Uri(WebUri, html.QuerySelector("a[href*=\".torrent\"]").GetAttribute("href"));
|
var onclick = html.QuerySelector("a[onclick*=\"/uploads/\"]").GetAttribute("onclick");
|
||||||
|
var table = onclick.Split(new string[] {"table: '"}, StringSplitOptions.None)[1].Split(new string[] {"'"}, StringSplitOptions.None)[0];
|
||||||
|
var name = onclick.Split(new string[] {"name: '"}, StringSplitOptions.None)[1].Split(new string[] {"'"}, StringSplitOptions.None)[0];
|
||||||
|
return new Uri(WebUri, "/uploads/torrents/" + table + "/" + name);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue