Explorar el Código

Merge pull request #301 from dalf/https

engines: use https when possible
Adam Tauber hace 10 años
padre
commit
ad8611c755

+ 1
- 1
searx/engines/bing_images.py Ver fichero

@@ -26,7 +26,7 @@ safesearch = True
26 26
 # search-url
27 27
 base_url = 'https://www.bing.com/'
28 28
 search_string = 'images/search?{query}&count=10&first={offset}'
29
-thumb_url = "http://ts1.mm.bing.net/th?id={ihk}"
29
+thumb_url = "http://ts1.mm.bing.net/th?id={ihk}"  # no https, bad certificate
30 30
 
31 31
 # safesearch definitions
32 32
 safesearch_types = {2: 'STRICT',

+ 2
- 2
searx/engines/currency_convert.py Ver fichero

@@ -2,7 +2,7 @@ from datetime import datetime
2 2
 import re
3 3
 
4 4
 categories = []
5
-url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
5
+url = 'https://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
6 6
 weight = 100
7 7
 
8 8
 parser_re = re.compile(r'^\W*(\d+(?:\.\d+)?)\W*([a-z]{3})\W*(?:in)?\W*([a-z]{3})\W*$', re.I)  # noqa
@@ -44,7 +44,7 @@ def response(resp):
44 44
     )
45 45
 
46 46
     now_date = datetime.now().strftime('%Y%m%d')
47
-    url = 'http://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html'  # noqa
47
+    url = 'https://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html'  # noqa
48 48
     url = url.format(
49 49
         now_date,
50 50
         resp.search_params['ammount'],

+ 1
- 1
searx/engines/mixcloud.py Ver fichero

@@ -17,7 +17,7 @@ categories = ['music']
17 17
 paging = True
18 18
 
19 19
 # search-url
20
-url = 'http://api.mixcloud.com/'
20
+url = 'https://api.mixcloud.com/'
21 21
 search_url = url + 'search/?{query}&type=cloudcast&limit=10&offset={offset}'
22 22
 
23 23
 embedded_url = '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' +\

+ 1
- 1
searx/engines/stackoverflow.py Ver fichero

@@ -19,7 +19,7 @@ categories = ['it']
19 19
 paging = True
20 20
 
21 21
 # search-url
22
-url = 'http://stackoverflow.com/'
22
+url = 'https://stackoverflow.com/'
23 23
 search_url = url+'search?{query}&page={pageno}'
24 24
 
25 25
 # specific xpath variables

+ 1
- 1
searx/engines/vimeo.py Ver fichero

@@ -23,7 +23,7 @@ categories = ['videos']
23 23
 paging = True
24 24
 
25 25
 # search-url
26
-base_url = 'http://vimeo.com'
26
+base_url = 'https://vimeo.com'
27 27
 search_url = base_url + '/search/page:{pageno}?{query}'
28 28
 
29 29
 # specific xpath variables

+ 1
- 1
searx/tests/engines/test_currency_convert.py Ver fichero

@@ -40,5 +40,5 @@ class TestCurrencyConvertEngine(SearxTestCase):
40 40
         self.assertEqual(len(results), 1)
41 41
         self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)')
42 42
         now_date = datetime.now().strftime('%Y%m%d')
43
-        self.assertEqual(results[0]['url'], 'http://finance.yahoo.com/currency/converter-results/' +
43
+        self.assertEqual(results[0]['url'], 'https://finance.yahoo.com/currency/converter-results/' +
44 44
                                             now_date + '/10-eur-to-usd.html')

+ 1
- 1
searx/tests/engines/test_stackoverflow.py Ver fichero

@@ -64,7 +64,7 @@ class TestStackoverflowEngine(SearxTestCase):
64 64
         self.assertEqual(type(results), list)
65 65
         self.assertEqual(len(results), 1)
66 66
         self.assertEqual(results[0]['title'], 'This is the title')
67
-        self.assertEqual(results[0]['url'], 'http://stackoverflow.com/questions/this.is.the.url')
67
+        self.assertEqual(results[0]['url'], 'https://stackoverflow.com/questions/this.is.the.url')
68 68
         self.assertEqual(results[0]['content'], 'This is the content')
69 69
 
70 70
         html = """

+ 1
- 1
searx/tests/engines/test_vimeo.py Ver fichero

@@ -52,7 +52,7 @@ class TestVimeoEngine(SearxTestCase):
52 52
         self.assertEqual(type(results), list)
53 53
         self.assertEqual(len(results), 1)
54 54
         self.assertEqual(results[0]['title'], 'This is the title')
55
-        self.assertEqual(results[0]['url'], 'http://vimeo.com/videoid')
55
+        self.assertEqual(results[0]['url'], 'https://vimeo.com/videoid')
56 56
         self.assertEqual(results[0]['content'], '')
57 57
         self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp')
58 58
         self.assertIn('/videoid', results[0]['embedded'])