From 16915116e0a1cc406a6ff39e0a01ab3497b188f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Mon, 21 May 2018 16:58:39 +0200 Subject: [PATCH 1/2] fix piratebay url Closes #1229 --- searx/engines/piratebay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.py index a5af8d824..2f3f22a97 100644 --- a/searx/engines/piratebay.py +++ b/searx/engines/piratebay.py @@ -18,7 +18,7 @@ categories = ['videos', 'music', 'files'] paging = True # search-url -url = 'https://thepiratebay.se/' +url = 'https://thepiratebay.org/' search_url = url + 'search/{search_term}/{pageno}/99/{search_type}' # piratebay specific type-definitions From 7fd7bd75ff6bac2943d31db8a6816a0f8e6f85e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Mon, 21 May 2018 18:15:49 +0200 Subject: [PATCH 2/2] follow up tests --- tests/unit/engines/test_piratebay.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/engines/test_piratebay.py b/tests/unit/engines/test_piratebay.py index 5699380be..89a78e796 100644 --- a/tests/unit/engines/test_piratebay.py +++ b/tests/unit/engines/test_piratebay.py @@ -15,7 +15,7 @@ class TestPiratebayEngine(SearxTestCase): params = piratebay.request(query, dicto) self.assertIn('url', params) self.assertIn(query, params['url']) - self.assertIn('piratebay.se', params['url']) + self.assertIn('piratebay.org', params['url']) self.assertIn('0', params['url']) dicto['category'] = 'music' @@ -99,7 +99,7 @@ class TestPiratebayEngine(SearxTestCase): self.assertEqual(type(results), list) self.assertEqual(len(results), 2) self.assertEqual(results[0]['title'], 'This is the title') - self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link') + self.assertEqual(results[0]['url'], 'https://thepiratebay.org/this.is.the.link') self.assertEqual(results[0]['content'], 'This is the content and should be OK') self.assertEqual(results[0]['seed'], 13) self.assertEqual(results[0]['leech'], 334) @@ -149,7 +149,7 @@ class TestPiratebayEngine(SearxTestCase): self.assertEqual(type(results), list) self.assertEqual(len(results), 1) self.assertEqual(results[0]['title'], 'This is the title') - self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link') + self.assertEqual(results[0]['url'], 'https://thepiratebay.org/this.is.the.link') self.assertEqual(results[0]['content'], 'This is the content and should be OK') self.assertEqual(results[0]['seed'], 0) self.assertEqual(results[0]['leech'], 0)