Merge pull request #765 from Cucumberrbob/feat/rd-configurable-api-url

feat: add setting to change RD api hostname
This commit is contained in:
Roger Far 2025-04-13 07:41:05 -06:00 committed by GitHub
commit 770e32c2cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

@ -29,7 +29,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