mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-02-08 07:52:21 +01:00
Fixed: Indexer with Redirect not using Redirect
This commit is contained in:
parent
87b5f9719e
commit
5833549535
1 changed files with 5 additions and 4 deletions
|
|
@ -99,7 +99,8 @@ private object GetNewznabResponse(NewznabRequest request)
|
|||
|
||||
private object GetDownload(int id)
|
||||
{
|
||||
var indexer = _indexerFactory.Get(id);
|
||||
var indexerDef = _indexerFactory.Get(id);
|
||||
var indexer = _indexerFactory.GetInstance(indexerDef);
|
||||
var link = Request.Query.Link;
|
||||
var file = Request.Query.File;
|
||||
|
||||
|
|
@ -120,10 +121,10 @@ private object GetDownload(int id)
|
|||
var unprotectedlLink = _downloadMappingService.ConvertToNormalLink((string)link.Value);
|
||||
|
||||
// If Indexer is set to download via Redirect then just redirect to the link
|
||||
if (indexer.SupportsRedirect && indexer.Redirect)
|
||||
if (indexer.SupportsRedirect && indexerDef.Redirect)
|
||||
{
|
||||
_downloadService.RecordRedirect(unprotectedlLink, id, source, file);
|
||||
return Response.AsRedirect(unprotectedlLink, RedirectResponse.RedirectType.Temporary);
|
||||
return Response.AsRedirect(unprotectedlLink);
|
||||
}
|
||||
|
||||
var downloadBytes = Array.Empty<byte>();
|
||||
|
|
@ -140,7 +141,7 @@ private object GetDownload(int id)
|
|||
&& downloadBytes[6] == 0x3a)
|
||||
{
|
||||
var magnetUrl = Encoding.UTF8.GetString(downloadBytes);
|
||||
return Response.AsRedirect(magnetUrl, RedirectResponse.RedirectType.Temporary);
|
||||
return Response.AsRedirect(magnetUrl);
|
||||
}
|
||||
|
||||
var contentType = indexer.Protocol == DownloadProtocol.Torrent ? "application/x-bittorrent" : "application/x-nzb";
|
||||
|
|
|
|||
Loading…
Reference in a new issue