From aba69901c983fb667165fca3a5048bc2c3c79d9d Mon Sep 17 00:00:00 2001 From: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com> Date: Mon, 19 May 2025 18:24:20 +0100 Subject: [PATCH] New: Force all usenet indexers to use Redirection --- src/NzbDrone.Core/Indexers/IndexerBase.cs | 6 ++++++ src/Prowlarr.Api.V1/Indexers/NewznabController.cs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index 5a3b36bbe..2f545e0cd 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -208,6 +208,12 @@ namespace NzbDrone.Core.Indexers try { + // Ensure Redirect is true for Usenet protocols + if (Protocol == DownloadProtocol.Usenet || (SupportsRedirect && Redirect)) + { + failures.Add(new ValidationFailure("Redirect", "Redirect must be enabled for Usenet indexers")); + } + Test(failures).GetAwaiter().GetResult(); } catch (Exception ex) diff --git a/src/Prowlarr.Api.V1/Indexers/NewznabController.cs b/src/Prowlarr.Api.V1/Indexers/NewznabController.cs index 6feaa115d..cde49b789 100644 --- a/src/Prowlarr.Api.V1/Indexers/NewznabController.cs +++ b/src/Prowlarr.Api.V1/Indexers/NewznabController.cs @@ -262,8 +262,8 @@ namespace NzbDrone.Api.V1.Indexers 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) + // If Indexer is set to download via Redirect then just redirect to the link unless it's a Usenet indexer at which point it forces Redirect. + if (indexer.Protocol == DownloadProtocol.Usenet || (indexer.SupportsRedirect && indexerDef.Redirect)) { _downloadService.RecordRedirect(unprotectedLink, id, source, host, file); return RedirectPermanent(unprotectedLink);