1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/NzbDrone.Core/Indexers/NzbsRUs.cs

87 lines
2.6 KiB
C#
Raw Normal View History

2013-02-21 08:07:34 +01:00
using System.Linq;
using System;
using System.Collections.Generic;
using System.ServiceModel.Syndication;
using System.Text.RegularExpressions;
2012-02-11 01:48:20 +01:00
using NzbDrone.Common;
2013-02-24 07:48:52 +01:00
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Model;
2013-02-23 05:37:23 +01:00
namespace NzbDrone.Core.Indexers
{
public class NzbsRUs : IndexerBase
{
2013-02-24 07:48:52 +01: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 07:48:52 +01:00
_configService.NzbsrusUId,
_configService.NzbsrusHash)
};
}
}
public override bool IsConfigured
{
get
{
2013-02-24 07:48:52 +01: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 21:02:39 +02: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;
}
}
}