Compare commits

..

7 Commits

Author SHA1 Message Date
Bogdan
8d16b88185 Return bad request for unprotect download link failures 2024-10-05 17:20:17 +03:00
Bogdan
121ef8e80d Add new category for FL 2024-09-30 17:26:31 +03:00
Bogdan
d53fec7e75 Add newbie warning for AvistaZ's API use 2024-09-30 11:21:36 +03:00
Bogdan
c017a3cd7e New: (PTP) Filter by Golden Popcorn only releases 2024-09-29 12:12:26 +03:00
Bogdan
27ea93090f Use proxied requests for fetching user class for MAM 2024-09-29 10:40:16 +03:00
Bogdan
d79845144e Bump version to 1.25.1 2024-09-29 08:17:56 +03:00
Servarr
3f77900dd0 Automated API Docs update 2024-09-27 15:59:16 +03:00
11 changed files with 44 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '1.25.0'
majorVersion: '1.25.1'
minorVersion: $[counter('minorVersion', 1)]
prowlarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'

View File

@@ -27,16 +27,16 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
public string Token { get; set; }
[FieldDefinition(2, Label = "Username", HelpText = "Site Username", Privacy = PrivacyLevel.UserName)]
[FieldDefinition(2, Label = "Username", HelpText = "IndexerAvistazSettingsUsernameHelpText", HelpTextWarning = "IndexerAvistazSettingsUsernameHelpTextWarning", Privacy = PrivacyLevel.UserName)]
public string Username { get; set; }
[FieldDefinition(3, Label = "Password", HelpText = "Site Password", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
[FieldDefinition(3, Label = "Password", HelpText = "IndexerAvistazSettingsPasswordHelpText", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
public string Password { get; set; }
[FieldDefinition(4, Label = "PID", HelpText = "PID from My Account or My Profile page", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
[FieldDefinition(4, Label = "PID", HelpText = "IndexerAvistazSettingsPidHelpText", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
public string Pid { get; set; }
[FieldDefinition(5, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Search freeleech only")]
[FieldDefinition(5, Label = "IndexerSettingsFreeleechOnly", Type = FieldType.Checkbox, HelpText = "IndexerAvistazSettingsFreeleechOnlyHelpText")]
public bool FreeleechOnly { get; set; }
public override NzbDroneValidationResult Validate()

View File

@@ -103,6 +103,8 @@ public class FileList : TorrentIndexerBase<FileListSettings>
caps.Categories.AddCategoryMapping(25, NewznabStandardCategory.Movies3D, "Filme 3D");
caps.Categories.AddCategoryMapping(26, NewznabStandardCategory.MoviesBluRay, "Filme 4K Blu-Ray");
caps.Categories.AddCategoryMapping(27, NewznabStandardCategory.TVUHD, "Seriale 4K");
caps.Categories.AddCategoryMapping(28, NewznabStandardCategory.MoviesForeign, "RO Dubbed");
caps.Categories.AddCategoryMapping(28, NewznabStandardCategory.TVForeign, "RO Dubbed");
return caps;
}

View File

@@ -151,7 +151,7 @@ public class FileListRequestGenerator : IIndexerRequestGenerator
if (searchCriteria.Categories != null && searchCriteria.Categories.Any())
{
parameters.Set("category", string.Join(",", Capabilities.Categories.MapTorznabCapsToTrackers(searchCriteria.Categories)));
parameters.Set("category", string.Join(",", Capabilities.Categories.MapTorznabCapsToTrackers(searchCriteria.Categories).Distinct().ToList()));
}
if (Settings.FreeleechOnly)

View File

@@ -22,6 +22,7 @@ using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
@@ -51,7 +52,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public override IParseIndexerResponse GetParser()
{
return new MyAnonamouseParser(Settings, Capabilities.Categories, _httpClient, _cacheManager, _logger);
return new MyAnonamouseParser(Definition, Settings, Capabilities.Categories, _httpClient, _cacheManager, _logger);
}
public override async Task<IndexerDownloadResponse> Download(Uri link)
@@ -374,6 +375,7 @@ namespace NzbDrone.Core.Indexers.Definitions
public class MyAnonamouseParser : IParseIndexerResponse
{
private readonly ProviderDefinition _definition;
private readonly MyAnonamouseSettings _settings;
private readonly IndexerCapabilitiesCategories _categories;
private readonly IIndexerHttpClient _httpClient;
@@ -386,12 +388,14 @@ namespace NzbDrone.Core.Indexers.Definitions
"Elite VIP"
};
public MyAnonamouseParser(MyAnonamouseSettings settings,
public MyAnonamouseParser(ProviderDefinition definition,
MyAnonamouseSettings settings,
IndexerCapabilitiesCategories categories,
IIndexerHttpClient httpClient,
ICacheManager cacheManager,
Logger logger)
{
_definition = definition;
_settings = settings;
_categories = categories;
_httpClient = httpClient;
@@ -543,7 +547,7 @@ namespace NzbDrone.Core.Indexers.Definitions
_logger.Debug("Fetching user data: {0}", request.Url.FullUri);
var response = _httpClient.Get(request);
var response = _httpClient.ExecuteProxied(request, _definition);
var jsonResponse = JsonConvert.DeserializeObject<MyAnonamouseUserDataResponse>(response.Content);
return jsonResponse.UserClass?.Trim();

View File

@@ -73,6 +73,6 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
public class PassThePopcornFlag : IndexerFlag
{
public static IndexerFlag Golden => new ("golden", "Release follows Golden Popcorn quality rules");
public static IndexerFlag Approved => new ("approved", "Release approved by PTP");
public static IndexerFlag Approved => new ("approved", "Release approved by PTP staff");
}
}

View File

@@ -86,6 +86,11 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
parameters.Set("freetorrent", "1");
}
if (_settings.GoldenPopcornOnly)
{
parameters.Set("scene", "2");
}
var queryCats = _capabilities.Categories
.MapTorznabCapsToTrackers(searchCriteria.Categories)
.Select(int.Parse)

View File

@@ -27,6 +27,9 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
[FieldDefinition(4, Label = "IndexerSettingsFreeleechOnly", HelpText = "IndexerPassThePopcornSettingsFreeleechOnlyHelpText", Type = FieldType.Checkbox)]
public bool FreeleechOnly { get; set; }
[FieldDefinition(5, Label = "IndexerPassThePopcornSettingsGoldenPopcornOnly", HelpText = "IndexerPassThePopcornSettingsGoldenPopcornOnlyHelpText", Type = FieldType.Checkbox, Advanced = true)]
public bool GoldenPopcornOnly { get; set; }
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -320,6 +320,11 @@
"IndexerAlphaRatioSettingsFreeleechOnlyHelpText": "Search freeleech releases only",
"IndexerAlreadySetup": "At least one instance of indexer is already setup",
"IndexerAuth": "Indexer Auth",
"IndexerAvistazSettingsFreeleechOnlyHelpText": "Search freeleech releases only",
"IndexerAvistazSettingsPasswordHelpText": "Site Password",
"IndexerAvistazSettingsPidHelpText": "PID from My Account or My Profile page",
"IndexerAvistazSettingsUsernameHelpText": "Site Username",
"IndexerAvistazSettingsUsernameHelpTextWarning": "Only member rank and above can use the API on this indexer.",
"IndexerBeyondHDSettingsApiKeyHelpText": "API Key from the Site (Found in My Security => API Key)",
"IndexerBeyondHDSettingsFreeleechOnlyHelpText": "Search freeleech releases only",
"IndexerBeyondHDSettingsLimitedOnly": "Limited Only",
@@ -380,6 +385,8 @@
"IndexerPassThePopcornSettingsApiKeyHelpText": "Site API Key",
"IndexerPassThePopcornSettingsApiUserHelpText": "These settings are found in your PassThePopcorn security settings (Edit Profile > Security).",
"IndexerPassThePopcornSettingsFreeleechOnlyHelpText": "Search freeleech releases only",
"IndexerPassThePopcornSettingsGoldenPopcornOnly": "Golden Popcorn only",
"IndexerPassThePopcornSettingsGoldenPopcornOnlyHelpText": "Search Golden Popcorn releases only",
"IndexerPriority": "Indexer Priority",
"IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.",
"IndexerProxies": "Indexer Proxies",

View File

@@ -255,20 +255,25 @@ namespace NzbDrone.Api.V1.Indexers
var source = Request.GetSource();
var host = Request.GetHostName();
var unprotectedlLink = _downloadMappingService.ConvertToNormalLink(link);
var unprotectedLink = _downloadMappingService.ConvertToNormalLink(link);
if (unprotectedLink.IsNullOrWhiteSpace())
{
throw new BadRequestException("Failed to normalize provided link");
}
// If Indexer is set to download via Redirect then just redirect to the link
if (indexer.SupportsRedirect && indexerDef.Redirect)
{
_downloadService.RecordRedirect(unprotectedlLink, id, source, host, file);
return RedirectPermanent(unprotectedlLink);
_downloadService.RecordRedirect(unprotectedLink, id, source, host, file);
return RedirectPermanent(unprotectedLink);
}
byte[] downloadBytes;
try
{
downloadBytes = await _downloadService.DownloadReport(unprotectedlLink, id, source, host, file);
downloadBytes = await _downloadService.DownloadReport(unprotectedLink, id, source, host, file);
}
catch (ReleaseUnavailableException ex)
{

View File

@@ -5089,6 +5089,10 @@
"type": "integer",
"format": "int32",
"nullable": true
},
"preferMagnetUrl": {
"type": "boolean",
"nullable": true
}
},
"additionalProperties": false