From 69ba8c47f4d04c9e7c337fb0cea85e93a73372d0 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 8 Dec 2023 20:31:16 +0200 Subject: [PATCH] hdtorrents: add check if login is needed Fixes #14891 --- src/Jackett.Common/Indexers/HDTorrents.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Jackett.Common/Indexers/HDTorrents.cs b/src/Jackett.Common/Indexers/HDTorrents.cs index e6d294f2b..48f33c603 100644 --- a/src/Jackett.Common/Indexers/HDTorrents.cs +++ b/src/Jackett.Common/Indexers/HDTorrents.cs @@ -164,6 +164,13 @@ namespace Jackett.Common.Indexers var results = await RequestWithCookiesAndRetryAsync(searchUrl); + // Occasionally the cookies become invalid, login again if that happens + if (results.ContentString.Contains("Error:You're not authorized")) + { + await ApplyConfiguration(null); + results = await RequestWithCookiesAndRetryAsync(searchUrl); + } + try { var parser = new HtmlParser();