Newzbin and NzbsRus

New: Removed Newzbin
Fixed: NzbsRus now uses SSL.
pull/20/merge
Mark McDowall 12 years ago
parent 0758a5eb1e
commit 05e4523bee

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xml:lang="en-GB"
xmlns:report="http://www.newzbin2.es/DTD/2007/feeds/report/">
<channel>
<title>www.newzbin.com (reports)</title>
<link>http://www.newzbin.com/browse/category/p/tv/</link>
<description>Newzbin Reports Feed</description>
<pubDate>Mon, 25 Apr 2011 16:08:24 GMT</pubDate>
<ttl>42</ttl>
<generator>www.newzbin.com - Usenet Search</generator>
<copyright>Copyright (c) 2002 - 2007 Newzbin Limited. All Rights Reserved.</copyright>
<image>
<url>http://www.newzbin.com/m/i/logo/newzbinv3.png</url>
<link>http://www.newzbin.com/browse/category/p/tv/</link>
<title>www.newzbin.com</title>
<description>Visit Newzbin.com - The Ultimate In Usenet Indexing</description>
</image>
<item>
<title>Rookie Blue - 1x10 - Big Nickel</title>
<guid isPermaLink="true">http://www.newzbin.com/browse/post/6076287/</guid>
<link>http://www.newzbin.com/browse/post/6076287/</link>
<comments>http://www.newzbin.com/browse/post/6076287/#CommentsPH</comments>
<description>
<![CDATA[
<ul>
<li>
ID: <a href="http://www.newzbin.com/browse/post/6076287">6076287</a>
(<a
href="http://www.newzbin.com/account/bookmarks/add/?ps_id=6076287">Bookmark</a>)
(<a href="http://www.newzbin.com/browse/post/6076287/nzb/">NZB</a>)
(<a href="http://www.newzbin.com/nfo/view/txt/373966350/">NFO</a>)
(<a href="http://www.tvrage.com/Rookie_Blue/episodes/1064943067/1x10/">More Info</a>)
(Size: 1,235.6MB)
</li>
<li>
Attributes:
Category - TV
| Video Source - TV Cap, HDTV | Video Format - x264, 720p | Video Genre - Action/Adv, Crime, Drama, Family | Language - English, German
</li>
<li>Groups: alt.binaries.illuminaten</li>
<li>Poster: AuToMaTiC &#60;AuTo@Illuminatenboard.org&#62;</li>
<li>PostDate: Sunday 06 Mar 2011, 01:05PM PDT</li>
</ul> ]]>
</description>
<report:id>6076287</report:id>
<report:category>TV</report:category>
<report:attributes>
<report:attribute type="Source">TV Cap</report:attribute>
<report:attribute type="Source">HDTV</report:attribute>
<report:attribute type="Video Fmt">x264</report:attribute>
<report:attribute type="Video Fmt">720p</report:attribute>
<report:attribute type="Video Genre">Action/Adv</report:attribute>
<report:attribute type="Video Genre">Crime</report:attribute>
<report:attribute type="Video Genre">Drama</report:attribute>
<report:attribute type="Video Genre">Family</report:attribute>
<report:attribute type="Language">English</report:attribute>
<report:attribute type="Language">German</report:attribute>
</report:attributes>
<report:groups>
<report:group>alt.binaries.illuminaten</report:group>
</report:groups>
<report:progress value="1">Report is complete</report:progress>
<report:moreinfo>http://www.tvrage.com/Rookie_Blue/episodes/1064943067/1x10/</report:moreinfo>
<report:nfo>
<report:fileid>373966350</report:fileid>
<report:filename>rookieblue-s01e10-720p-tvp.nfo</report:filename>
<report:link>http://www.newzbin.com/nfo/view/txt/373966350/</report:link>
</report:nfo>
<report:nzb>http://www.newzbin.com/browse/post/6076287/nzb/</report:nzb>
<report:poster>AuToMaTiC &#60;AuTo@Illuminatenboard.org&#62;</report:poster>
<report:size type="bytes">1295652290</report:size>
<report:postdate>Sun, 06 Mar 2011 21:05:58 GMT</report:postdate>
<report:stats>
<report:views>2</report:views>
<report:comments>0</report:comments>
</report:stats>
<enclosure url="http://www.newzbin.com/browse/post/6076287/nzb/"
length="1295652290" type="application/x-nzb" />
<pubDate>Mon, 25 Apr 2011 11:55:04 GMT</pubDate>
</item>
</channel>
</rss>

File diff suppressed because it is too large Load Diff

@ -65,9 +65,6 @@ namespace NzbDrone.Core.Test
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NzbMatrixApiKey).Returns("MockedConfigValue");
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NzbMatrixUsername).Returns("MockedConfigValue");
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NewzbinUsername).Returns("MockedConfigValue");
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NewzbinPassword).Returns("MockedConfigValue");
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NzbsOrgHash).Returns("MockedConfigValue");
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.NzbsOrgUId).Returns("MockedConfigValue");
@ -78,66 +75,6 @@ namespace NzbDrone.Core.Test
Mocker.GetMock<ConfigProvider>().SetupGet(c => c.FileSharingTalkSecret).Returns("MockedConfigValue");
}
[Test]
public void newzbin_parses_languae()
{
WithConfiguredIndexers();
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\newbin_none_english.xml"));
var newzbin = Mocker.Resolve<Newzbin>();
var parseResults = newzbin.FetchRss();
foreach (var episodeParseResult in parseResults)
{
var Uri = new Uri(episodeParseResult.NzbUrl);
Uri.PathAndQuery.Should().NotContain("//");
}
parseResults.Should().NotBeEmpty();
parseResults.Should().NotContain(e => e.Language == LanguageType.English);
}
[Test]
public void newzbin_rss_fetch()
{
Mocker.Resolve<HttpProvider>();
var fakeSettings = Builder<IndexerDefinition>.CreateNew().Build();
Mocker.GetMock<IndexerProvider>()
.Setup(c => c.GetSettings(It.IsAny<Type>()))
.Returns(fakeSettings);
Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NewzbinUsername)
.Returns("nzbdrone");
Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NewzbinPassword)
.Returns("smartar39865");
var newzbinProvider = Mocker.Resolve<Newzbin>();
var parseResults = newzbinProvider.FetchRss();
foreach (var episodeParseResult in parseResults)
{
var Uri = new Uri(episodeParseResult.NzbUrl);
Uri.PathAndQuery.Should().NotContain("//");
}
parseResults.Should().NotBeEmpty();
parseResults.Should().OnlyContain(s => s.Indexer == newzbinProvider.Name);
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
Mark500Inconclusive();
ExceptionVerification.IgnoreWarns();
}
[Test]
public void custome_parser_partial_success()
{
@ -204,27 +141,6 @@ namespace NzbDrone.Core.Test
ExceptionVerification.IgnoreWarns();
}
[TestCase("simpsons", 21, 23)]
[TestCase("Hawaii Five-0 (2010)", 1, 1)]
[TestCase("In plain Sight", 1, 11, Ignore = true)]
public void newzbin_search_returns_valid_results(string title, int season, int episode)
{
Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NewzbinUsername)
.Returns("nzbdrone");
Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NewzbinPassword)
.Returns("smartar39865");
Mocker.Resolve<HttpProvider>();
var result = Mocker.Resolve<Newzbin>().FetchEpisode(title, season, episode);
Mark500Inconclusive();
result.Should().NotBeEmpty();
}
[TestCase("simpsons", 21, 23)]
[TestCase("The walking dead", 2, 10)]
public void nzbmatrix_search_returns_valid_results(string title, int season, int episode)
@ -277,22 +193,6 @@ namespace NzbDrone.Core.Test
result.Should().Be(clean);
}
[Test]
public void size_newzbin()
{
WithConfiguredIndexers();
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\newzbin.xml"));
//Act
var parseResults = Mocker.Resolve<Newzbin>().FetchRss();
parseResults.Should().HaveCount(1);
parseResults[0].Size.Should().Be(1295620506);
}
[Test]
public void size_nzbmatrix()
{
@ -523,26 +423,6 @@ namespace NzbDrone.Core.Test
}
}
[Test]
public void Newzbin_NzbInfoUrl_should_contain_information_string()
{
WithConfiguredIndexers();
const string fileName = "newzbin.xml";
const string expectedString = "browse";
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\" + fileName));
var parseResults = Mocker.Resolve<Newzbin>().FetchRss();
foreach (var episodeParseResult in parseResults)
{
episodeParseResult.NzbInfoUrl.Should().Contain(expectedString);
}
}
[Test]
public void NzbMatrix_NzbInfoUrl_should_contain_information_string()
{
@ -676,22 +556,6 @@ namespace NzbDrone.Core.Test
}
}
[Test]
public void releaseGroup_should_use_nfo_filename_for_newzbin()
{
WithConfiguredIndexers();
Mocker.GetMock<HttpProvider>()
.Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
.Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\newzbin.xml"));
//Act
var parseResults = Mocker.Resolve<Newzbin>().FetchRss();
parseResults.Should().HaveCount(1);
parseResults[0].ReleaseGroup.Should().Be("tvp");
}
[TestCase("30 Rock", "30%20Rock")]
[TestCase("The Office (US)", "Office%20US")]
[TestCase("Revenge", "Revenge")]
@ -704,4 +568,4 @@ namespace NzbDrone.Core.Test
Mocker.Resolve<Newznab>().GetQueryTitle(seriesTitle).Should().Be(expected);
}
}
}
}

@ -306,9 +306,6 @@
<Content Include="Files\Categories_json.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Files\RSS\SizeParsing\newzbin.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Files\RSS\SizeParsing\newznab.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -321,9 +318,6 @@
<Content Include="Files\Feed.nzbmatrix.com.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Files\RSS\newzbin.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Files\RSS\nzbmatrix.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

@ -88,7 +88,6 @@ namespace NzbDrone.Core
logger.Debug("Initializing Indexers...");
Kernel.Bind<IndexerBase>().To<NzbMatrix>();
Kernel.Bind<IndexerBase>().To<NzbsRUs>();
Kernel.Bind<IndexerBase>().To<Newzbin>();
Kernel.Bind<IndexerBase>().To<Newznab>();
Kernel.Bind<IndexerBase>().To<Wombles>();
Kernel.Bind<IndexerBase>().To<FileSharingTalk>();

@ -0,0 +1,18 @@
using System;
using System.Data;
using Migrator.Framework;
using NzbDrone.Common;
namespace NzbDrone.Core.Datastore.Migrations
{
[Migration(20121202)]
public class Migration20121202 : NzbDroneMigration
{
protected override void MainDbUpgrade()
{
Database.ExecuteNonQuery("DELETE FROM Config WHERE [KEY] = 'NewzbinUsername'");
Database.ExecuteNonQuery("DELETE FROM Config WHERE [KEY] = 'NewzbinPassword'");
Database.ExecuteNonQuery("DELETE FROM IndexerDefinitions WHERE IndexProviderType = 'NzbDrone.Core.Providers.Indexer.Newzbin'");
}
}
}

@ -227,6 +227,7 @@
<Compile Include="Datastore\MigrationLogger.cs" />
<Compile Include="Datastore\MigrationsHelper.cs" />
<Compile Include="Datastore\CustomeMapper.cs" />
<Compile Include="Datastore\Migrations\Migration20121202.cs" />
<Compile Include="Datastore\Migrations\Migration20121122.cs" />
<Compile Include="Datastore\Migrations\Migration20121016.cs" />
<Compile Include="Datastore\Migrations\Migration20121012.cs" />
@ -450,9 +451,6 @@
<Compile Include="Providers\Indexer\IndexerBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Providers\Indexer\Newzbin.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Providers\Indexer\Newznab.cs">
<SubType>Code</SubType>
</Compile>

@ -75,20 +75,6 @@ namespace NzbDrone.Core.Providers.Core
set { SetValue("NzbsrusHash", value); }
}
public virtual String NewzbinUsername
{
get { return GetValue("NewzbinUsername"); }
set { SetValue("NewzbinUsername", value); }
}
public virtual String NewzbinPassword
{
get { return GetValue("NewzbinPassword"); }
set { SetValue("NewzbinPassword", value); }
}
public virtual String FileSharingTalkUid
{
get { return GetValue("FileSharingTalkUid"); }

@ -1,142 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.ServiceModel.Syndication;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using Ninject;
using NzbDrone.Common;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Providers.Indexer
{
public class Newzbin : IndexerBase
{
private const string ROOT_DOMAIN = "https://www.newzbin2.es";
[Inject]
public Newzbin(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider)
{
}
private const string URL_PARAMS = "feed=rss&hauth=1&ps_rb_language=4096&ps_rb_video_format=3082257";
protected override string[] Urls
{
get
{
return new[]
{
ROOT_DOMAIN + "/browse/category/p/tv?" + URL_PARAMS
};
}
}
public override bool IsConfigured
{
get
{
return !string.IsNullOrWhiteSpace(_configProvider.NewzbinUsername) &&
!string.IsNullOrWhiteSpace(_configProvider.NewzbinPassword);
}
}
protected override NetworkCredential Credentials
{
get { return new NetworkCredential(_configProvider.NewzbinUsername, _configProvider.NewzbinPassword); }
}
protected override IList<string> GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber)
{
return new List<string>
{
String.Format(
ROOT_DOMAIN + @"/search/query/?q={0}+{1}x{2:00}&fpn=p&searchaction=Go&category=8&{3}",
seriesTitle, seasonNumber,episodeNumber, URL_PARAMS)
};
}
protected override IList<string> GetSeasonSearchUrls(string seriesTitle, int seasonNumber)
{
return new List<string>
{
String.Format(
ROOT_DOMAIN + @"/search/query/?q={0}+Season+{1}&fpn=p&searchaction=Go&category=8&{2}",
seriesTitle, seasonNumber, URL_PARAMS)
};
}
protected override IList<string> GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date)
{
return new List<string>
{
String.Format(
ROOT_DOMAIN + @"/search/query/?q={0}+{1:yyyy-MM-dd}&fpn=p&searchaction=Go&category=8&{2}",
seriesTitle, date, URL_PARAMS)
};
}
protected override IList<string> GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard)
{
return new List<string>
{
String.Format(
ROOT_DOMAIN + @"/search/query/?q={0}+{1}x{2}&fpn=p&searchaction=Go&category=8&{3}",
seriesTitle, seasonNumber, episodeWildcard, URL_PARAMS)
};
}
public override string Name
{
get { return "Newzbin"; }
}
protected override string NzbDownloadUrl(SyndicationItem item)
{
return item.Id + "nzb";
}
protected override string NzbInfoUrl(SyndicationItem item)
{
return item.Links[0].Uri.ToString();
}
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
{
if (currentResult != null)
{
var quality = Parser.ParseQuality(item.Summary.Text);
currentResult.Quality = quality;
var languageString = Regex.Match(item.Summary.Text, @"Language - \w*", RegexOptions.IgnoreCase).Value;
currentResult.Language = Parser.ParseLanguage(languageString);
var sizeString = Regex.Match(item.Summary.Text, @"\(Size: \d*\,?\d+\.\d{1,2}\w{2}\)", RegexOptions.IgnoreCase).Value;
currentResult.Size = Parser.GetReportSize(sizeString);
try
{
var releaseGroupText = item.ElementExtensions.Single(s => s.OuterName == "nfo")
.GetObject<XElement>()
.Element(XName.Get("filename", "http://www.newzbin2.es/DTD/2007/feeds/report/"))
.Value;
var releaseGroup = Parser.ParseReleaseGroup(releaseGroupText.Replace(".nfo", ""));
currentResult.ReleaseGroup = releaseGroup;
}
catch(Exception ex)
{
_logger.TraceException("Error getting release group for newzbin release", ex);
currentResult.ReleaseGroup = "";
}
}
return currentResult;
}
}
}

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Providers.Indexer
return new[]
{
string.Format(
"http://www.nzbsrus.com/rssfeed.php?cat=91,75&i={0}&h={1}",
"https://www.nzbsrus.com/rssfeed.php?cat=91,75&i={0}&h={1}",
_configProvider.NzbsrusUId,
_configProvider.NzbsrusHash)
};

@ -101,15 +101,11 @@ namespace NzbDrone.Web.Controllers
NzbsrusUId = _configProvider.NzbsrusUId,
NzbsrusHash = _configProvider.NzbsrusHash,
NewzbinUsername = _configProvider.NewzbinUsername,
NewzbinPassword = _configProvider.NewzbinPassword,
FileSharingTalkUid = _configProvider.FileSharingTalkUid,
FileSharingTalkSecret = _configProvider.FileSharingTalkSecret,
NzbMatrixEnabled = _indexerProvider.GetSettings(typeof(NzbMatrix)).Enable,
NzbsRUsEnabled = _indexerProvider.GetSettings(typeof(NzbsRUs)).Enable,
NewzbinEnabled = _indexerProvider.GetSettings(typeof(Newzbin)).Enable,
NewznabEnabled = _indexerProvider.GetSettings(typeof(Newznab)).Enable,
WomblesEnabled = _indexerProvider.GetSettings(typeof(Wombles)).Enable,
FileSharingTalkEnabled = _indexerProvider.GetSettings(typeof(FileSharingTalk)).Enable,
@ -387,10 +383,6 @@ namespace NzbDrone.Web.Controllers
nzbsRUsSettings.Enable = data.NzbsRUsEnabled;
_indexerProvider.SaveSettings(nzbsRUsSettings);
var newzbinSettings = _indexerProvider.GetSettings(typeof(Newzbin));
newzbinSettings.Enable = data.NewzbinEnabled;
_indexerProvider.SaveSettings(newzbinSettings);
var newznabSettings = _indexerProvider.GetSettings(typeof(Newznab));
newznabSettings.Enable = data.NewznabEnabled;
_indexerProvider.SaveSettings(newznabSettings);
@ -417,9 +409,6 @@ namespace NzbDrone.Web.Controllers
_configProvider.NzbsrusUId = data.NzbsrusUId;
_configProvider.NzbsrusHash = data.NzbsrusHash;
_configProvider.NewzbinUsername = data.NewzbinUsername;
_configProvider.NewzbinPassword = data.NewzbinPassword;
_configProvider.FileSharingTalkUid = data.FileSharingTalkUid;
_configProvider.FileSharingTalkSecret = data.FileSharingTalkSecret;

@ -37,20 +37,6 @@ namespace NzbDrone.Web.Models
[RequiredIf("NzbsRUsEnabled", true, ErrorMessage = "API Key Required when NzbsRus is enabled")]
public String NzbsrusHash { get; set; }
[DataType(DataType.Text)]
[DisplayName("Username")]
[Description("Username for Newzbin")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
[RequiredIf("NewzbinEnabled", true, ErrorMessage = "Username Required when Newzbin is enabled")]
public String NewzbinUsername { get; set; }
[DataType(DataType.Text)]
[DisplayName("Password")]
[Description("Password for Newzbin")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
[RequiredIf("NewzbinEnabled", true, ErrorMessage = "Password Required when Newzbin is enabled")]
public String NewzbinPassword { get; set; }
[DataType(DataType.Text)]
[DisplayName("UID")]
[Description("UserID for File Sharing Talk")]
@ -73,10 +59,6 @@ namespace NzbDrone.Web.Models
[Description("Enable downloading episodes from NZBsRus")]
public bool NzbsRUsEnabled { get; set; }
[DisplayName("Newzbin")]
[Description("Enable downloading episodes from Newzbin")]
public bool NewzbinEnabled { get; set; }
[DisplayName("Newznab")]
[Description("Enable downloading episodes from Newznab Providers")]
public bool NewznabEnabled { get; set; }

@ -18,9 +18,6 @@
@Html.CheckBox("nzbsRusStatus", @Model.NzbsRUsEnabled, new { @class = "indexerStatusButton" })
<label for="nzbsRusStatus">NZBsRus</label>
@Html.CheckBox("newzbinStatus", @Model.NewzbinEnabled, new { @class = "indexerStatusButton" })
<label for="newzbinStatus">Newzbin</label>
@Html.CheckBox("newznabStatus", @Model.NewznabEnabled, new { @class = "indexerStatusButton" })
<label for="newznabStatus">Newznab</label>
@ -77,24 +74,6 @@
@Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
</div>
<h3><a href="#">Newzbin</a></h3>
<div class="indexerPanel">
<label class="labelClass">
Enable <span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass enabledCheck" })
<label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername)
<span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span>
<span class="small">@Html.ValidationMessageFor(m => m.NewzbinUsername)</span>
</label>
@Html.TextBoxFor(m => m.NewzbinUsername, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NewzbinPassword)
<span class="small">@Html.DescriptionFor(m => m.NewzbinPassword)</span>
<span class="small">@Html.ValidationMessageFor(m => m.NewzbinPassword)</span>
</label>
@Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass", type = "password" })
</div>
<h3><a href="#">Newznab</a></h3>
<div class="indexerPanel">
<label class="labelClass">

Loading…
Cancel
Save