mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System.Text;
|
|
using MonoTorrent;
|
|
using NLog;
|
|
using NzbDrone.Core.Configuration;
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
{
|
|
public abstract class TorrentIndexerBase<TSettings> : HttpIndexerBase<TSettings>
|
|
where TSettings : IIndexerSettings, new()
|
|
{
|
|
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
|
|
|
protected TorrentIndexerBase(IIndexerHttpClient httpClient, IEventAggregator eventAggregator, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger)
|
|
: base(httpClient, eventAggregator, indexerStatusService, configService, logger)
|
|
{
|
|
}
|
|
|
|
protected override void ValidateDownloadData(byte[] fileData)
|
|
{
|
|
try
|
|
{
|
|
Torrent.Load(fileData);
|
|
}
|
|
catch
|
|
{
|
|
_logger.Info("Invalid torrent file contents: {0}", Encoding.ASCII.GetString(fileData));
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|