mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04:00
Fixed: Push to client for Cardigann magnet links
This commit is contained in:
parent
ae9930a03f
commit
f56ce129e6
1 changed files with 15 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MonoTorrent;
|
||||
using NLog;
|
||||
|
@ -126,6 +127,20 @@ namespace NzbDrone.Core.Download
|
|||
|
||||
torrentFile = await indexer.Download(new Uri(torrentUrl));
|
||||
|
||||
// handle magnet URLs
|
||||
if (torrentFile.Length >= 7
|
||||
&& torrentFile[0] == 0x6d
|
||||
&& torrentFile[1] == 0x61
|
||||
&& torrentFile[2] == 0x67
|
||||
&& torrentFile[3] == 0x6e
|
||||
&& torrentFile[4] == 0x65
|
||||
&& torrentFile[5] == 0x74
|
||||
&& torrentFile[6] == 0x3a)
|
||||
{
|
||||
var magnetUrl = Encoding.UTF8.GetString(torrentFile);
|
||||
return DownloadFromMagnetUrl(release, magnetUrl);
|
||||
}
|
||||
|
||||
var filename = string.Format("{0}.torrent", StringUtil.CleanFileName(release.Title));
|
||||
var hash = _torrentFileInfoReader.GetHashFromTorrentFile(torrentFile);
|
||||
var actualHash = AddFromTorrentFile(release, hash, filename, torrentFile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue