Browse Source

Merge pull request #1304 from kvch/fix-piratebay-url

Fix piratebay URL
Adam Tauber 6 years ago
parent
commit
cd819ae74b
No account linked to committer's email
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      searx/engines/piratebay.py
  2. 3
    3
      tests/unit/engines/test_piratebay.py

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

18
 paging = True
18
 paging = True
19
 
19
 
20
 # search-url
20
 # search-url
21
-url = 'https://thepiratebay.se/'
21
+url = 'https://thepiratebay.org/'
22
 search_url = url + 'search/{search_term}/{pageno}/99/{search_type}'
22
 search_url = url + 'search/{search_term}/{pageno}/99/{search_type}'
23
 
23
 
24
 # piratebay specific type-definitions
24
 # piratebay specific type-definitions

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

15
         params = piratebay.request(query, dicto)
15
         params = piratebay.request(query, dicto)
16
         self.assertIn('url', params)
16
         self.assertIn('url', params)
17
         self.assertIn(query, params['url'])
17
         self.assertIn(query, params['url'])
18
-        self.assertIn('piratebay.se', params['url'])
18
+        self.assertIn('piratebay.org', params['url'])
19
         self.assertIn('0', params['url'])
19
         self.assertIn('0', params['url'])
20
 
20
 
21
         dicto['category'] = 'music'
21
         dicto['category'] = 'music'
99
         self.assertEqual(type(results), list)
99
         self.assertEqual(type(results), list)
100
         self.assertEqual(len(results), 2)
100
         self.assertEqual(len(results), 2)
101
         self.assertEqual(results[0]['title'], 'This is the title')
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.org/this.is.the.link')
103
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
103
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
104
         self.assertEqual(results[0]['seed'], 13)
104
         self.assertEqual(results[0]['seed'], 13)
105
         self.assertEqual(results[0]['leech'], 334)
105
         self.assertEqual(results[0]['leech'], 334)
149
         self.assertEqual(type(results), list)
149
         self.assertEqual(type(results), list)
150
         self.assertEqual(len(results), 1)
150
         self.assertEqual(len(results), 1)
151
         self.assertEqual(results[0]['title'], 'This is the title')
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.org/this.is.the.link')
153
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
153
         self.assertEqual(results[0]['content'], 'This is the content and should be OK')
154
         self.assertEqual(results[0]['seed'], 0)
154
         self.assertEqual(results[0]['seed'], 0)
155
         self.assertEqual(results[0]['leech'], 0)
155
         self.assertEqual(results[0]['leech'], 0)