From bb9a0371c56ecbb90e060844346f162c9cd2daae Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 21 Feb 2016 15:10:45 +0100 Subject: [PATCH] Added TorrentRss test for ExtraTorrents, no other changes. --- .../Indexers/TorrentRss/ExtraTorrents.xml | 204 ++++++++++++++++++ .../TorrentRssIndexerFixture.cs | 26 +++ .../TorrentRssSettingsDetectorFixture.cs | 20 ++ .../NzbDrone.Core.Test.csproj | 3 + 4 files changed, 253 insertions(+) create mode 100644 src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ExtraTorrents.xml diff --git a/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ExtraTorrents.xml b/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ExtraTorrents.xml new file mode 100644 index 000000000..ac03c626c --- /dev/null +++ b/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ExtraTorrents.xml @@ -0,0 +1,204 @@ + + + + <![CDATA[RSS ac.me, Category: TV. Torrents type: Most Downloaded. The World's Largest BitTorrent System]]> + http://ac.me/ + RSS ac.me The World's Largest BitTorrent System. Any torrents for download. Download music, movies, games, software, iPod, anime, porn, adult, books, pictures and other torrents. + en-us + All + extratorr@gmail.com + + ac.me + http://ac.me/images/logo.gif + http://ac.me + + + <![CDATA[One.Piece.E334.D ED.720p.HDTV.x264-W4F-={SPARROW}=-]]> + Sun, 21 Feb 2016 09:51:54 +0000 + TV + http://ac.me/torrent/4722030/One.Piece.E334.D+ED.720p.HDTV.x264-W4F-%3D%7BSPARROW%7D%3D-.html + + http://ac.me/torrent/4722030/One.Piece.E334.D+ED.720p.HDTV.x264-W4F-%3D%7BSPARROW%7D%3D-.html + + +

+One.Piece.E334.DUBBED.720p.HDTV.x264-W4F-={SPARROW}=-

+

+Info.png

+

+

+one.piece.e334.720p.hdtv.x264-w4f-={SPARROW}=-.mkv

+

+File type: mkv

+Duration: 00:21:14

+Video size: 1280x720

+Frame rate: 23.98

+Bitrate: 3529 kb/s

+Video codec: h264

+Audio codec: ac3,

+Audio type: 5.1(side)


+

+Screens.png

+

+Click Image To View Full Size

+

+ + + 562386947 + --- + --- + c1b7641c4fd5fd4c248a7aee7c2ad0a4267a371c + + + <![CDATA[One Piece E334 D ED 720p HDTV x264-W4F]]> + Sun, 21 Feb 2016 09:44:21 +0000 + TV + http://ac.me/torrent/4722015/One+Piece+E334+D+ED+720p+HDTV+x264-W4F.html + + http://ac.me/torrent/4722015/One+Piece+E334+D+ED+720p+HDTV+x264-W4F.html + +

+

+

+

+

+one.piece.e334.720p.hdtv.x264-w4f.mkv

+

+SIZE: 562386319 bytes (536.33 MiB),

+

+DURATION: 00:21:14,

+

+AVG-BITRATE: 3531 kb/s

+

+AUDIO: ac3, 48000 Hz, 5:1 (eng)

+

+VIDEO: h264, yuv420p, 1280x720, 23.98 fps(r)

+Subtitles: eng

+

+

+

+

+

+SCREENS:

+
56c986f4020ae.jpg

+

+Large Runtime Screen

+

+Large Runtime Screen ]]> + + 562392556 + --- + --- + 1a69f565b531594e4f75b0fd4db153dce3e5186e + + + <![CDATA[Shadowhunters.S01E06.Of.Men.and.Angels.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-]]> + Sun, 21 Feb 2016 09:33:00 +0000 + TV + http://ac.me/torrent/4721983/Shadowhunters.S01E06.Of.Men.and.Angels.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + http://ac.me/torrent/4721983/Shadowhunters.S01E06.Of.Men.and.Angels.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + +

+Shadowhunters.S01E06.Of.Men.and.Angels.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-

+

+Info.png

+

+

+Shadowhunters.S01E06.Of.Men.and.Angels.720p.HDTV.DD5.1.MPEG2-JiTB.ts

+

+File type: ts

+Duration: 00:41:17

+Video size: 1280x720

+Frame rate: 59.94

+Bitrate: 9126 kb/s

+Video codec: mpeg2video

+Audio codec: ac3

+Audio type: 5.1(side)


+

+Screens.png

+

+Click Image To View Full Size

+

+ + + 2826689668 + --- + --- + e7b26a23c8cc7e8b2d7da35baaa5933a51586c90 + + + <![CDATA[Shadowhunters.S01E05.Moo.Shu.to.Go.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-]]> + Sun, 21 Feb 2016 09:32:51 +0000 + TV + http://ac.me/torrent/4721982/Shadowhunters.S01E05.Moo.Shu.to.Go.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + http://ac.me/torrent/4721982/Shadowhunters.S01E05.Moo.Shu.to.Go.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + +

+Shadowhunters.S01E05.Moo.Shu.to.Go.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-

+

+Info.png

+

+

+Shadowhunters.S01E05.Moo.Shu.to.Go.720p.HDTV.DD5.1.MPEG2-JiTB.ts

+

+File type: ts

+Duration: 00:41:18

+Video size: 1280x720

+Frame rate: 59.94

+Bitrate: 9112 kb/s

+Video codec: mpeg2video

+Audio codec: ac3

+Audio type: 5.1(side)


+

+Screens.png

+

+Click Image To View Full Size

+

+ + + 2823160720 + --- + --- + 77faae6a126854fceb0a9a6fbdc229f68d3e3d03 + + + <![CDATA[Second.Chance.2016.S01E05.Scratch.That.Glitch.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-]]> + Sun, 21 Feb 2016 09:32:47 +0000 + TV + http://ac.me/torrent/4721981/Second.Chance.2016.S01E05.Scratch.That.Glitch.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + http://ac.me/torrent/4721981/Second.Chance.2016.S01E05.Scratch.That.Glitch.720p.HDTV.DD5.1.MPEG2-JiTB-%3D%7BSPARROW%7D%3D-.html + + +

+Second.Chance.2016.S01E05.Scratch.That.Glitch.720p.HDTV.DD5.1.MPEG2-JiTB-={SPARROW}=-

+

+Info.png

+

+

+Second.Chance.2016.S01E05.Scratch.That.Glitch.720p.HDTV.DD5.1.MPEG2-JiTB.ts

+

+File type: ts

+Duration: 00:42:01

+Video size: 1280x720

+Frame rate: 59.94

+Bitrate: 15055 kb/s

+Video codec: mpeg2video

+Audio codec: ac3 ac3

+Audio type: 5.1(side) stereo


+

+Screens.png

+

+Click Image To View Full... ]]> + + 4745525204 + --- + --- + 0c341bbdadbc3c985304eb13893cc0731121e333 + + + \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs index 0ca248dfd..37e8790fa 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs @@ -151,5 +151,31 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests torrentInfo.Peers.Should().NotHaveValue(); torrentInfo.Seeders.Should().NotHaveValue(); } + + [Test] + public void should_parse_recent_feed_from_ExtraTorrents() + { + GivenRecentFeedResponse("TorrentRss/ExtraTorrents.xml"); + + var releases = Subject.FetchRecent(); + + releases.Should().HaveCount(5); + releases.First().Should().BeOfType(); + + var torrentInfo = releases.First() as TorrentInfo; + + torrentInfo.Title.Should().Be("One.Piece.E334.D ED.720p.HDTV.x264-W4F-={SPARROW}=-"); + torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent); + torrentInfo.DownloadUrl.Should().Be("http://ac.me/download/4722030/One.Piece.E334.D+ED.720p.HDTV.x264-W4F-%3D%7BSPARROW%7D%3D-.torrent"); + torrentInfo.InfoUrl.Should().BeNullOrEmpty(); + torrentInfo.CommentUrl.Should().BeNullOrEmpty(); + torrentInfo.Indexer.Should().Be(Subject.Definition.Name); + torrentInfo.PublishDate.Should().Be(DateTime.Parse("Sun, 21 Feb 2016 09:51:54 +0000").ToUniversalTime()); + torrentInfo.Size.Should().Be(562386947); + torrentInfo.InfoHash.Should().BeNull(); + torrentInfo.MagnetUrl.Should().BeNull(); + torrentInfo.Peers.Should().NotHaveValue(); + torrentInfo.Seeders.Should().NotHaveValue(); + } } } diff --git a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssSettingsDetectorFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssSettingsDetectorFixture.cs index 9f53160ba..349f257bb 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssSettingsDetectorFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssSettingsDetectorFixture.cs @@ -163,6 +163,26 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests }); } + [Test] + public void should_detect_rss_settings_for_ExtraTorrents() + { + _indexerSettings.AllowZeroSize = true; + + GivenRecentFeedResponse("TorrentRss/ExtraTorrents.xml"); + + var settings = Subject.Detect(_indexerSettings); + + settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings + { + UseEZTVFormat = false, + UseEnclosureUrl = true, + UseEnclosureLength = true, + ParseSizeInDescription = false, + ParseSeedersInDescription = false, + SizeElementName = null + }); + } + [Test] [Ignore("Cannot reliably reject unparseable titles")] public void should_reject_rss_settings_for_AwesomeHD() diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 661a822a6..005fb71f7 100644 --- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -417,6 +417,9 @@ Always + + Always + Always