mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-02-04 03:16:52 -06:00
[FEATURE] Add support for base URL on Download Clients and Sonarr/Radarr #131
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @calrock27 on GitHub.
What would you like to see implemented next?
Hello! I was very excited to find this project. This seems like the perfect solution to keep my stack running with little intervention for .lnk files. However, I don't think it's compatible with my existing setup.
I currently use a hosted provided for Sonarr/Radarr/Qbittorrent and they publish these services with base URLs. I've attempted to run Cleanuperr via my local docker host but ran into issues, which appear to be related to it not (yet?) supporting base URLs. I saw the existing PR to add this for download clients and would love if it could also extend to Sonarr/Radarr clients.
Logs below if it will help
`[2025-03-18 21:39:46.648 INF] cleanuperr v1.5.12
[2025-03-18 21:39:46.656 INF] timezone: (UTC-05:00) America/New_York
[2025-03-18 21:39:46.802 INF] Application started. Press Ctrl+C to shut down.
[2025-03-18 21:39:46.803 INF] Hosting environment: Production
[2025-03-18 21:39:46.803 INF] Content root path: /app
[2025-03-18 21:39:46.834 WRN] [DownloadCleaner] download client is set to none
[2025-03-18 21:39:46.834 WRN] [ContentBlocker] download client is set to none
[2025-03-18 21:39:46.845 INF] [QueueCleaner] ignored downloads reloaded
[2025-03-18 21:39:47.563 ERR] [QueueCleaner] [Sonarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownSeriesItems=true&includeSeries=true&includeEpisode=true
[2025-03-18 21:39:47.564 ERR] [QueueCleaner] failed to clean Sonarr instance | https://subdomain.subdomain.domain.tld/sonarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83
[2025-03-18 21:39:47.703 ERR] [QueueCleaner] [Radarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownMovieItems=true&includeMovie=true
[2025-03-18 21:39:47.703 ERR] [QueueCleaner] failed to clean Radarr instance | https://subdomain.subdomain.domain.tld/radarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83
[2025-03-18 21:40:00.001 WRN] [ContentBlocker] download client is set to none
[2025-03-18 21:40:00.135 ERR] [QueueCleaner] [Sonarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownSeriesItems=true&includeSeries=true&includeEpisode=true
[2025-03-18 21:40:00.136 ERR] [QueueCleaner] failed to clean Sonarr instance | https://subdomain.subdomain.domain.tld/sonarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83
[2025-03-18 21:40:00.269 ERR] [QueueCleaner] [Radarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownMovieItems=true&includeMovie=true
[2025-03-18 21:40:00.269 ERR] [QueueCleaner] failed to clean Radarr instance | https://subdomain.subdomain.domain.tld/radarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83
[2025-03-18 21:45:00.003 WRN] [ContentBlocker] download client is set to none
[2025-03-18 21:45:01.364 ERR] [QueueCleaner] [Sonarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownSeriesItems=true&includeSeries=true&includeEpisode=true
[2025-03-18 21:45:01.364 ERR] [QueueCleaner] failed to clean Sonarr instance | https://subdomain.subdomain.domain.tld/sonarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83
[2025-03-18 21:45:01.512 ERR] [QueueCleaner] [Radarr] queue list failed | https://subdomain.subdomain.domain.tld/api/v3/queue?page=1&pageSize=200&includeUnknownMovieItems=true&includeMovie=true
[2025-03-18 21:45:01.512 ERR] [QueueCleaner] failed to clean Radarr instance | https://subdomain.subdomain.domain.tld/radarr
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Infrastructure.Verticals.Arr.ArrClient.GetQueueItemsAsync(ArrInstance arrInstance, Int32 page) in /app/Infrastructure/Verticals/Arr/ArrClient.cs:line 55
at Infrastructure.Verticals.Arr.ArrQueueIterator.Iterate(IArrClient arrClient, ArrInstance arrInstance, Func`2 action) in /app/Infrastructure/Verticals/Arr/ArrQueueIterator.cs:line 27
at Infrastructure.Verticals.QueueCleaner.QueueCleaner.ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType) in /app/Infrastructure/Verticals/QueueCleaner/QueueCleaner.cs:line 65
at Infrastructure.Verticals.Jobs.GenericHandler.ProcessArrConfigAsync(ArrConfig config, InstanceType instanceType, Boolean throwOnFailure) in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 83`
@Flaminel commented on GitHub:
Are you using base paths for both download client and arrs? If you're only using them for arrs, you could replace the
latestdocker tag withadd_support_for_arr_base_pathand test the changes that I've done in #96. I would appreciate it if you confirmed it's working fine before I release that.@calrock27 commented on GitHub:
Okay - I've finally gotten home to try this. I'm currently getting a 401 Unauthorized when trying to connect to qBittorrent, but the Sonarr and Radarr instances work flawlessly when I disable the download client! I'll paste the logs below, as well as both of the qBittorrent configurations I've tried. I assumed 401 Unauthorized to mean that it was my fault (credentials?) but I verified against the web UI twice to ensure the credentials worked. Both formats for the qBittorrent base URL resulted in the same error log generated.
Config 1: Using "/qbittorrent" for base URL
- DOWNLOAD_CLIENT=qBittorrent
- QBITTORRENT__URL=https://subdomain.subdomain.domain.tld
- QBITTORRENT__URL_BASE:/qbittorrent
- QBITTORRENT__USERNAME=username
- QBITTORRENT__PASSWORD=password
Config 2: using "qbittorrent" for base URL
- DOWNLOAD_CLIENT=qBittorrent
- QBITTORRENT__URL=https://subdomain.subdomain.domain.tld
- QBITTORRENT__URL_BASE:qbittorrent
- QBITTORRENT__USERNAME=username
- QBITTORRENT__PASSWORD=password
Log below
[2025-03-19 21:34:47.388 INF] cleanuperr v1.5.14 [2025-03-19 21:34:47.396 INF] timezone: (UTC-05:00) America/New_York [2025-03-19 21:34:47.540 INF] Application started. Press Ctrl+C to shut down. [2025-03-19 21:34:47.540 INF] Hosting environment: Production [2025-03-19 21:34:47.540 INF] Content root path: /app [2025-03-19 21:34:47.581 INF] [DownloadCleaner] ignored downloads reloaded [2025-03-19 21:34:48.108 ERR] [DownloadCleaner] DownloadCleaner failed QBittorrent.Client.QBittorrentClientRequestException: Response status code does not indicate success: 401 (Unauthorized). at QBittorrent.Client.Extensions.HttpClientExtensions.EnsureSuccessStatusCodeEx(HttpResponseMessage message) at QBittorrent.Client.Extensions.HttpClientExtensions.GetStringWithCancellationAsync(HttpClient client, Uri uri, Boolean returnEmptyIfNotFound, CancellationToken token) at QBittorrent.Client.QBittorrentClient.GetLegacyApiVersionPrivateAsync(CancellationToken token) at QBittorrent.Client.QBittorrentClient.<>c__DisplayClass7_0.<<-ctor>b__1>d.MoveNext() --- End of stack trace from previous location --- at QBittorrent.Client.QBittorrentClient.PostAsync(Func2 builder, CancellationToken token, ApiLevel minApiLevel, ApiVersion minApiVersion, Nullable1 maxApiVersion) at Infrastructure.Verticals.DownloadClient.QBittorrent.QBitService.LoginAsync() in /app/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs:line 62 at Infrastructure.Verticals.DownloadCleaner.DownloadCleaner.ExecuteAsync() in /app/Infrastructure/Verticals/DownloadCleaner/DownloadCleaner.cs:line 67 at Executable.Jobs.GenericJob1.Execute(IJobExecutionContext context) in /app/Executable/Jobs/GenericJob.cs:line 26[2025-03-19 21:34:48.170 ERR] [ContentBlocker] ContentBlocker failed
QBittorrent.Client.QBittorrentClientRequestException: Response status code does not indicate success: 401 (Unauthorized).
at QBittorrent.Client.Extensions.HttpClientExtensions.EnsureSuccessStatusCodeEx(HttpResponseMessage message)
at QBittorrent.Client.Extensions.HttpClientExtensions.GetStringWithCancellationAsync(HttpClient client, Uri uri, Boolean returnEmptyIfNotFound, CancellationToken token)
at QBittorrent.Client.QBittorrentClient.GetLegacyApiVersionPrivateAsync(CancellationToken token)
at QBittorrent.Client.QBittorrentClient.<>c__DisplayClass7_0.<<-ctor>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at QBittorrent.Client.QBittorrentClient.PostAsync(Func
2 builder, CancellationToken token, ApiLevel minApiLevel, ApiVersion minApiVersion, Nullable1 maxApiVersion)at Infrastructure.Verticals.DownloadClient.QBittorrent.QBitService.LoginAsync() in /app/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs:line 62
at Infrastructure.Verticals.Jobs.GenericHandler.ExecuteAsync() in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 58
at Infrastructure.Verticals.ContentBlocker.ContentBlocker.ExecuteAsync() in /app/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs:line 75
at Executable.Jobs.GenericJob
1.Execute(IJobExecutionContext context) in /app/Executable/Jobs/GenericJob.cs:line 26 [2025-03-19 21:34:48.316 ERR] [QueueCleaner] QueueCleaner failed QBittorrent.Client.QBittorrentClientRequestException: Response status code does not indicate success: 401 (Unauthorized). at QBittorrent.Client.Extensions.HttpClientExtensions.EnsureSuccessStatusCodeEx(HttpResponseMessage message) at QBittorrent.Client.Extensions.HttpClientExtensions.GetStringWithCancellationAsync(HttpClient client, Uri uri, Boolean returnEmptyIfNotFound, CancellationToken token) at QBittorrent.Client.QBittorrentClient.GetLegacyApiVersionPrivateAsync(CancellationToken token) at QBittorrent.Client.QBittorrentClient.<>c__DisplayClass7_0.<<-ctor>b__1>d.MoveNext() --- End of stack trace from previous location --- at QBittorrent.Client.QBittorrentClient.PostAsync(Func2 builder, CancellationToken token, ApiLevel minApiLevel, ApiVersion minApiVersion, Nullable1 maxApiVersion) at Infrastructure.Verticals.DownloadClient.QBittorrent.QBitService.LoginAsync() in /app/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs:line 62 at Infrastructure.Verticals.Jobs.GenericHandler.ExecuteAsync() in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 58 at Executable.Jobs.GenericJob1.Execute(IJobExecutionContext context) in /app/Executable/Jobs/GenericJob.cs:line 26[2025-03-19 21:35:00.143 ERR] [ContentBlocker] ContentBlocker failed
QBittorrent.Client.QBittorrentClientRequestException: Response status code does not indicate success: 401 (Unauthorized).
at QBittorrent.Client.Extensions.HttpClientExtensions.EnsureSuccessStatusCodeEx(HttpResponseMessage message)
at QBittorrent.Client.Extensions.HttpClientExtensions.GetStringWithCancellationAsync(HttpClient client, Uri uri, Boolean returnEmptyIfNotFound, CancellationToken token)
at QBittorrent.Client.QBittorrentClient.GetLegacyApiVersionPrivateAsync(CancellationToken token)
at QBittorrent.Client.QBittorrentClient.<>c__DisplayClass7_0.<<-ctor>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at QBittorrent.Client.QBittorrentClient.PostAsync(Func
2 builder, CancellationToken token, ApiLevel minApiLevel, ApiVersion minApiVersion, Nullable1 maxApiVersion)at Infrastructure.Verticals.DownloadClient.QBittorrent.QBitService.LoginAsync() in /app/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs:line 62
at Infrastructure.Verticals.Jobs.GenericHandler.ExecuteAsync() in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 58
at Infrastructure.Verticals.ContentBlocker.ContentBlocker.ExecuteAsync() in /app/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs:line 75
at Executable.Jobs.GenericJob
1.Execute(IJobExecutionContext context) in /app/Executable/Jobs/GenericJob.cs:line 26 [2025-03-19 21:35:00.475 ERR] [QueueCleaner] QueueCleaner failed QBittorrent.Client.QBittorrentClientRequestException: Response status code does not indicate success: 401 (Unauthorized). at QBittorrent.Client.Extensions.HttpClientExtensions.EnsureSuccessStatusCodeEx(HttpResponseMessage message) at QBittorrent.Client.Extensions.HttpClientExtensions.GetStringWithCancellationAsync(HttpClient client, Uri uri, Boolean returnEmptyIfNotFound, CancellationToken token) at QBittorrent.Client.QBittorrentClient.GetLegacyApiVersionPrivateAsync(CancellationToken token) at QBittorrent.Client.QBittorrentClient.<>c__DisplayClass7_0.<<-ctor>b__1>d.MoveNext() --- End of stack trace from previous location --- at QBittorrent.Client.QBittorrentClient.PostAsync(Func2 builder, CancellationToken token, ApiLevel minApiLevel, ApiVersion minApiVersion, Nullable1 maxApiVersion) at Infrastructure.Verticals.DownloadClient.QBittorrent.QBitService.LoginAsync() in /app/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs:line 62 at Infrastructure.Verticals.Jobs.GenericHandler.ExecuteAsync() in /app/Infrastructure/Verticals/Jobs/GenericHandler.cs:line 58 at Executable.Jobs.GenericJob1.Execute(IJobExecutionContext context) in /app/Executable/Jobs/GenericJob.cs:line 26`@calrock27 commented on GitHub:
Yes! I can do that. However, I am using base paths for both arrs and qbittorrent.
I also meant to post my config earlier but got sidetracked before submitting.
`####################
Cleanuperr
cleanuperr:
image: ghcr.io/flmorg/cleanuperr:latest
container_name: cleanuperr
restart: unless-stopped
volumes:
- /path/cleanuperr/logs:/var/logs
- /path/cleanuperr/ignored.txt:/ignored.txt
environment:
- TZ=America/New_York
- DRY_RUN=false
@Flaminel commented on GitHub:
Hi! Thanks for opening this issue! I'll look into it as soon as possible.
@Flaminel commented on GitHub:
Don't worry about it!
I released v1.5.14 and now it should support base paths for both arrs and download client.
https://github.com/flmorg/cleanuperr/blob/main/variables.md#qbittorrent__url_base
Please let me know if everything works as expected!
@Flaminel commented on GitHub:
I couldn't find a problem while testing, but can you try using
=instead of:here?@Flaminel commented on GitHub:
No problem! Thank you for letting me know it works!
@calrock27 commented on GitHub:
I should've given my config another look before reporting back - that was exactly it. Trying to write tired YAML instead of an an environment variable 😄.
Happy to report that everything is working using a base URL for QBittorrent, Radarr, and Sonarr! Thank you so much for adding base URLs!!