mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
xspeeds: add imdbid search support for #4859
This commit is contained in:
@@ -53,6 +53,8 @@ namespace Jackett.Common.Indexers
|
|||||||
configData.DisplayText.Value = "Expect an initial delay (often around 10 seconds) due to XSpeeds CloudFlare DDoS protection";
|
configData.DisplayText.Value = "Expect an initial delay (often around 10 seconds) due to XSpeeds CloudFlare DDoS protection";
|
||||||
configData.DisplayText.Name = "Notice";
|
configData.DisplayText.Name = "Notice";
|
||||||
|
|
||||||
|
TorznabCaps.SupportsImdbSearch = true;
|
||||||
|
|
||||||
AddCategoryMapping(92, TorznabCatType.MoviesUHD, "4K Movies");
|
AddCategoryMapping(92, TorznabCatType.MoviesUHD, "4K Movies");
|
||||||
AddCategoryMapping(91, TorznabCatType.TVUHD, "4K TV");
|
AddCategoryMapping(91, TorznabCatType.TVUHD, "4K TV");
|
||||||
AddCategoryMapping(94, TorznabCatType.TVUHD, "4K TV Boxsets");
|
AddCategoryMapping(94, TorznabCatType.TVUHD, "4K TV Boxsets");
|
||||||
@@ -214,6 +216,8 @@ namespace Jackett.Common.Indexers
|
|||||||
var releases = new List<ReleaseInfo>();
|
var releases = new List<ReleaseInfo>();
|
||||||
var searchString = query.GetQueryString();
|
var searchString = query.GetQueryString();
|
||||||
var prevCook = CookieHeader + "";
|
var prevCook = CookieHeader + "";
|
||||||
|
Regex IMDBRegEx = new Regex(@"tt(\d+)", RegexOptions.Compiled);
|
||||||
|
var searchStringIsImdbQuery = (ParseUtil.GetImdbID(searchString) != null);
|
||||||
|
|
||||||
// If we have no query use the RSS Page as their server is slow enough at times!
|
// If we have no query use the RSS Page as their server is slow enough at times!
|
||||||
// ~15.01.2019 they removed the description tag making the RSS feed almost useless, we don't use it for now. See #4458
|
// ~15.01.2019 they removed the description tag making the RSS feed almost useless, we don't use it for now. See #4458
|
||||||
@@ -286,11 +290,26 @@ namespace Jackett.Common.Indexers
|
|||||||
*/
|
*/
|
||||||
var searchParams = new Dictionary<string, string> {
|
var searchParams = new Dictionary<string, string> {
|
||||||
{ "do", "search" },
|
{ "do", "search" },
|
||||||
{ "keywords", searchString },
|
|
||||||
{ "search_type", "t_name" },
|
|
||||||
{ "category", "0" },
|
{ "category", "0" },
|
||||||
{ "include_dead_torrents", "no" }
|
{ "include_dead_torrents", "no" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (query.IsImdbQuery)
|
||||||
|
{
|
||||||
|
searchParams.Add("keywords", query.ImdbID);
|
||||||
|
searchParams.Add("search_type", "t_both");
|
||||||
|
}
|
||||||
|
else if (searchStringIsImdbQuery)
|
||||||
|
{
|
||||||
|
searchParams.Add("keywords", searchString);
|
||||||
|
searchParams.Add("search_type", "t_both");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
searchParams.Add("keywords", searchString);
|
||||||
|
searchParams.Add("search_type", "t_name");
|
||||||
|
}
|
||||||
|
|
||||||
var pairs = new Dictionary<string, string> {
|
var pairs = new Dictionary<string, string> {
|
||||||
{ "username", configData.Username.Value },
|
{ "username", configData.Username.Value },
|
||||||
{ "password", configData.Password.Value }
|
{ "password", configData.Password.Value }
|
||||||
|
Reference in New Issue
Block a user