fix(dl): resolve download links in arr (#100)
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user