From 1a900709e56b1ee7c592f17249b83e06939cf781 Mon Sep 17 00:00:00 2001
From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com>
Date: Fri, 1 Mar 2024 20:43:42 +0000
Subject: [PATCH] flaresolverr: support proxy auth. resolves #15099 (#15101)
---
src/Jackett.Common/Jackett.Common.csproj | 2 +-
src/Jackett.Common/Models/Config/ServerConfig.cs | 2 +-
src/Jackett.Common/Utils/Clients/HttpWebClient.cs | 2 ++
src/Jackett.Common/Utils/Clients/HttpWebClient2.cs | 4 +++-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/Jackett.Common/Jackett.Common.csproj b/src/Jackett.Common/Jackett.Common.csproj
index d0444019b..7b88bec2e 100644
--- a/src/Jackett.Common/Jackett.Common.csproj
+++ b/src/Jackett.Common/Jackett.Common.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/src/Jackett.Common/Models/Config/ServerConfig.cs b/src/Jackett.Common/Models/Config/ServerConfig.cs
index 0be424301..3ec39cfb6 100644
--- a/src/Jackett.Common/Models/Config/ServerConfig.cs
+++ b/src/Jackett.Common/Models/Config/ServerConfig.cs
@@ -94,7 +94,7 @@ namespace Jackett.Common.Models.Config
url = $"{authString}@{url}";
// add protocol
- if (ProxyType == ProxyType.Socks4 || ProxyType == ProxyType.Socks5)
+ if (ProxyType == ProxyType.Socks4 || ProxyType == ProxyType.Socks5 || ProxyType == ProxyType.Http)
{
var protocol = (Enum.GetName(typeof(ProxyType), ProxyType) ?? "").ToLower();
if (!string.IsNullOrEmpty(protocol))
diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs
index 3d68cb845..a4806b545 100644
--- a/src/Jackett.Common/Utils/Clients/HttpWebClient.cs
+++ b/src/Jackett.Common/Utils/Clients/HttpWebClient.cs
@@ -84,6 +84,8 @@ namespace Jackett.Common.Utils.Clients
{
clearanceHandlr.MaxTimeout = serverConfig.FlareSolverrMaxTimeout;
clearanceHandlr.ProxyUrl = serverConfig.GetProxyUrl(false);
+ clearanceHandlr.ProxyUsername = serverConfig.ProxyUsername;
+ clearanceHandlr.ProxyPassword = serverConfig.ProxyPassword;
using (var clientHandlr = new HttpClientHandler
{
CookieContainer = cookies,
diff --git a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs
index 769b0de09..fbd27f547 100644
--- a/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs
+++ b/src/Jackett.Common/Utils/Clients/HttpWebClient2.cs
@@ -60,7 +60,9 @@ namespace Jackett.Common.Utils.Clients
clearanceHandlr = new ClearanceHandler(serverConfig.FlareSolverrUrl)
{
MaxTimeout = serverConfig.FlareSolverrMaxTimeout,
- ProxyUrl = serverConfig.GetProxyUrl(false)
+ ProxyUrl = serverConfig.GetProxyUrl(false),
+ ProxyUsername = serverConfig.ProxyUsername,
+ ProxyPassword = serverConfig.ProxyPassword
};
clientHandlr = new HttpClientHandler
{