예제 #1
0
 def testProcess_results_totalknown(self):
     w = Binsearch(config.indexerSettings.binsearch)
     with open("mock/binsearch--q-avengers3results.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, "aquery")
         self.assertFalse(result.has_more)
         self.assertEqual(3, result.total)
예제 #2
0
 def testProcess_results_totalknown(self):
     w = Binsearch(getIndexerSettingByName("binsearch"))
     with open("mock/binsearch--q-testtitle3results.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, SearchRequest())
         self.assertFalse(result.has_more)
         self.assertEqual(3, result.total)  
예제 #3
0
 def testProcess_results(self):
     w = Binsearch(config.settings.indexers.binsearch)
     with open("mock/binsearch--q-testtitle.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, "aquery")
         entries = result.entries
         self.assertEqual(
             'testtitle1.TrueFrench.1080p.X264.AC3.5.1-JKF.mkv',
             entries[0].title)
         self.assertEqual(
             "https://www.binsearch.info/fcgi/nzb.fcgi?q=176073735",
             entries[0].link)
         self.assertEqual(13110387671, entries[0].size)
         self.assertEqual("176073735", entries[0].indexerguid)
         self.assertEqual(1443312000, entries[0].epoch)
         self.assertEqual("2015-09-27T00:00:00+00:00",
                          entries[0].pubdate_utc)
         self.assertEqual("Sun, 27 Sep 2015 00:00:00 -0000",
                          entries[0].pubDate)
         self.assertEqual(3, entries[0].age_days)
         self.assertFalse(entries[0].age_precise)
         self.assertEqual("[email protected] (Clown_nez)", entries[0].poster)
         self.assertEqual("alt.binaries.movies.mkv", entries[0].group)
         self.assertUrlEqual(
             "https://binsearch.info/?b=testtitle1.3D.TOPBOT.TrueFrench.1080p.X264.A&g=alt.binaries.movies.mkv&p=Ramer%40marmer.com+%28Clown_nez%29&max=250",
             entries[0].details_link)
         self.assertTrue(result.has_more)
         self.assertFalse(result.total_known)
예제 #4
0
 def testProcess_results_totalknown(self):
     w = Binsearch(getIndexerSettingByName("binsearch"))
     with open("mock/binsearch--q-testtitle3results.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, SearchRequest())
         self.assertFalse(result.has_more)
         self.assertEqual(3, result.total)  
예제 #5
0
 def testProcess_results_totalknown(self):
     w = Binsearch(config.settings.indexers.binsearch)
     with open("mock/binsearch--q-testtitle3results.html",
               encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, "aquery")
         self.assertFalse(result.has_more)
         self.assertEqual(3, result.total)
예제 #6
0
    def testUrlGeneration(self):
        w = Binsearch(getIndexerSettingByName("binsearch"))
        self.args = SearchRequest(query="a showtitle", season=1, episode=2)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01e02', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle 1x02', furl(urls[1]).args["q"])

        self.args = SearchRequest(query="a showtitle", season=1, episode=None)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle "season 1"', furl(urls[1]).args["q"])
예제 #7
0
    def testUrlGeneration(self):
        w = Binsearch(config.settings.indexers.binsearch)
        self.args = SearchRequest(query="a showtitle", season=1, episode=2)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01e02', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle 1x02', furl(urls[1]).args["q"])

        self.args = SearchRequest(query="a showtitle", season=1, episode=None)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle "season 1"', furl(urls[1]).args["q"])
예제 #8
0
    def testEbookUrlGeneration(self):
        getIndexerSettingByName("binsearch").searchTypes = []
        w = Binsearch(getIndexerSettingByName("binsearch"))
        self.args = SearchRequest(query="anauthor atitle")
        urls = w.get_ebook_urls(self.args)
        self.assertEqual(4, len(urls))
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+ebook", urls[0])
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+mobi", urls[1])

        self.args = SearchRequest(author="anauthor", title="atitle")
        urls = w.get_ebook_urls(self.args)
        self.assertEqual(4, len(urls))
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+ebook", urls[0])
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+mobi", urls[1])
예제 #9
0
    def testEbookUrlGeneration(self):
        getIndexerSettingByName("binsearch").searchTypes = []
        w = Binsearch(getIndexerSettingByName("binsearch"))
        self.args = SearchRequest(query="anauthor atitle")
        urls = w.get_ebook_urls(self.args)
        self.assertEqual(4, len(urls))
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+ebook", urls[0])
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+mobi", urls[1])

        self.args = SearchRequest(author="anauthor", title="atitle")
        urls = w.get_ebook_urls(self.args)
        self.assertEqual(4, len(urls))
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+ebook", urls[0])
        self.assertEqual("https://binsearch.info/index.php?max=100&postdate=date&min=0&adv_sort=date&adv_col=on&q=anauthor+atitle+mobi", urls[1])
예제 #10
0
    def testUrlGeneration(self):
        w = Binsearch(getIndexerSettingByName("binsearch"))
        self.args = SearchRequest(query="a showtitle", season=1, episode=2)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01e02', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle 1x02', furl(urls[1]).args["q"])

        self.args = SearchRequest(query="a showtitle", season=1, episode=None)
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(2, len(urls))
        self.assertEqual('a showtitle s01', furl(urls[0]).args["q"])
        self.assertEqual('a showtitle "season 1"', furl(urls[1]).args["q"])

        self.args = SearchRequest(query="a showtitle", season=2016, episode="08/08")
        urls = w.get_showsearch_urls(self.args)
        self.assertEqual(1, len(urls))
        self.assertEqual('a showtitle "2016 08 08"', furl(urls[0]).args["q"])
예제 #11
0
 def testProcess_results(self):
     w = Binsearch(getIndexerSettingByName("binsearch"))
     with open("mock/binsearch--q-testtitle.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, SearchRequest())
         entries = list(result.entries)
         self.assertEqual('testtitle1.TrueFrench.1080p.X264.AC3.5.1-JKF.mkv', entries[0].title)
         self.assertEqual("https://binsearch.info?action=nzb&176073735=1", entries[0].link)
         self.assertEqual(13110387671, entries[0].size)
         self.assertEqual("176073735", entries[0].indexerguid)
         self.assertEqual(1443312000, entries[0].epoch)
         self.assertEqual("2015-09-27T00:00:00+00:00", entries[0].pubdate_utc)
         self.assertEqual("Sun, 27 Sep 2015 00:00:00 -0000", entries[0].pubDate)
         self.assertEqual(3, entries[0].age_days)
         self.assertFalse(entries[0].age_precise)
         self.assertEqual("[email protected] (Clown_nez)", entries[0].poster)
         self.assertEqual("alt.binaries.movies.mkv", entries[0].group)
         self.assertUrlEqual("https://binsearch.info/?b=testtitle1.3D.TOPBOT.TrueFrench.1080p.X264.A&g=alt.binaries.movies.mkv&p=Ramer%40marmer.com+%28Clown_nez%29&max=250", entries[0].details_link)
         self.assertTrue(result.has_more)
         self.assertFalse(result.total_known)
예제 #12
0
 def testProcess_results(self):
     w = Binsearch(config.indexerSettings.binsearch)
     with open("mock/binsearch--q-avengers.html", encoding="latin-1") as f:
         body = f.read()
         result = w.process_query_result(body, "aquery")
         entries = result.entries
         self.assertEqual('MARVELS.AVENGERS.AGE.OF.ULTRON. 3D.TOPBOT.TrueFrench.1080p.X264.AC3.5.1-JKF.mkv', entries[0].title)
         self.assertEqual("https://www.binsearch.info/fcgi/nzb.fcgi?q=176073735", entries[0].link)
         self.assertEqual(13110387671, entries[0].size)
         self.assertEqual("176073735", entries[0].guid)
         self.assertEqual(1437868800, entries[0].epoch)
         self.assertEqual("2015-07-26T00:00:00+00:00", entries[0].pubdate_utc)
         self.assertEqual(66, entries[0].age_days)
         self.assertFalse(entries[0].age_precise)
         self.assertEqual("[email protected] (Clown_nez)", entries[0].poster)
         self.assertEqual("alt.binaries.movies.mkv", entries[0].group)
         self.assertFalse(entries[0].has_nfo)
         self.assertEqual("https://binsearch.com/?b=MARVELS.AVENGERS.AGE.OF.ULTRON.3D.TOPBOT.TrueFrench.1080p.X264.A&g=alt.binaries.movies.mkv&p=Ramer%40marmer.com+%28Clown_nez%29&max=250", entries[0].details_link)
         
         self.assertTrue(entries[8].has_nfo)
         
         self.assertTrue(result.has_more)
         self.assertFalse(result.total_known)
예제 #13
0
 def testGetNzbLink(self):
     n = Binsearch(getIndexerSettingByName("binsearch"))
     link = n.get_nzb_link("guid", "title")
     assert "action=nzb" in link
     assert "guid=1" in link
예제 #14
0
 def testGetNzbLink(self):
     n = Binsearch(config.settings.indexers.binsearch)
     link = n.get_nzb_link("guid", "title")
     assert "action=nzb" in link
     assert "guid=1" in link
예제 #15
0
 def testGetNzbLink(self):
     n = Binsearch(config.indexerSettings.binsearch)
     link = n.get_nzb_link("guid", "title")
     assert "action=nzb" in link
     assert "guid=1" in link
예제 #16
0
 def testGetNzbLink(self):
     n = Binsearch(getIndexerSettingByName("binsearch"))
     link = n.get_nzb_link("guid", "title")
     assert "action=nzb" in link
     assert "guid=1" in link