Browse Source

Merge pull request #333 from dalf/piratebay

[fix] Piratebay engine
Adam Tauber 9 years ago
parent
commit
8d36a8b837
3 changed files with 5 additions and 8 deletions
  1. 1
    5
      searx/engines/piratebay.py
  2. 1
    0
      searx/settings.yml
  3. 3
    3
      searx/tests/engines/test_piratebay.py

+ 1
- 5
searx/engines/piratebay.py View File

@@ -20,7 +20,7 @@ categories = ['videos', 'music', 'files']
20 20
 paging = True
21 21
 
22 22
 # search-url
23
-url = 'https://thepiratebay.se/'
23
+url = 'https://thepiratebay.am/'
24 24
 search_url = url + 'search/{search_term}/{pageno}/99/{search_type}'
25 25
 
26 26
 # piratebay specific type-definitions
@@ -42,10 +42,6 @@ def request(query, params):
42 42
                                       search_type=search_type,
43 43
                                       pageno=params['pageno'] - 1)
44 44
 
45
-    # FIX: SSLError: hostname 'kthepiratebay.se'
46
-    # doesn't match either of 'ssl2000.cloudflare.com', 'cloudflare.com', '*.cloudflare.com'
47
-    params['verify'] = False
48
-
49 45
     return params
50 46
 
51 47
 

+ 1
- 0
searx/settings.yml View File

@@ -167,6 +167,7 @@ engines:
167 167
   - name : piratebay
168 168
     engine : piratebay
169 169
     shortcut : tpb
170
+    disabled : True
170 171
 
171 172
   - name : qwant
172 173
     engine : qwant

+ 3
- 3
searx/tests/engines/test_piratebay.py View File

@@ -15,7 +15,7 @@ class TestPiratebayEngine(SearxTestCase):
15 15
         params = piratebay.request(query, dicto)
16 16
         self.assertIn('url', params)
17 17
         self.assertIn(query, params['url'])
18
-        self.assertIn('piratebay.se', params['url'])
18
+        self.assertIn('piratebay.am', params['url'])
19 19
         self.assertIn('0', params['url'])
20 20
 
21 21
         dicto['category'] = 'music'
@@ -99,7 +99,7 @@ class TestPiratebayEngine(SearxTestCase):
99 99
         self.assertEqual(type(results), list)
100 100
         self.assertEqual(len(results), 2)
101 101
         self.assertEqual(results[0]['title'], 'This is the title')
102
-        self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
102
+        self.assertEqual(results[0]['url'], 'https://thepiratebay.am/this.is.the.link')
103 103
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
104 104
         self.assertEqual(results[0]['seed'], 13)
105 105
         self.assertEqual(results[0]['leech'], 334)
@@ -149,7 +149,7 @@ class TestPiratebayEngine(SearxTestCase):
149 149
         self.assertEqual(type(results), list)
150 150
         self.assertEqual(len(results), 1)
151 151
         self.assertEqual(results[0]['title'], 'This is the title')
152
-        self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
152
+        self.assertEqual(results[0]['url'], 'https://thepiratebay.am/this.is.the.link')
153 153
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
154 154
         self.assertEqual(results[0]['seed'], 0)
155 155
         self.assertEqual(results[0]['leech'], 0)