mirror of https://github.com/Radarr/Radarr
87 lines
2.5 KiB
C#
87 lines
2.5 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace NzbDrone.Core.Indexers.Omgwtfnzbs
|
|||
|
{
|
|||
|
public class Omgwtfnzbs : BaseIndexer
|
|||
|
{
|
|||
|
private readonly OmgwtfnzbsSetting _settings;
|
|||
|
|
|||
|
public Omgwtfnzbs(IProviderIndexerSetting settingProvider)
|
|||
|
{
|
|||
|
_settings = settingProvider.Get<OmgwtfnzbsSetting>(this);
|
|||
|
}
|
|||
|
|
|||
|
public override string Name
|
|||
|
{
|
|||
|
get { return "omgwtfnzbs"; }
|
|||
|
}
|
|||
|
|
|||
|
public override IEnumerable<string> RecentFeed
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
|
|||
|
yield return
|
|||
|
String.Format("http://rss.omgwtfnzbs.org/rss-search.php?catid=19,20&user={0}&api={1}&eng=1",
|
|||
|
_settings.Username, _settings.ApiKey);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override IIndexerSetting Settings
|
|||
|
{
|
|||
|
get { return _settings; }
|
|||
|
}
|
|||
|
|
|||
|
public override IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
|
|||
|
{
|
|||
|
var searchUrls = new List<string>();
|
|||
|
|
|||
|
foreach (var url in RecentFeed)
|
|||
|
{
|
|||
|
searchUrls.Add(String.Format("{0}&search={1}+S{2:00}E{3:00}", url, seriesTitle, seasonNumber, episodeNumber));
|
|||
|
}
|
|||
|
|
|||
|
return searchUrls;
|
|||
|
}
|
|||
|
|
|||
|
public override IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
|
|||
|
{
|
|||
|
var searchUrls = new List<String>();
|
|||
|
|
|||
|
foreach (var url in RecentFeed)
|
|||
|
{
|
|||
|
searchUrls.Add(String.Format("{0}&search={1}+{2:yyyy MM dd}", url, seriesTitle, date));
|
|||
|
}
|
|||
|
|
|||
|
return searchUrls;
|
|||
|
}
|
|||
|
|
|||
|
public override IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
|
|||
|
{
|
|||
|
var searchUrls = new List<String>();
|
|||
|
|
|||
|
foreach (var url in RecentFeed)
|
|||
|
{
|
|||
|
searchUrls.Add(String.Format("{0}&search={1}+S{2:00}", url, seriesTitle, seasonNumber));
|
|||
|
}
|
|||
|
|
|||
|
return searchUrls;
|
|||
|
}
|
|||
|
|
|||
|
public override IEnumerable<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
|
|||
|
{
|
|||
|
var searchUrls = new List<String>();
|
|||
|
|
|||
|
foreach (var url in RecentFeed)
|
|||
|
{
|
|||
|
searchUrls.Add(String.Format("{0}&search={1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard));
|
|||
|
}
|
|||
|
|
|||
|
return searchUrls;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|