From a947cd2743bcde396fc41939bb2e1caf8288007a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 14 Apr 2012 16:50:08 -0700 Subject: [PATCH] New: Added NzbClub.com as an indexer, enabled by default --- .../Files/RSS/SizeParsing/nzbclub.xml | 21 ++ NzbDrone.Core.Test/Files/RSS/nzbclub.xml | 236 ++++++++++++++++++ NzbDrone.Core.Test/IndexerTests.cs | 36 ++- NzbDrone.Core.Test/NzbDrone.Core.Test.csproj | 6 + NzbDrone.Core/NzbDrone.Core.csproj | 1 + NzbDrone.Core/Providers/Indexer/NzbClub.cs | 123 +++++++++ 6 files changed, 420 insertions(+), 3 deletions(-) create mode 100644 NzbDrone.Core.Test/Files/RSS/SizeParsing/nzbclub.xml create mode 100644 NzbDrone.Core.Test/Files/RSS/nzbclub.xml create mode 100644 NzbDrone.Core/Providers/Indexer/NzbClub.cs diff --git a/NzbDrone.Core.Test/Files/RSS/SizeParsing/nzbclub.xml b/NzbDrone.Core.Test/Files/RSS/SizeParsing/nzbclub.xml new file mode 100644 index 000000000..90e4a993f --- /dev/null +++ b/NzbDrone.Core.Test/Files/RSS/SizeParsing/nzbclub.xml @@ -0,0 +1,21 @@ + + + + Latest Search Result for "#a.b.teevee@EFNet" + Feed Generator + + + Size: 2.47 GB in 67 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.teevee <br />Files Information: [45 Archive Files 2,961 p] | [17 Par2 Files 357 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20729391 + http://www.nzbclub.com/nzb_view/20729391/93926_FULL_a_b_teevee_EFNet_Britains_Got_Talent_S06E04_720p_HDTV_x264_FTP + Sat, 14 Apr 2012 04:33:21 Z + [93926]-[FULL]-[#a.b.teevee@EFNet]-[ Britains.Got.Talent.S06E04.720p.HDTV.x264-FTP ]- - "britains.got.talent.s06e04.720p.hdtv.x264-ftp.sample" + + http://www.nzbclub.com/nzbfeed.aspx + NZBClub RSS + Sat, 14 Apr 2012 18:39:49 -0500 + en + + \ No newline at end of file diff --git a/NzbDrone.Core.Test/Files/RSS/nzbclub.xml b/NzbDrone.Core.Test/Files/RSS/nzbclub.xml new file mode 100644 index 000000000..4a8caae54 --- /dev/null +++ b/NzbDrone.Core.Test/Files/RSS/nzbclub.xml @@ -0,0 +1,236 @@ + + + + Latest Search Result for "#a.b.teevee@EFNet" + Feed Generator + + Size: 2.47 GB in 67 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.teevee <br />Files Information: [45 Archive Files 2,961 p] | [17 Par2 Files 357 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20729391 + http://www.nzbclub.com/nzb_view/20729391/93926_FULL_a_b_teevee_EFNet_Britains_Got_Talent_S06E04_720p_HDTV_x264_FTP + Sat, 14 Apr 2012 04:33:21 Z + [93926]-[FULL]-[#a.b.teevee@EFNet]-[ Britains.Got.Talent.S06E04.720p.HDTV.x264-FTP ]- - "britains.got.talent.s06e04.720p.hdtv.x264-ftp.sample" + + + Size: 798 MB in 60 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [49 Archive Files 979 p] | [8 Par2 Files 106 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20729211 + http://www.nzbclub.com/nzb_view/20729211/93925_FULL_a_b_teevee_EFNet_Neighbours_S28E066_E070_WS_PDTV_XviD_FQM_neighbours_s27e066_e070_pdtv_xvid_fqm + Sat, 14 Apr 2012 04:20:28 Z + [93925]-[FULL]-[#a.b.teevee@EFNet]-[ Neighbours.S28E066-E070.WS.PDTV.XviD-FQM ]- - "neighbours.s27e066-e070.pdtv.xvid-fqm" + + + Size: 379 MB in 35 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [24 Archive Files 465 p] | [8 Par2 Files 55 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20729172 + http://www.nzbclub.com/nzb_view/20729172/93924_FULL_a_b_teevee_EFNet_Gardening_Australia_2012_04_14_PDTV_x264_RTA + Sat, 14 Apr 2012 04:10:59 Z + [93924]-[FULL]-[#a.b.teevee@EFNet]-[ Gardening.Australia.2012.04.14.PDTV.x264-RTA ]- - "gardening.australia.2012.04.14.pdtv.x264-rta" + + + Size: 560 MB in 37 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [26 Archive Files 692 p] | [8 Par2 Files 80 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20727673 + http://www.nzbclub.com/nzb_view/20727673/93923_FULL_a_b_teevee_EFNet_Britains_Got_More_Talent_S06E04_PDTV_x264_C4TV + Sat, 14 Apr 2012 02:32:16 Z + [93923]-[FULL]-[#a.b.teevee@EFNet]-[ Britains.Got.More.Talent.S06E04.PDTV.x264-C4TV ]- - "britains.got.more.talent.s06e04.pdtv.x264-c4tv" + + + Size: 10.58 GB in 332 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [192 Archive Files 12,353 p] | [112 Par2 Files 1,640 p] | [4 NZB Files] | [4 NFO Files] + + + http://www.nzbclub.com/nzb_view20727532 + http://www.nzbclub.com/nzb_view/20727532/93922_FULL_a_b_teevee_EFNet_Titanic_2012_S01E01_720p_BluRay_x264_GaGE_titanic_s01e01_720p_gage + Sat, 14 Apr 2012 02:22:54 Z + [93922]-[FULL]-[#a.b.teevee@EFNet]-[ Titanic.2012.S01E01.720p.BluRay.x264-GaGE ]- - "titanic.s01e01.720p.gage.sample" + + + Size: 435 MB in 38 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [27 Archive Files 534 p] | [8 Par2 Files 62 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20727339 + http://www.nzbclub.com/nzb_view/20727339/93921_FULL_a_b_teevee_EFNet_Casualty_S26E31_HDTV_x264_ANGELiC + Sat, 14 Apr 2012 02:05:35 Z + [93921]-[FULL]-[#a.b.teevee@EFNet]-[ Casualty.S26E31.HDTV.x264-ANGELiC ]- - "casualty.s26e31.hdtv.x264-angelic" + + + Size: 1.09 GB in 41 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [20 Archive Files 1,296 p] | [16 Par2 Files 166 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20727340 + http://www.nzbclub.com/nzb_view/20727340/93920_FULL_a_b_teevee_EFNet_Casualty_S26E31_720p_HDTV_x264_ANGELiC + Sat, 14 Apr 2012 02:05:13 Z + [93920]-[FULL]-[#a.b.teevee@EFNet]-[ Casualty.S26E31.720p.HDTV.x264-ANGELiC ]- - "casualty.s26e31.720p.hdtv.x264-angelic" + + + Size: 780 MB in 47 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [36 Archive Files 964 p] | [8 Par2 Files 108 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20727103 + http://www.nzbclub.com/nzb_view/20727103/93919_FULL_a_b_teevee_EFNet_Britains_Got_Talent_S06E04_HDTV_x264_C4TV + Sat, 14 Apr 2012 01:48:40 Z + [93919]-[FULL]-[#a.b.teevee@EFNet]-[ Britains.Got.Talent.S06E04.HDTV.x264-C4TV ]- - "britains.got.talent.s06e04.hdtv.x264-c4tv" + + + Size: 679 MB in 43 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [32 Archive Files 839 p] | [8 Par2 Files 96 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20726379 + http://www.nzbclub.com/nzb_view/20726379/93918_FULL_a_b_teevee_EFNet_The_Voice_UK_S01E04_HDTV_x264_C4TV + Sat, 14 Apr 2012 00:56:54 Z + [93918]-[FULL]-[#a.b.teevee@EFNet]-[ The.Voice.UK.S01E04.HDTV.x264-C4TV ]- - "the.voice.uk.s01e04.hdtv.x264-c4tv" + + + Size: 1.90 GB in 56 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [36 Archive Files 2,337 p] | [15 Par2 Files 261 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20726260 + http://www.nzbclub.com/nzb_view/20726260/93917_FULL_a_b_teevee_EFNet_The_Voice_UK_S01E04_720p_HDTV_x264_C4TV + Sat, 14 Apr 2012 00:46:42 Z + [93917]-[FULL]-[#a.b.teevee@EFNet]-[ The.Voice.UK.S01E04.720p.HDTV.x264-C4TV ]- - "the.voice.uk.s01e04.720p.hdtv.x264-c4tv" + + + Size: 299 MB in 30 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [19 Archive Files 368 p] | [8 Par2 Files 45 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20725616 + http://www.nzbclub.com/nzb_view/20725616/93916_FULL_a_b_teevee_EFNet_UFC_Tonight_2012_04_10_DSR_x264_KYR + Sat, 14 Apr 2012 23:37:47 Z + [93916]-[FULL]-[#a.b.teevee@EFNet]-[ UFC.Tonight.2012.04.10.DSR.x264-KYR ]- - "ufc.tonight.2012.04.10.dsr.x264-kyr" + + + Size: 338 MB in 38 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [20 Archive Files 386 p] | [14 Par2 Files 63 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20725580 + http://www.nzbclub.com/nzb_view/20725580/93915_FULL_a_b_teevee_EFNet_UFC_Tonight_2012_04_03_DSR_x264_KYR + Sat, 14 Apr 2012 23:35:52 Z + [93915]-[FULL]-[#a.b.teevee@EFNet]-[ UFC.Tonight.2012.04.03.DSR.x264-KYR ]- - "UFC.Tonight.2012.04.03.DSR.x264-KYR" + + + Size: 1.00 GB in 38 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [18 Archive Files 1,184 p] | [15 Par2 Files 157 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20725418 + http://www.nzbclub.com/nzb_view/20725418/93914_FULL_a_b_teevee_EFNet_Keith_Lemons_Lemon_Aid_S01E02_720p_HDTV_x264_C4TV + Sat, 14 Apr 2012 23:22:45 Z + [93914]-[FULL]-[#a.b.teevee@EFNet]-[ Keith.Lemons.Lemon.Aid.S01E02.720p.HDTV.x264-C4TV ]- - "keith.lemons.lemon.aid.s01e02.720p.hdtv.x264-c4tv" + + + Size: 338 MB in 27 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [16 Archive Files 419 p] | [8 Par2 Files 50 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20725198 + http://www.nzbclub.com/nzb_view/20725198/93913_FULL_a_b_teevee_EFNet_Keith_Lemons_Lemon_Aid_S01E02_HDTV_x264_C4TV + Sat, 14 Apr 2012 23:12:41 Z + [93913]-[FULL]-[#a.b.teevee@EFNet]-[ Keith.Lemons.Lemon.Aid.S01E02.HDTV.x264-C4TV ]- - "keith.lemons.lemon.aid.s01e02.hdtv.x264-c4tv" + + + Size: 3.73 GB in 83 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [71 Archive Files 4,646 p] | [9 Par2 Files 489 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20724900 + http://www.nzbclub.com/nzb_view/20724900/93912_FULL_a_b_teevee_EFNet_FA_Cup_2012_04_14_Semi_Final_Liverpool_Vs_Everton_720p_HDTV_x264_FAIRPLAY_fairplay_fa_cup_2012_04_14_semi_final_liverpool_vs_everton_720p + Sat, 14 Apr 2012 23:05:36 Z + [93912]-[FULL]-[#a.b.teevee@EFNet]-[ FA.Cup.2012.04.14.Semi.Final.Liverpool.Vs.Everton.720p.HDTV.x264-FAIRPLAY ]- - "fairplay-fa.cup.2012.04.14.semi.final.liverpool.vs.everton.720p" + + + Size: 1.22 GB in 42 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [23 Archive Files 1,484 p] | [14 Par2 Files 176 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20724328 + http://www.nzbclub.com/nzb_view/20724328/93911_FULL_a_b_teevee_EFNet_The_Grand_National_2012_720p_HDTV_x264_FTP + Sat, 14 Apr 2012 22:43:39 Z + [93911]-[FULL]-[#a.b.teevee@EFNet]-[ The.Grand.National.2012.720p.HDTV.x264-FTP ]- - "grand.national.2012.720p.hdtv.x264-ftp.sample" + + + Size: 215 MB in 27 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [10 Archive Files 248 p] | [12 Par2 Files 44 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20722826 + http://www.nzbclub.com/nzb_view/20722826/93910_FULL_a_b_teevee_EFNet_Degrassi_S11E40_HDTV_XviD_2HD + Sat, 14 Apr 2012 20:26:05 Z + [93910]-[FULL]-[#a.b.teevee@EFNet]-[ Degrassi.S11E40.HDTV.XviD-2HD ]- - "sample-degrassi.s11e40.hdtv.xvid-2hd" + + + Size: 141 KB in 1 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.hdtv.x264 <br />Files Information: [1 NZB Files] + + + http://www.nzbclub.com/nzb_view20722589 + http://www.nzbclub.com/nzb_view/20722589/93840_FULL_a_b_teevee_EFNet_Not_Going_Out_S05E01_Band_720p_HDTV_x264_FoV + Sat, 14 Apr 2012 19:59:12 Z + [93840]-[FULL]-[#a.b.teevee@EFNet]-[ Not.Going.Out.S05E01.Band.720p.HDTV.x264-FoV ]- -"Not.Going.Out.S05E01.Band.720p.HDTV.x264-FoV" + + + Size: 2.93 GB in 75 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [56 Archive Files 3,607 p] | [16 Par2 Files 392 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20721983 + http://www.nzbclub.com/nzb_view/20721983/93909_FULL_a_b_teevee_EFNet_NHL_Stanley_Cup_2012G2_Flyers_vs_Penguins_PDTV_x264_PRiNCE + Sat, 14 Apr 2012 19:02:58 Z + [93909]-[FULL]-[#a.b.teevee@EFNet]-[ NHL.Stanley.Cup.2012G2.Flyers.vs.Penguins.PDTV.x264-PRiNCE ]- - "NHL.Stanley.Cup.2012G2.Flyers.vs.Penguins.PDTV.x264-PRiNCE" + + + Size: 196 MB in 23 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [13 Archive Files 242 p] | [7 Par2 Files 31 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20721376 + http://www.nzbclub.com/nzb_view/20721376/93908_FULL_a_b_teevee_EFNet_SPCA_Rescue_NZ_S01E10_HDTV_x264_FiHTV + Sat, 14 Apr 2012 18:06:51 Z + [93908]-[FULL]-[#a.b.teevee@EFNet]-[ SPCA.Rescue.NZ.S01E10.HDTV.x264-FiHTV ]- - "spca.rescue.nz.s01e10.hdtv.x264-fihtv" + + + Size: 1.03 GB in 40 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [19 Archive Files 1,218 p] | [16 Par2 Files 165 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20721311 + http://www.nzbclub.com/nzb_view/20721311/93907_FULL_a_b_teevee_EFNet_AutoGP_2012_Marrakech_Race1_720p_HDTV_x264_WHEELS_autogp_2012_marrakech1_720p_wheels + Sat, 14 Apr 2012 18:04:37 Z + [93907]-[FULL]-[#a.b.teevee@EFNet]-[ AutoGP.2012.Marrakech.Race1.720p.HDTV.x264-WHEELS ]- - "autogp.2012.marrakech1.720p-wheels" + + + Size: 198 MB in 23 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [13 Archive Files 244 p] | [7 Par2 Files 32 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20721033 + http://www.nzbclub.com/nzb_view/20721033/93906_FULL_a_b_teevee_EFNet_SPCA_Rescue_NZ_S01E09_HDTV_x264_FiHTV + Sat, 14 Apr 2012 17:33:01 Z + [93906]-[FULL]-[#a.b.teevee@EFNet]-[ SPCA.Rescue.NZ.S01E09.HDTV.x264-FiHTV ]- - "spca.rescue.nz.s01e09.hdtv.x264-fihtv" + + + Size: 2.28 GB in 64 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [43 Archive Files 2,796 p] | [16 Par2 Files 311 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20720319 + http://www.nzbclub.com/nzb_view/20720319/93905_FULL_a_b_teevee_EFNet_Titanic_The_Final_Word_with_James_Cameron_720p_HDTV_x264_DiVERGE + Sat, 14 Apr 2012 16:18:57 Z + [93905]-[FULL]-[#a.b.teevee@EFNet]-[ Titanic.The.Final.Word.with.James.Cameron.720p.HDTV.x264-DiVERGE ]- - "sample-titanic.the.final.word.with.james.cameron.720p.hdtv.x264-diverge" + + + Size: 713 MB in 50 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [33 Archive Files 870 p] | [13 Par2 Files 107 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20719972 + http://www.nzbclub.com/nzb_view/20719972/93904_FULL_a_b_teevee_EFNet_Titanic_The_Final_Word_with_James_Cameron_HDTV_x264_DiVERGE + Sat, 14 Apr 2012 15:47:12 Z + [93904]-[FULL]-[#a.b.teevee@EFNet]-[ Titanic.The.Final.Word.with.James.Cameron.HDTV.x264-DiVERGE ]- - "Titanic.The.Final.Word.with.James.Cameron.HDTV.x264-DiVERGE" + + + Size: 1.12 GB in 33 files.<br />Poster: teevee@4u.tv (teevee) <br />Newsgroup: alt.binaries.multimedia <br />Files Information: [22 Archive Files 1,398 p] | [8 Par2 Files 149 p] | [1 NZB Files] | [1 NFO Files] + + + http://www.nzbclub.com/nzb_view20719510 + http://www.nzbclub.com/nzb_view/20719510/93903_FULL_a_b_teevee_EFNet_Craig_Ferguson_2012_04_13_720p_HDTV_x264_ORENJI + Sat, 14 Apr 2012 15:31:57 Z + [93903]-[FULL]-[#a.b.teevee@EFNet]-[ Craig.Ferguson.2012.04.13.720p.HDTV.x264-ORENJI ]- - "craig.ferguson.2012.04.13.720p.hdtv.x264-orenji" + + http://www.nzbclub.com/nzbfeed.aspx + NZBClub RSS + Sat, 14 Apr 2012 18:39:49 -0500 + en + + \ No newline at end of file diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 064374811..1753b221d 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -34,6 +34,7 @@ namespace NzbDrone.Core.Test [TestCase("wombles.xml")] [TestCase("filesharingtalk.xml")] [TestCase("nzbindex.xml")] + [TestCase("nzbclub.xml")] public void parse_feed_xml(string fileName) { Mocker.GetMock() @@ -258,8 +259,6 @@ namespace NzbDrone.Core.Test result.Should().NotBeEmpty(); } - - [Test] public void nzbmatrix_multi_word_search_returns_valid_results() { @@ -274,7 +273,6 @@ namespace NzbDrone.Core.Test result.Should().NotBeEmpty(); } - [TestCase("hawaii five-0 (2010)", "hawaii+five+0+2010")] [TestCase("this& that", "this+that")] [TestCase("this& that", "this+that")] @@ -400,6 +398,22 @@ namespace NzbDrone.Core.Test parseResults[0].Size.Should().Be(587328389); } + [Test] + public void size_nzbclub() + { + WithConfiguredIndexers(); + + Mocker.GetMock() + .Setup(h => h.DownloadStream(It.IsAny(), It.IsAny())) + .Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\nzbclub.xml")); + + //Act + var parseResults = Mocker.Resolve().FetchRss(); + + parseResults.Should().HaveCount(1); + parseResults[0].Size.Should().Be(2652142305); + } + [Test] public void Server_Unavailable_503_should_not_log_exception() { @@ -500,5 +514,21 @@ namespace NzbDrone.Core.Test parseResults.Should().HaveCount(1); parseResults[0].CleanTitle.Should().Be("britainsgotmoretalent"); } + + [Test] + public void title_preparse_nzbclub() + { + WithConfiguredIndexers(); + + Mocker.GetMock() + .Setup(h => h.DownloadStream(It.IsAny(), It.IsAny())) + .Returns(File.OpenRead(".\\Files\\Rss\\SizeParsing\\nzbclub.xml")); + + //Act + var parseResults = Mocker.Resolve().FetchRss(); + + parseResults.Should().HaveCount(1); + parseResults[0].CleanTitle.Should().Be("britainsgottalent"); + } } } diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 8acfd7690..c45e33c21 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -218,9 +218,15 @@ Always + + Always + Always + + Always + Always diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 06c138992..3932bdaf1 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -273,6 +273,7 @@ + diff --git a/NzbDrone.Core/Providers/Indexer/NzbClub.cs b/NzbDrone.Core/Providers/Indexer/NzbClub.cs new file mode 100644 index 000000000..a06aefa05 --- /dev/null +++ b/NzbDrone.Core/Providers/Indexer/NzbClub.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.ServiceModel.Syndication; +using System.Text.RegularExpressions; +using Ninject; +using NzbDrone.Common; +using NzbDrone.Core.Model; +using NzbDrone.Core.Providers.Core; + +namespace NzbDrone.Core.Providers.Indexer +{ + public class NzbClub : IndexerBase + { + [Inject] + public NzbClub(HttpProvider httpProvider, ConfigProvider configProvider) + : base(httpProvider, configProvider) + { + } + + protected override string[] Urls + { + get + { + return new[] + { + string.Format("http://www.nzbclub.com/nzbfeed.aspx?ig=2&gid=102952&st=1&ns=1&q=%23a.b.teevee%40EFNet") + }; + } + } + + public override bool IsConfigured + { + get + { + return true; + } + } + + public override string Name + { + get { return "NzbClub"; } + } + + protected override string NzbDownloadUrl(SyndicationItem item) + { + return item.Links[1].Uri.ToString(); + } + + protected override IList GetEpisodeSearchUrls(string seriesTitle, int seasonNumber, int episodeNumber) + { + var searchUrls = new List(); + + foreach (var url in Urls) + { + searchUrls.Add(String.Format("{0}+{1}+s{2:00}e{3:00}", url, seriesTitle, seasonNumber, episodeNumber)); + } + + return searchUrls; + } + + protected override IList GetSeasonSearchUrls(string seriesTitle, int seasonNumber) + { + var searchUrls = new List(); + + foreach (var url in Urls) + { + searchUrls.Add(String.Format("{0}+{1}+s{2:00}", url, seriesTitle, seasonNumber)); + } + + return searchUrls; + } + + protected override IList GetDailyEpisodeSearchUrls(string seriesTitle, DateTime date) + { + var searchUrls = new List(); + + foreach (var url in Urls) + { + searchUrls.Add(String.Format("{0}+{1}+{2:yyyy MM dd}", url, seriesTitle, date)); + } + + return searchUrls; + } + + protected override IList GetPartialSeasonSearchUrls(string seriesTitle, int seasonNumber, int episodeWildcard) + { + var searchUrls = new List(); + + foreach (var url in Urls) + { + searchUrls.Add(String.Format("{0}+{1}+S{2:00}E{3}", url, seriesTitle, seasonNumber, episodeWildcard)); + } + + return searchUrls; + } + + protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult) + { + if (currentResult != null) + { + var sizeString = Regex.Match(item.Summary.Text, @"Size:\s\d+\.\d{1,2}\s\w{2}\s", RegexOptions.IgnoreCase | RegexOptions.Compiled).Value; + currentResult.Size = Parser.GetReportSize(sizeString); + } + + return currentResult; + } + + public override bool EnabledByDefault + { + get { return true; } + } + + protected override string TitlePreParser(SyndicationItem item) + { + var title = Parser.ParseHeader(item.Title.Text); + + if (String.IsNullOrWhiteSpace(title)) + return item.Title.Text; + + return title; + } + } +} \ No newline at end of file