diff --git a/src/Jackett.Common/Indexers/Definitions/MyAnonamouse.cs b/src/Jackett.Common/Indexers/Definitions/MyAnonamouse.cs index 87c803a5f..332fcb960 100644 --- a/src/Jackett.Common/Indexers/Definitions/MyAnonamouse.cs +++ b/src/Jackett.Common/Indexers/Definitions/MyAnonamouse.cs @@ -198,7 +198,7 @@ namespace Jackett.Common.Indexers.Definitions var limit = query.Limit > 0 ? query.Limit : 100; var offset = query.Offset > 0 ? query.Offset : 0; - var qParams = new NameValueCollection + var parameters = new NameValueCollection { {"tor[text]", term}, {"tor[searchType]", configData.SearchType.Value}, @@ -215,38 +215,45 @@ namespace Jackett.Common.Indexers.Definitions if (configData.SearchInDescription.Value) { - qParams.Add("tor[srchIn][description]", "true"); + parameters.Add("tor[srchIn][description]", "true"); } if (configData.SearchInSeries.Value) { - qParams.Add("tor[srchIn][series]", "true"); + parameters.Add("tor[srchIn][series]", "true"); } if (configData.SearchInFilenames.Value) { - qParams.Add("tor[srchIn][filenames]", "true"); + parameters.Add("tor[srchIn][filenames]", "true"); } - var catList = MapTorznabCapsToTrackers(query); + if (configData.SearchLanguages.Values is { Length: > 0 }) + { + foreach (var (language, index) in configData.SearchLanguages.Values.Select((value, index) => (value, index))) + { + parameters.Set($"tor[browse_lang][{index}]", language); + } + } + + var catList = MapTorznabCapsToTrackers(query).Distinct().ToList(); + if (catList.Any()) { - var index = 0; - foreach (var cat in catList) + foreach (var (category, index) in catList.Select((value, index) => (value, index))) { - qParams.Add("tor[cat][" + index + "]", cat); - index++; + parameters.Set($"tor[cat][{index}]", category); } } else { - qParams.Add("tor[cat][]", "0"); + parameters.Add("tor[cat][]", "0"); } var urlSearch = SearchUrl; - if (qParams.Count > 0) + if (parameters.Count > 0) { - urlSearch += $"?{qParams.GetQueryString()}"; + urlSearch += $"?{parameters.GetQueryString()}"; } var response = await RequestWithCookiesAndRetryAsync( diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs index c6bd9d06e..59d953d49 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataMyAnonamouse.cs @@ -12,6 +12,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke public BoolConfigurationItem SearchInDescription { get; private set; } public BoolConfigurationItem SearchInSeries { get; private set; } public BoolConfigurationItem SearchInFilenames { get; private set; } + public MultiSelectConfigurationItem SearchLanguages { get; private set; } public DisplayInfoConfigurationItem AccountActivity { get; private set; } public ConfigurationDataMyAnonamouse() @@ -33,6 +34,76 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke SearchInDescription = new BoolConfigurationItem("Also search text in the description") { Value = false }; SearchInSeries = new BoolConfigurationItem("Also search text in the series") { Value = false }; SearchInFilenames = new BoolConfigurationItem("Also search text in the filenames") { Value = false }; + + SearchLanguages = new MultiSelectConfigurationItem( + "Search Languages", + new Dictionary + { + { "1", "English" }, + { "17", "Afrikaans" }, + { "32", "Arabic" }, + { "35", "Bengali" }, + { "51", "Bosnian" }, + { "18", "Bulgarian" }, + { "6", "Burmese" }, + { "44", "Cantonese" }, + { "19", "Catalan" }, + { "2", "Chinese" }, + { "49", "Croatian" }, + { "20", "Czech" }, + { "21", "Danish" }, + { "22", "Dutch" }, + { "61", "Estonian" }, + { "39", "Farsi" }, + { "23", "Finnish" }, + { "36", "French" }, + { "37", "German" }, + { "26", "Greek" }, + { "59", "Greek, Ancient" }, + { "3", "Gujarati" }, + { "27", "Hebrew" }, + { "8", "Hindi" }, + { "28", "Hungarian" }, + { "63", "Icelandic" }, + { "53", "Indonesian" }, + { "56", "Irish" }, + { "43", "Italian" }, + { "38", "Japanese" }, + { "12", "Javanese" }, + { "5", "Kannada" }, + { "41", "Korean" }, + { "50", "Lithuanian" }, + { "46", "Latin" }, + { "62", "Latvian" }, + { "33", "Malay" }, + { "58", "Malayalam" }, + { "57", "Manx" }, + { "9", "Marathi" }, + { "48", "Norwegian" }, + { "45", "Polish" }, + { "34", "Portuguese" }, + { "52", "Brazilian Portuguese (BP)" }, + { "14", "Punjabi" }, + { "30", "Romanian" }, + { "16", "Russian" }, + { "24", "Scottish Gaelic" }, + { "60", "Sanskrit" }, + { "31", "Serbian" }, + { "54", "Slovenian" }, + { "4", "Spanish" }, + { "55", "Castilian Spanish" }, + { "40", "Swedish" }, + { "29", "Tagalog" }, + { "11", "Tamil" }, + { "10", "Telugu" }, + { "7", "Thai" }, + { "42", "Turkish" }, + { "25", "Ukrainian" }, + { "15", "Urdu" }, + { "13", "Vietnamese" }, + { "47", "Other" } + }); + AccountActivity = new DisplayInfoConfigurationItem("Account Inactivity", "To prevent your account from being disabled for inactivity, you must log in on a regular basis. You must also use your account - if you do not, your account will be disabled. If you know that you will not be able to login for an extended period of time, you can park your account in your preferences and it will not be disabled."); } }