1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-17 21:26:13 -04:00

Fixed: Login with credentials on Qbittorrent 5.2

This commit is contained in:
Bogdan
2026-01-02 13:26:18 +02:00
committed by Mark McDowall
parent 1839aa7907
commit 8f5f3070ac

View File

@@ -422,13 +422,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
_authCookieCache.Remove(authKey);
var authRequestBuilder = BuildRequest(settings);
authRequestBuilder.NetworkCredential = new BasicNetworkCredential(settings.Username, settings.Password);
var authLoginRequest = authRequestBuilder.Resource("/api/v2/auth/login")
.Post()
.AddFormParameter("username", settings.Username ?? string.Empty)
.AddFormParameter("password", settings.Password ?? string.Empty)
.Build();
.Post()
.AddFormParameter("username", settings.Username ?? string.Empty)
.AddFormParameter("password", settings.Password ?? string.Empty)
.Build();
HttpResponse response;
try
@@ -438,6 +437,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
catch (HttpException ex)
{
_logger.Debug(ex, "qbitTorrent authentication failed.");
if (ex.Response.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden)
{
throw new DownloadClientAuthenticationException("Failed to authenticate with qBittorrent.", ex);