Repository: searx/searx

Issue:
Engines cannot retrieve results: piratebay (request exception): PirateBay changed URL
When some text is entered, and I click on General and Files several times, it shows this error:
```
Error! Engines cannot retrieve results.
piratebay (request exception)
Please, try again later or find another searx instance.
```

Version 0.14.0 on FreeBSD.
Default config.


Discussion:
Actually, you don't even need to switch several times, going directly on Files shows the error (on [searx.me](https://searx.me/).

Request done:
[https://searx.me/?q=test&categories=files&language=en-US](https://searx.me/?q=test&categories=files&language=en-US)

And I get the error.

If you take a look at [piratebay.py](https://github.com/asciimoo/searx/blob/master/searx/engines/piratebay.py), the request is done on [https://thepiratebay.se/](https://thepiratebay.se/) and this site is actually not available.

There is a [https://piratebay.to/](https://piratebay.to/), I don't know if it is a scam, the new domain name or a backup one.

Anyway, researching on this url doesn't work so replacing the url on searx neither.

So the title of the issue is not good, this is a piratebay (engine) issue.
in searx/settings.yml, piratebay entry, delete "url: https://pirateproxy.red/"
in searx/engines/piratebay.py replace 'https://thepiratebay.se/' by 'https://thepiratebay.org/'
And it works
 

Resolving patch:
diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.py
--- a/searx/engines/piratebay.py
+++ b/searx/engines/piratebay.py
@@ -18,7 +18,7 @@
 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


Test patch:
diff --git a/tests/unit/engines/test_piratebay.py b/tests/unit/engines/test_piratebay.py
--- a/tests/unit/engines/test_piratebay.py
+++ b/tests/unit/engines/test_piratebay.py
@@ -15,7 +15,7 @@ def test_request(self):
         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 @@ def test_response(self):
         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 @@ def test_response(self):
         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)