From 396c638f20126de02e1f8d4347e6b10c701a8882 Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Sun, 21 Jun 2020 07:47:58 +0200 Subject: [PATCH] mejortorrent: fix download link (#9018) --- src/Jackett.Common/Indexers/MejorTorrent.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Jackett.Common/Indexers/MejorTorrent.cs b/src/Jackett.Common/Indexers/MejorTorrent.cs index 31ffbd2fc..61367c200 100644 --- a/src/Jackett.Common/Indexers/MejorTorrent.cs +++ b/src/Jackett.Common/Indexers/MejorTorrent.cs @@ -100,21 +100,22 @@ namespace Jackett.Common.Indexers var parser = new HtmlParser(); var downloadUrl = link.ToString(); - // Eg http://www.mejortorrentt.org/peli-descargar-torrent-11995-Harry-Potter-y-la-piedra-filosofal.html + // Eg https://www.mejortorrentt.net/peli-descargar-torrent-11995-Harry-Potter-y-la-piedra-filosofal.html var result = await RequestStringWithCookies(downloadUrl); if (result.Status != HttpStatusCode.OK) throw new ExceptionWithConfigData(result.Content, configData); var dom = parser.ParseDocument(result.Content); downloadUrl = SiteLink + dom.QuerySelector("a[href*=\"sec=descargas\"]").GetAttribute("href"); - // Eg http://www.mejortorrentt.org/secciones.php?sec=descargas&ap=contar&tabla=peliculas&id=11995&link_bajar=1 + // Eg https://www.mejortorrentt.net/secciones.php?sec=descargas&ap=contar&tabla=peliculas&id=11995&link_bajar=1 result = await RequestStringWithCookies(downloadUrl); if (result.Status != HttpStatusCode.OK) throw new ExceptionWithConfigData(result.Content, configData); dom = parser.ParseDocument(result.Content); - downloadUrl = SiteLink + dom.QuerySelector("a[href*=\".torrent\"]").GetAttribute("href").TrimStart('/'); + var onClickParts = dom.QuerySelector("a[onclick*=\"/torrent\"]").GetAttribute("onclick").Split('\''); + downloadUrl = $"{SiteLink}tor/{onClickParts[3]}/{onClickParts[5]}"; - // Eg https://www.mejortorrentt.org/uploads/torrents/peliculas/Harry_Potter_1_y_la_Piedra_Filosofal_MicroHD_1080p.torrent + // Eg https://www.mejortorrentt.net/tor/peliculas/Harry_Potter_1_y_la_Piedra_Filosofal_MicroHD_1080p.torrent var content = await base.Download(new Uri(downloadUrl)); return content; }