1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00
Files
Radarr/src/NzbDrone.Core/Indexers/EzrssTorrentRssParser.cs
T
bakerboy448 6c494e9a92 New: Support for new Nyaa RSS Feed format
(cherry picked from commit 40ecdbc12de8b320a4d650aea65a36e8edea77d8)
2022-05-12 19:16:46 -05:00

35 lines
1.0 KiB
C#

using System.Linq;
using System.Xml.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Indexers.Exceptions;
namespace NzbDrone.Core.Indexers
{
public class EzrssTorrentRssParser : TorrentRssParser
{
public EzrssTorrentRssParser()
{
UseGuidInfoUrl = true;
UseEnclosureLength = false;
UseEnclosureUrl = true;
SeedsElementName = "seeds";
InfoHashElementName = "infoHash";
SizeElementName = "contentLength";
MagnetElementName = "magnetURI";
}
protected override bool PreProcess(IndexerResponse indexerResponse)
{
var document = LoadXmlDocument(indexerResponse);
var items = GetItems(document).ToList();
if (items.Count == 1 && GetTitle(items.First()).Equals("No items exist - Try again later"))
{
throw new IndexerException(indexerResponse, "No results were found");
}
return base.PreProcess(indexerResponse);
}
}
}