You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
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;
|
|
}
|
|
}
|
|
}
|
|
}
|