Compare commits

...

2 Commits

Author SHA1 Message Date
Bogdan
238a7199d2 avistaz: add audio and subtitle language filtering (#16376) 2025-12-26 15:00:18 +02:00
ilike2burnthing
cb27e297b2 oldgreektracker: remove recommended torrents 2025-12-26 07:54:01 +00:00
6 changed files with 265 additions and 9 deletions

View File

@@ -163,7 +163,7 @@ search:
args: ["\\.", " "]
rows:
selector: table.lista > tbody > tr:has(a[href^="download.php?id="]):not(td.block)
selector: table.lista > tbody > tr:has(a[href^="download.php?id="]):has(strong img)
fields:
category:

View File

@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Jackett.Common.Exceptions;
using Jackett.Common.Models;
using Jackett.Common.Models.IndexerConfig;
using Jackett.Common.Models.IndexerConfig.Bespoke;
using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils;
@@ -35,7 +35,7 @@ namespace Jackett.Common.Indexers.Definitions.Abstract
private readonly HashSet<string> _hdResolutions = new HashSet<string> { "1080p", "1080i", "720p" };
private string _token;
private new ConfigurationDataAvistazTracker configData => (ConfigurationDataAvistazTracker)base.configData;
private new ConfigurationDataAvistaZTracker configData => (ConfigurationDataAvistaZTracker)base.configData;
// hook to adjust the search term
protected virtual string GetSearchTerm(TorznabQuery query) => $"{query.SearchTerm} {GetEpisodeSearchTerm(query)}".Trim();
@@ -95,13 +95,19 @@ namespace Jackett.Common.Indexers.Definitions.Abstract
qc.Add("search", GetEpisodeSearchTerm(query));
}
else
{
qc.Add("search", GetSearchTerm(query).Trim());
}
if (!string.IsNullOrWhiteSpace(query.Genre))
{
qc.Add("tags", query.Genre);
}
if (configData.Freeleech.Value)
{
qc.Add("discount[]", "1");
}
return qc;
}
@@ -144,7 +150,18 @@ namespace Jackett.Common.Indexers.Definitions.Abstract
logger: logger,
p: p,
cacheService: cs,
configData: new ConfigurationDataAvistazTracker())
configData: new ConfigurationDataAvistaZTracker())
{
webclient.requestDelay = 6;
}
protected AvistazTracker(IIndexerConfigurationService configService, WebClient client, Logger logger, IProtectionService p, ICacheService cs, ConfigurationData configData)
: base(configService: configService,
client: client,
logger: logger,
p: p,
cacheService: cs,
configData: configData)
{
webclient.requestDelay = 6;
}
@@ -171,10 +188,19 @@ namespace Jackett.Common.Indexers.Definitions.Abstract
{ "pid", configData.Pid.Value.Trim() }
};
var result = await RequestWithCookiesAsync(AuthUrl, method: RequestType.POST, data: body, headers: AuthHeaders);
if ((int)result.Status == 429)
{
throw new TooManyRequestsException("Rate limited", result);
}
var json = JObject.Parse(result.ContentString);
_token = json.Value<string>("token");
if (_token == null)
{
throw new Exception(json.Value<string>("message"));
}
}
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)

View File

@@ -1,9 +1,12 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Jackett.Common.Extensions;
using Jackett.Common.Indexers.Definitions.Abstract;
using Jackett.Common.Models;
using Jackett.Common.Models.IndexerConfig.Bespoke;
using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils;
using Jackett.Common.Utils.Clients;
using NLog;
@@ -18,17 +21,20 @@ namespace Jackett.Common.Indexers.Definitions
public override string SiteLink { get; protected set; } = "https://avistaz.to/";
public override TorznabCapabilities TorznabCaps => SetCapabilities();
private new ConfigurationDataAvistaZ configData => (ConfigurationDataAvistaZ)base.configData;
public AvistaZ(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
ICacheService cs)
: base(configService: configService,
client: wc,
logger: l,
p: ps,
cs: cs)
cs: cs,
configData: new ConfigurationDataAvistaZ())
{
}
private TorznabCapabilities SetCapabilities()
private static TorznabCapabilities SetCapabilities()
{
var caps = new TorznabCapabilities
{
@@ -59,6 +65,23 @@ namespace Jackett.Common.Indexers.Definitions
return caps;
}
protected override List<KeyValuePair<string, string>> GetSearchQueryParameters(TorznabQuery query)
{
var qc = base.GetSearchQueryParameters(query);
foreach (var languageId in configData.SearchAudioLanguages.Values.Distinct())
{
qc.Add("language[]", languageId);
}
foreach (var languageId in configData.SearchSubtitleLanguages.Values.Distinct())
{
qc.Add("subtitle[]", languageId);
}
return qc;
}
// Avistaz has episodes without season. eg Running Man E323
protected override string GetEpisodeSearchTerm(TorznabQuery query) =>
(query.Season == null || query.Season == 0) && query.Episode.IsNotNullOrWhiteSpace()

View File

@@ -27,7 +27,7 @@ namespace Jackett.Common.Indexers.Definitions
public override TorznabCapabilities TorznabCaps => SetCapabilities();
private new ConfigurationDataAvistazTracker configData => (ConfigurationDataAvistazTracker)base.configData;
private new ConfigurationDataAvistaZTracker configData => (ConfigurationDataAvistaZTracker)base.configData;
public ExoticaZ(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
ICacheService cs)

View File

@@ -0,0 +1,203 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Jackett.Common.Models.IndexerConfig.Bespoke
{
[ExcludeFromCodeCoverage]
internal class ConfigurationDataAvistaZ : ConfigurationDataAvistaZTracker
{
public MultiSelectConfigurationItem SearchAudioLanguages { get; private set; }
public MultiSelectConfigurationItem SearchSubtitleLanguages { get; private set; }
public DisplayInfoConfigurationItem InfoSearchLanguages { get; private set; }
public ConfigurationDataAvistaZ()
{
SearchAudioLanguages = new MultiSelectConfigurationItem(
"Search Audio Languages",
new Dictionary<string, string>
{
{ "7", "Arabic" },
{ "10", "Assamese" },
{ "17", "Basque" },
{ "19", "Bengali" },
{ "23", "Bosnian" },
{ "189", "Brazilian Portuguese" },
{ "26", "Burmese" },
{ "27", "Cantonese" },
{ "28", "Catalan" },
{ "29", "Central Khmer" },
{ "30", "Chamorro" },
{ "33", "Chinese" },
{ "39", "Croatian" },
{ "40", "Czech" },
{ "41", "Danish" },
{ "43", "Dutch" },
{ "44", "Dzongkha" },
{ "45", "English" },
{ "46", "Esperanto" },
{ "188", "Filipino" },
{ "51", "Finnish" },
{ "52", "French" },
{ "58", "German" },
{ "59", "Greek" },
{ "61", "Gujarati" },
{ "63", "Hausa" },
{ "64", "Hebrew" },
{ "66", "Hindi" },
{ "68", "Hungarian" },
{ "72", "Indonesian" },
{ "75", "Inuktitut" },
{ "78", "Italian" },
{ "79", "Japanese" },
{ "80", "Javanese" },
{ "82", "Kannada" },
{ "84", "Kashmiri" },
{ "85", "Kazakh" },
{ "88", "Kirghiz" },
{ "91", "Korean" },
{ "94", "Lao" },
{ "104", "Malay" },
{ "105", "Malayalam" },
{ "107", "Mandarin" },
{ "110", "Marathi" },
{ "112", "Mongolian" },
{ "118", "Nepali" },
{ "123", "Ojibwa" },
{ "124", "Oriya" },
{ "127", "Pali" },
{ "128", "Panjabi" },
{ "129", "Persian" },
{ "130", "Polish" },
{ "131", "Portuguese" },
{ "133", "Quechua" },
{ "134", "Romanian" },
{ "137", "Russian" },
{ "140", "Sanskrit" },
{ "146", "Sinhala" },
{ "147", "Slovak" },
{ "151", "Spanish" },
{ "155", "Swedish" },
{ "156", "Tagalog" },
{ "159", "Tamil" },
{ "161", "Telugu" },
{ "162", "Thai" },
{ "163", "Tibetan" },
{ "168", "Turkish" },
{ "171", "Uighur" },
{ "172", "Ukrainian" },
{ "173", "Urdu" },
{ "176", "Vietnamese" },
{ "182", "Xhosa" },
})
{
Values = Array.Empty<string>()
};
SearchSubtitleLanguages = new MultiSelectConfigurationItem(
"Search Subtitle Languages",
new Dictionary<string, string>
{
{ "1", "Abkhazian" },
{ "2", "Afar" },
{ "3", "Afrikaans" },
{ "5", "Albanian" },
{ "6", "Amharic" },
{ "7", "Arabic" },
{ "17", "Basque" },
{ "18", "Belarusian" },
{ "19", "Bengali" },
{ "23", "Bosnian" },
{ "189", "Brazilian Portuguese" },
{ "25", "Bulgarian" },
{ "26", "Burmese" },
{ "27", "Cantonese" },
{ "28", "Catalan" },
{ "29", "Central Khmer" },
{ "32", "Chichewa" },
{ "33", "Chinese" },
{ "37", "Corsican" },
{ "39", "Croatian" },
{ "40", "Czech" },
{ "41", "Danish" },
{ "43", "Dutch" },
{ "45", "English" },
{ "46", "Esperanto" },
{ "47", "Estonian" },
{ "50", "Fijian" },
{ "188", "Filipino" },
{ "51", "Finnish" },
{ "52", "French" },
{ "55", "Galician" },
{ "57", "Georgian" },
{ "58", "German" },
{ "59", "Greek" },
{ "61", "Gujarati" },
{ "62", "Haitian" },
{ "64", "Hebrew" },
{ "66", "Hindi" },
{ "68", "Hungarian" },
{ "69", "Icelandic" },
{ "72", "Indonesian" },
{ "77", "Irish" },
{ "78", "Italian" },
{ "79", "Japanese" },
{ "80", "Javanese" },
{ "82", "Kannada" },
{ "85", "Kazakh" },
{ "91", "Korean" },
{ "93", "Kurdish" },
{ "94", "Lao" },
{ "95", "Latin" },
{ "96", "Latvian" },
{ "99", "Lithuanian" },
{ "102", "Macedonian" },
{ "103", "Malagasy" },
{ "104", "Malay" },
{ "105", "Malayalam" },
{ "107", "Mandarin" },
{ "109", "Maori" },
{ "110", "Marathi" },
{ "112", "Mongolian" },
{ "118", "Nepali" },
{ "120", "Norwegian" },
{ "22", "Norwegian Bokmål" },
{ "124", "Oriya" },
{ "128", "Panjabi" },
{ "129", "Persian" },
{ "130", "Polish" },
{ "131", "Portuguese" },
{ "134", "Romanian" },
{ "135", "Romansh" },
{ "137", "Russian" },
{ "141", "Sardinian" },
{ "142", "Serbian" },
{ "146", "Sinhala" },
{ "147", "Slovak" },
{ "148", "Slovenian" },
{ "149", "Somali" },
{ "151", "Spanish" },
{ "152", "Sundanese" },
{ "153", "Swahili" },
{ "155", "Swedish" },
{ "156", "Tagalog" },
{ "159", "Tamil" },
{ "161", "Telugu" },
{ "162", "Thai" },
{ "168", "Turkish" },
{ "170", "Twi" },
{ "172", "Ukrainian" },
{ "173", "Urdu" },
{ "175", "Venda" },
{ "176", "Vietnamese" },
{ "177", "Volapük" },
{ "179", "Welsh" },
{ "181", "Wolof" },
})
{
Values = Array.Empty<string>()
};
InfoSearchLanguages = new DisplayInfoConfigurationItem("Info Search Languages", "The audio and subtitle language settings are AND searches, e.g. selecting English audio with Basque and Catalan subtitles, will only return results with all three of these.");
}
}
}

View File

@@ -1,14 +1,18 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace Jackett.Common.Models.IndexerConfig.Bespoke
{
[ExcludeFromCodeCoverage]
internal class ConfigurationDataAvistazTracker : ConfigurationDataBasicLoginWithPID
internal class ConfigurationDataAvistaZTracker : ConfigurationDataBasicLoginWithPID
{
[JsonPropertyOrder(5)]
public BoolConfigurationItem Freeleech { get; private set; }
[JsonPropertyOrder(6)]
public DisplayInfoConfigurationItem AccountActivity { get; private set; }
public ConfigurationDataAvistazTracker()
public ConfigurationDataAvistaZTracker()
: base("You have to check 'Enable RSS Feed' in 'My Account', without this configuration the torrent download does not work.<br/>You can find the PID in 'My profile'.")
{
Freeleech = new BoolConfigurationItem("Search freeleech only") { Value = false };