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

87 lines
2.6 KiB
C#
Raw Normal View History

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