fix(dl): resolve download links in arr (#100)
ci / web (push) Successful in 36s
e2e / e2e (push) Successful in 1m56s
ci / rust (push) Successful in 4m11s

Transmission has no route to Prowlarr, and Prowlarr redirects a
.torrent link to a magnet that a file fetch cannot follow. arr fetches
the link itself and sends Transmission a magnet or the torrent bytes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-23 08:00:11 +01:00
parent 5db3a8d7a4
commit 4afe44c812
7 changed files with 453 additions and 44 deletions
+6 -4
View File
@@ -16,12 +16,14 @@ const CONNECT_TIMEOUT: Duration = Duration::from_secs(5);
const REQUEST_TIMEOUT: Duration = Duration::from_secs(30);
/// Where Transmission is to get the torrent from.
///
/// Deliberately not an indexer URL: Transmission has no route to Prowlarr and
/// cannot follow its redirect to a magnet, so arr resolves the link itself and
/// hands over the result (issue #100).
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum TorrentSource {
Magnet(String),
/// An HTTP link to a `.torrent`, fetched by Transmission itself. Indexer
/// download links arrive in this form.
Url(String),
/// The bytes of a `.torrent` file, sent inline.
Metainfo(Vec<u8>),
}
@@ -162,7 +164,7 @@ impl TransmissionClient {
});
match request.source {
TorrentSource::Magnet(uri) | TorrentSource::Url(uri) => {
TorrentSource::Magnet(uri) => {
arguments["filename"] = json!(uri);
}
TorrentSource::Metainfo(bytes) => {