|
|
@ -4,7 +4,6 @@ using System.ServiceModel.Syndication;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using Ninject;
|
|
|
|
using Ninject;
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
using NzbDrone.Core.Model.Search;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
namespace NzbDrone.Core.Providers.Indexer
|
|
|
@ -12,7 +11,8 @@ namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
public class NzbMatrix : IndexerBase
|
|
|
|
public class NzbMatrix : IndexerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[Inject]
|
|
|
|
[Inject]
|
|
|
|
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider)
|
|
|
|
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider)
|
|
|
|
|
|
|
|
: base(httpProvider, configProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -30,51 +30,66 @@ namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return "NzbMatrix"; }
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return item.Links[0].Uri.ToString();
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
|
|
return searchUrls;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
foreach (var url in Urls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+Season", url, seriesTitle));
|
|
|
|
{
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+s{2:00}e{3:00}", url, searchModel.SeriesTitle,
|
|
|
|
|
|
|
|
searchModel.SeasonNumber, searchModel.EpisodeNumber));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
|
|
|
return searchUrls;
|
|
|
|
{
|
|
|
|
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}",
|
|
|
|
|
|
|
|
url, searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
|
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+Season", url, searchModel.SeriesTitle));
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}", url, searchModel.SeriesTitle, searchModel.SeasonNumber));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.DailySearch)
|
|
|
|
foreach (var url in Urls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+{2:yyyy MM dd}", url, searchModel.SeriesTitle,
|
|
|
|
searchUrls.Add(String.Format("{0}&term={1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard));
|
|
|
|
searchModel.AirDate));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
return searchUrls;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return "NzbMatrix"; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return item.Links[0].Uri.ToString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
|
|
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (currentResult != null)
|
|
|
|
if (currentResult != null)
|
|
|
|