Radarr/NzbDrone.Core/Indexers/NzbsRUs.cs

87 lines
2.6 KiB
C#
Raw Normal View History

2013-02-21 07:07:34 +00:00
using System.Linq;
using System;
using System.Collections.Generic;
using System.ServiceModel.Syndication;
using System.Text.RegularExpressions;
2012-02-11 00:48:20 +00:00
using NzbDrone.Common;
2013-02-24 06:48:52 +00:00
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Model;
2013-02-23 04:37:23 +00:00
namespace NzbDrone.Core.Indexers
{
public class NzbsRUs : IndexerBase
{
2013-02-24 06:48:52 +00:00
public NzbsRUs(HttpProvider httpProvider, IConfigService configService) : base(httpProvider, configService)
{
}
protected override string[] Urls
{
get
{
return new[]
{
string.Format(
"https://www.nzbsrus.com/rssfeed.php?cat=91,75&i={0}&h={1}",
2013-02-24 06:48:52 +00:00
_configService.NzbsrusUId,
_configService.NzbsrusHash)
};
}
}
public override bool IsConfigured
{
get
{
2013-02-24 06:48:52 +00:00
return !string.IsNullOrWhiteSpace(_configService.NzbsrusUId) &&
!string.IsNullOrWhiteSpace(_configService.NzbsrusHash);
}
}
public override string Name
{
get { return "NzbsRUs"; }
}
protected override string NzbDownloadUrl(SyndicationItem item)
{
return item.Links[0].Uri.ToString();
}
2012-05-02 19:02:39 +00:00
protected override string NzbInfoUrl(SyndicationItem item)
{
return item.Links[0].Uri.ToString();
}
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
{
return new List<string>();
}
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
{
return new List<string>();
}
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
{
return new List<string>();
}
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
{
return new List<string>();
}
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
{
if (currentResult != null)
{
var sizeString = Regex.Match(item.Summary.Text, @"\d+\.\d{1,2} \w{3}", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
}
return currentResult;
}
}
}