mirror of
https://github.com/Jackett/Jackett.git
synced 2025-12-24 23:04:33 +01:00
toloka: add search by categories (#12400)
This commit is contained in:
@@ -234,12 +234,16 @@ namespace Jackett.Common.Indexers
|
||||
var releases = new List<ReleaseInfo>();
|
||||
var searchString = query.SanitizedSearchTerm;
|
||||
|
||||
var queryCollection = new NameValueCollection();
|
||||
var qc = new List<KeyValuePair<string, string>> // NameValueCollection don't support cat[]=19&cat[]=6
|
||||
{
|
||||
{"o", "1"},
|
||||
{"s", "2"}
|
||||
};
|
||||
|
||||
// if the search string is empty use the getnew view
|
||||
if (string.IsNullOrWhiteSpace(searchString))
|
||||
{
|
||||
queryCollection.Add("nm", searchString);
|
||||
qc.Add("nm", searchString);
|
||||
}
|
||||
else // use the normal search
|
||||
{
|
||||
@@ -248,10 +252,13 @@ namespace Jackett.Common.Indexers
|
||||
{
|
||||
searchString += " Сезон " + query.Season;
|
||||
}
|
||||
queryCollection.Add("nm", searchString);
|
||||
qc.Add("nm", searchString);
|
||||
}
|
||||
|
||||
var searchUrl = SearchUrl + "?" + queryCollection.GetQueryString();
|
||||
foreach (var cat in MapTorznabCapsToTrackers(query))
|
||||
qc.Add("f[]", cat);
|
||||
|
||||
var searchUrl = SearchUrl + "?" + qc.GetQueryString();
|
||||
var results = await RequestWithCookiesAsync(searchUrl);
|
||||
if (!results.ContentString.Contains("logout=true"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user