Belated removal of bitmetv and cleanup of usenet-crawler.

pull/3596/head
Taloth Saldono 5 years ago
parent 99728a604d
commit 1d339ad4f1

@ -11,7 +11,6 @@ namespace NzbDrone.Common.Test.InstrumentationTests
[TestCase(@"https://iptorrents.com/torrents/rss?u=mySecret;tp=mySecret;l5;download")]
[TestCase(@"http://rss.torrentleech.org/mySecret")]
[TestCase(@"http://rss.torrentleech.org/rss/download/12345/01233210/filename.torrent")]
[TestCase(@"http://www.bitmetv.org/rss.php?uid=mySecret&passkey=mySecret")]
[TestCase(@"https://rss.omgwtfnzbs.org/rss-search.php?catid=19,20&user=sonarr&api=mySecret&eng=1")]
[TestCase(@"https://dognzb.cr/fetch/2b51db35e1912ffc138825a12b9933d2/2b51db35e1910123321025a12b9933d2")]
[TestCase(@"https://baconbits.org/feeds.php?feed=torrents_tv&user=12345&auth=2b51db35e1910123321025a12b9933d2&passkey=mySecret&authkey=2b51db35e1910123321025a12b9933d2")]

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="0.91">
<channel>
<ttl>10</ttl>
<title>BitMeTV.ORG</title>
<link>http://www.bitmetv.org</link>
<description>This is a private - by registration only - website. You can help keep it alive by donating: http://www.bitmetv.org/donate.php</description>
<language>en-usde</language>
<copyright>Copyright © 2004 - 2007 BitMeTV.ORG</copyright>
<webMaster>noreply@bitmetv.org</webMaster>
<image>
<title>BitMeTV.ORG</title>
<url>http://www.bitmetv.org/favicon.ico</url>
<link>http://www.bitmetv.org</link>
<width>16</width>
<height>16</height>
<description>This is a private - by registration only - website. You can help keep it alive by donating: http://www.bitmetv.org/donate.php</description>
</image>
<item>
<title>Total.Divas.S02E08.HDTV.x264-CRiMSON</title>
<link>http://www.bitmetv.org/download.php/12/Total.Divas.S02E08.HDTV.x264-CRiMSON.torrent</link>
<pubDate>Tue, 13 May 2014 17:04:29 -0000</pubDate>
<description>
Category: (Reality TV - Un-scripted)
Size: 376.71 MB
</description>
</item>
<item>
<title>Aqua.Teen.Hunger.Force.S10.INTERNAL.HDTV.x264-BitMeTV</title>
<link>http://www.bitmetv.org/download.php/34/Aqua.Teen.Hunger.Force.S10.INTERNAL.HDTV.x264-BitMeTV.torrent</link>
<pubDate>Tue, 13 May 2014 17:03:12 -0000</pubDate>
<description>
Category: (Adult Swim)
Size: 725.46 MB
</description>
</item>
<item>
<title>Antiques.Roadshow.US.S18E16.720p.HDTV.x264-BAJSKORV</title>
<link>http://www.bitmetv.org/download.php/56/Antiques.Roadshow.US.S18E16.720p.HDTV.x264-BAJSKORV.torrent</link>
<pubDate>Tue, 13 May 2014 16:47:05 -0000</pubDate>
<description>
Category: (Reality TV - Un-scripted)
Size: 960.15 MB
</description>
</item>
<item>
<title>Seth.Meyers.2014.05.12.Chris.O.Dowd-Emma.Roberts.HDTV.x264-CROOKS</title>
<link>http://www.bitmetv.org/download.php/78/Seth.Meyers.2014.05.12.Chris.O.Dowd-Emma.Roberts.HDTV.x264-CROOKS.torrent</link>
<pubDate>Tue, 13 May 2014 16:01:21 -0000</pubDate>
<description>
Category: Seth Meyers
Size: 301.31 MB
</description>
</item>
<item>
<title>The.Mole.Australia.Season.4</title>
<link>http://www.bitmetv.org/download.php/910/The%20Mole%20Australia%20-%20Season%204.torrent</link>
<pubDate>Tue, 13 May 2014 15:52:54 -0000</pubDate>
<description>
Category: (Reality TV - Competitive)
Size: 2.13 GB
</description>
</item>
</channel>
</rss>

@ -1,57 +0,0 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.BitMeTv;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using System;
using System.Linq;
using FluentAssertions;
namespace NzbDrone.Core.Test.IndexerTests.BitMeTvTests
{
[TestFixture]
public class BitMeTvFixture : CoreTest<BitMeTv>
{
[SetUp]
public void Setup()
{
Subject.Definition = new IndexerDefinition()
{
Name = "BitMeTV",
Settings = new BitMeTvSettings() { Cookie = "uid=123" }
};
}
[Test]
public void should_parse_recent_feed_from_BitMeTv()
{
var recentFeed = ReadAllText(@"Files/Indexers/BitMeTv/BitMeTv.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
var releases = Subject.FetchRecent();
releases.Should().HaveCount(5);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = releases.First() as TorrentInfo;
torrentInfo.Title.Should().Be("Total.Divas.S02E08.HDTV.x264-CRiMSON");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("http://www.bitmetv.org/download.php/12/Total.Divas.S02E08.HDTV.x264-CRiMSON.torrent");
torrentInfo.InfoUrl.Should().BeNullOrEmpty();
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2014/05/13 17:04:29"));
torrentInfo.Size.Should().Be(395009065);
torrentInfo.InfoHash.Should().Be(null);
torrentInfo.MagnetUrl.Should().Be(null);
torrentInfo.Peers.Should().Be(null);
torrentInfo.Seeders.Should().Be(null);
}
}
}

@ -253,7 +253,6 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
});
}
[TestCase("BitMeTv/BitMeTv.xml")]
[TestCase("IPTorrents/IPTorrents.xml")]
[TestCase("Nyaa/Nyaa.xml")]
[TestCase("Torznab/torznab_hdaccess_net.xml")]

@ -0,0 +1,17 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(138)]
public class remove_bitmetv : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.Sql("DELETE FROM Indexers WHERE Implementation = 'BitMeTv'");
// Also disable usenet-crawler for the poor guys that still have it enabled
Execute.Sql("UPDATE Indexers SET EnableRss = 0, EnableAutomaticSearch = 0, EnableInteractiveSearch = 0 WHERE Implementation = 'Newznab' AND Settings LIKE '%usenet-crawler.com%'");
}
}
}

@ -1,32 +0,0 @@
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NLog;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.Indexers.BitMeTv
{
public class BitMeTv : HttpIndexerBase<BitMeTvSettings>
{
public override string Name => "BitMeTV";
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
public override bool SupportsSearch => false;
public override int PageSize => 0;
public BitMeTv(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
: base(httpClient, indexerStatusService, configService, parsingService, logger)
{
}
public override IIndexerRequestGenerator GetRequestGenerator()
{
return new BitMeTvRequestGenerator() { Settings = Settings };
}
public override IParseIndexerResponse GetParser()
{
return new TorrentRssParser() { ParseSizeInDescription = true };
}
}
}

@ -1,62 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers.BitMeTv
{
public class BitMeTvRequestGenerator : IIndexerRequestGenerator
{
public BitMeTvSettings Settings { get; set; }
public virtual IndexerPageableRequestChain GetRecentRequests()
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetRssRequests());
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailySeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
private IEnumerable<IndexerRequest> GetRssRequests()
{
var request = new IndexerRequest(string.Format("{0}/rss.php?uid={1}&passkey={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.UserId, Settings.RssPasskey), HttpAccept.Html);
foreach (var cookie in HttpHeader.ParseCookies(Settings.Cookie))
{
request.HttpRequest.Cookies[cookie.Key] = cookie.Value;
}
yield return request;
}
}
}

@ -1,60 +0,0 @@
using System.Text.RegularExpressions;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.BitMeTv
{
public class BitMeTvSettingsValidator : AbstractValidator<BitMeTvSettings>
{
public BitMeTvSettingsValidator()
{
RuleFor(c => c.BaseUrl).ValidRootUrl();
RuleFor(c => c.UserId).NotEmpty();
RuleFor(c => c.RssPasskey).NotEmpty();
RuleFor(c => c.Cookie).NotEmpty();
RuleFor(c => c.Cookie)
.Matches(@"pass=[0-9a-f]{32}", RegexOptions.IgnoreCase)
.WithMessage("Wrong pattern")
.AsWarning();
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
}
}
public class BitMeTvSettings : ITorrentIndexerSettings
{
private static readonly BitMeTvSettingsValidator Validator = new BitMeTvSettingsValidator();
public BitMeTvSettings()
{
BaseUrl = "https://www.bitmetv.org";
MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS;
}
[FieldDefinition(0, Label = "Website URL")]
public string BaseUrl { get; set; }
[FieldDefinition(1, Label = "UserId")]
public string UserId { get; set; }
[FieldDefinition(2, Label = "RSS Passkey")]
public string RssPasskey { get; set; }
[FieldDefinition(3, Label = "Cookie", HelpText = "BitMeTv uses a login cookie needed to access the rss, you'll have to retrieve it via a browser.")]
public string Cookie { get; set; }
[FieldDefinition(4, Type = FieldType.Number, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(5)]
public SeedCriteriaSettings SeedCriteria { get; } = new SeedCriteriaSettings();
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}

@ -51,7 +51,6 @@ namespace NzbDrone.Core.Indexers.Newznab
yield return GetDefinition("OZnzb.com", GetSettings("https://api.oznzb.com"));
yield return GetDefinition("SimplyNZBs", GetSettings("https://simplynzbs.com"));
yield return GetDefinition("Tabula Rasa", GetSettings("https://www.tabula-rasa.pw", apiPath: @"/api/v1/api"));
yield return GetDefinition("Usenet Crawler", GetSettings("https://www.usenet-crawler.com"));
yield return GetDefinition("AnimeTosho Usenet", GetSettings("https://feed.animetosho.org", apiPath: @"/nabapi", categories: new int[0], animeCategories: new[] { 5070 }));
}
}

@ -36,6 +36,7 @@ namespace Sonarr.Api.V3.Profiles.Release
{
context.AddFailure(nameof(ReleaseProfile.IndexerId), "Indexer does not exist");
}
context.AddFailure(nameof(ReleaseProfile.Preferred), "Indexer does not exist");
});
}

Loading…
Cancel
Save