|
|
|
@ -4,14 +4,13 @@ using System.ServiceModel.Syndication;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using Ninject;
|
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Model.Search;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
|
{
|
|
|
|
|
public class NzbsOrg : IndexerBase
|
|
|
|
|
{
|
|
|
|
|
[Inject]
|
|
|
|
|
[Inject]
|
|
|
|
|
public NzbsOrg(HttpProvider httpProvider, ConfigProvider configProvider)
|
|
|
|
|
: base(httpProvider, configProvider)
|
|
|
|
|
{
|
|
|
|
@ -23,56 +22,73 @@ namespace NzbDrone.Core.Providers.Indexer
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
string.Format("http://nzbs.org/rss.php?type=1&i={0}&h={1}&num=50&dl=1", _configProvider.NzbsOrgUId, _configProvider.NzbsOrgHash)
|
|
|
|
|
string.Format("http://nzbs.org/rss.php?type=1&i={0}&h={1}&num=50&dl=1",
|
|
|
|
|
_configProvider.NzbsOrgUId, _configProvider.NzbsOrgHash)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
|
|
|
|
{
|
|
|
|
|
get { return "Nzbs.org"; }
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+{2:yyyy.MM.dd}", url, seriesTitle, date));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
|
|
|
|
{
|
|
|
|
|
return item.Id;
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+Season", url, seriesTitle));
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IList<string> GetSearchUrls(SearchModel searchModel)
|
|
|
|
|
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
|
|
|
|
{
|
|
|
|
|
var searchUrls = new List<String>();
|
|
|
|
|
|
|
|
|
|
foreach (var url in Urls)
|
|
|
|
|
{
|
|
|
|
|
if (searchModel.SearchType == SearchType.EpisodeSearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+s{2:00}e{3:00}", url,
|
|
|
|
|
searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodeNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.PartialSeasonSearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}E{3}",
|
|
|
|
|
url, searchModel.SeriesTitle, searchModel.SeasonNumber, searchModel.EpisodePrefix));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.SeasonSearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+Season", url, searchModel.SeriesTitle));
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}", url, searchModel.SeriesTitle, searchModel.SeasonNumber));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchModel.SearchType == SearchType.DailySearch)
|
|
|
|
|
{
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+{2:yyyy.MM.dd}", url, searchModel.SeriesTitle,
|
|
|
|
|
searchModel.AirDate));
|
|
|
|
|
}
|
|
|
|
|
searchUrls.Add(String.Format("{0}&action=search&q={1}+S{2:00}E{3}",
|
|
|
|
|
url, seriesTitle, seasonNumber, episodeWildcard));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return searchUrls;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Nzbs.org"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override string NzbDownloadUrl(SyndicationItem item)
|
|
|
|
|
{
|
|
|
|
|
return item.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
|
|
|
|
{
|
|
|
|
|
if (currentResult != null)
|
|
|
|
|