TorrentLeech: Add support for IMDb search (#7235)

This commit is contained in:
Jonas Stendahl 2020-02-17 22:29:32 +01:00 committed by GitHub
parent 938c1f1de0
commit 6a913f79d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -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) + "/";
}