mirror of https://github.com/Jackett/Jackett
mejortorrent: fix download link (#9018)
This commit is contained in:
parent
454350dfaf
commit
396c638f20
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue