add setting to change RD api hostname

This commit is contained in:
Cucumberrbob 2025-03-23 14:08:27 +00:00
parent 9841ab6399
commit 3780a954a2
No known key found for this signature in database
GPG key ID: 2B935C47401C3614
2 changed files with 8 additions and 1 deletions

View file

@ -181,6 +181,13 @@ or
<a href=""https://debrid-link.com/webapp/apikey"" target=""_blank"" rel=""noopener"">https://debrid-link.com/webapp/apikey</a>")]
public String ApiKey { get; set; } = "";
/// <summary>
/// API hostname to use <b>for Real Debrid only</b>
/// </summary>
[DisplayName("API Hostname (RD only)")]
[Description("Use this instead of the normal hostname for Real Debrid API requests. Only used by Real Debrid. Leave blank to use default.")]
public String? ApiHostname { get; set; }
[DisplayName("Automatically import and process torrents added to provider")]
[Description("When selected, import downloads that are not added through RealDebridClient but have been directly added to your debrid provider.")]
public Boolean AutoImport { get; set; } = false;

View file

@ -26,7 +26,7 @@ public class RealDebridTorrentClient(ILogger<RealDebridTorrentClient> logger, IH
var httpClient = httpClientFactory.CreateClient(DiConfig.RD_CLIENT);
httpClient.Timeout = TimeSpan.FromSeconds(Settings.Get.Provider.Timeout);
var rdtNetClient = new RdNetClient(null, httpClient, 5);
var rdtNetClient = new RdNetClient(null, httpClient, 5, Settings.Get.Provider.ApiHostname);
rdtNetClient.UseApiAuthentication(apiKey);
// Get the server time to fix up the timezones on results