From 6a913f79d40f198ac934ac9570ce1d4cb128433f Mon Sep 17 00:00:00 2001 From: Jonas Stendahl Date: Mon, 17 Feb 2020 22:29:32 +0100 Subject: [PATCH] TorrentLeech: Add support for IMDb search (#7235) --- src/Jackett.Common/Indexers/TorrentLeech.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Jackett.Common/Indexers/TorrentLeech.cs b/src/Jackett.Common/Indexers/TorrentLeech.cs index 5004de7d0..90306428e 100644 --- a/src/Jackett.Common/Indexers/TorrentLeech.cs +++ b/src/Jackett.Common/Indexers/TorrentLeech.cs @@ -44,9 +44,11 @@ namespace Jackett.Common.Indexers downloadBase: "https://www.torrentleech.org/download/", configData: new ConfigurationDataRecaptchaLogin("For best results, change the 'Default Number of Torrents per Page' setting to the maximum in your profile on the TorrentLeech webpage.")) { - Encoding = Encoding.GetEncoding("iso-8859-1"); + Encoding = Encoding.UTF8; Language = "en-us"; Type = "private"; + TorznabCaps.SupportsImdbMovieSearch = true; + TorznabCaps.SupportsImdbTVSearch = true; AddCategoryMapping(8, TorznabCatType.MoviesSD); // cam AddCategoryMapping(9, TorznabCatType.MoviesSD); //ts @@ -180,8 +182,13 @@ namespace Jackett.Common.Indexers var searchString = query.GetQueryString(); searchString = Regex.Replace(searchString, @"(^|\s)-", " "); // remove dashes at the beginning of keywords as they exclude search strings (see issue #3096) var searchUrl = SearchUrl; + var imdbId = ParseUtil.GetFullImdbID(query.ImdbID); - if (!string.IsNullOrWhiteSpace(searchString)) + if (imdbId != null) + { + searchUrl += "imdbID/" + imdbId + "/"; + } + else if (!string.IsNullOrWhiteSpace(searchString)) { searchUrl += "query/" + WebUtility.UrlEncode(searchString) + "/"; }