2013-02-21 07:07:34 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System;
|
2012-04-14 23:50:08 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ServiceModel.Syndication;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using NzbDrone.Common;
|
2013-02-24 06:48:52 +00:00
|
|
|
|
using NzbDrone.Core.Configuration;
|
2012-04-14 23:50:08 +00:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
|
2013-02-23 04:37:23 +00:00
|
|
|
|
namespace NzbDrone.Core.Indexers
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
public class NzbClub : IndexerBase
|
|
|
|
|
{
|
2013-02-24 06:48:52 +00:00
|
|
|
|
public NzbClub(HttpProvider httpProvider, IConfigService configService)
|
|
|
|
|
: base(httpProvider, configService)
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string[] Urls
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
2012-12-11 16:22:27 +00:00
|
|
|
|
String.Format("http://www.nzbclub.com/nzbfeed.aspx?ig=2&gid=102952&st=1&ns=1&q=%23a.b.teevee"),
|
2012-10-15 02:21:12 +00:00
|
|
|
|
String.Format("http://www.nzbclub.com/nzbfeed.aspx?ig=2&gid=5542&st=1&ns=1&q=")
|
2012-04-14 23:50:08 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool IsConfigured
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "NzbClub"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
{
|
2012-04-19 06:31:44 +00:00
|
|
|
|
return item.Links[0].Uri.ToString();
|
2012-04-14 23:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-02 19:02:39 +00:00
|
|
|
|
protected override string NzbInfoUrl(SyndicationItem item)
|
|
|
|
|
{
|
2012-05-02 22:42:21 +00:00
|
|
|
|
return item.Links[1].Uri.ToString();
|
2012-05-02 19:02:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-27 03:44:52 +00:00
|
|
|
|
protected override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}+{1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-27 03:44:52 +00:00
|
|
|
|
protected override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}+{1}+s{2:00}", url, seriesTitle, seasonNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-27 03:44:52 +00:00
|
|
|
|
protected override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}+{1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-27 03:44:52 +00:00
|
|
|
|
protected override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
2012-04-14 23:50:08 +00:00
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}+{1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
|
|
|
|
{
|
|
|
|
|
if (currentResult != null)
|
|
|
|
|
{
|
|
|
|
|
var sizeString = Regex.Match(item.Summary.Text, @"Size:\s\d+\.\d{1,2}\s\w{2}\s", RegexOptions.IgnoreCase | RegexOptions.Compiled).Value;
|
|
|
|
|
currentResult.Size = Parser.GetReportSize(sizeString);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return currentResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool EnabledByDefault
|
|
|
|
|
{
|
2012-12-22 19:44:47 +00:00
|
|
|
|
get { return false; }
|
2012-04-14 23:50:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string TitlePreParser(SyndicationItem item)
|
|
|
|
|
{
|
|
|
|
|
var title = Parser.ParseHeader(item.Title.Text);
|
|
|
|
|
|
|
|
|
|
if (String.IsNullOrWhiteSpace(title))
|
|
|
|
|
return item.Title.Text;
|
|
|
|
|
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|