소스 검색

bing_images & www1x engines use https connections

Dalf 9 년 전
부모
커밋
9e147d91f0
4개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1
    1
      searx/engines/bing_images.py
  2. 1
    1
      searx/engines/www1x.py
  3. 1
    1
      searx/tests/engines/test_bing_images.py
  4. 2
    2
      searx/tests/engines/test_www1x.py

+ 1
- 1
searx/engines/bing_images.py 파일 보기

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

+ 1
- 1
searx/engines/www1x.py 파일 보기

@@ -21,7 +21,7 @@ categories = ['images']
21 21
 paging = False
22 22
 
23 23
 # search-url, no HTTPS (there is a valid certificate for https://api2.1x.com/ )
24
-base_url = 'http://1x.com'
24
+base_url = 'https://1x.com'
25 25
 search_url = base_url+'/backend/search.php?{query}'
26 26
 
27 27
 

+ 1
- 1
searx/tests/engines/test_bing_images.py 파일 보기

@@ -59,7 +59,7 @@ oh:"238",tft:"0",oi:"http://www.image.url/Images/Test%2
59 59
         self.assertEqual(results[0]['title'], 'Test Query')
60 60
         self.assertEqual(results[0]['url'], 'http://www.page.url/')
61 61
         self.assertEqual(results[0]['content'], '')
62
-        self.assertEqual(results[0]['thumbnail_src'], 'http://ts1.mm.bing.net/th?id=HN.608003696942779811')
62
+        self.assertEqual(results[0]['thumbnail_src'], 'https://www.bing.com/th?id=HN.608003696942779811')
63 63
         self.assertEqual(results[0]['img_src'], 'http://test.url/Test%20Query.jpg')
64 64
 
65 65
         html = """

+ 2
- 2
searx/tests/engines/test_www1x.py 파일 보기

@@ -51,7 +51,7 @@ class TestWww1xEngine(SearxTestCase):
51 51
         results = www1x.response(response)
52 52
         self.assertEqual(type(results), list)
53 53
         self.assertEqual(len(results), 1)
54
-        self.assertEqual(results[0]['url'], 'http://1x.com/photo/123456')
55
-        self.assertEqual(results[0]['thumbnail_src'], 'http://1x.com/images/user/testimage-123456.jpg')
54
+        self.assertEqual(results[0]['url'], 'https://1x.com/photo/123456')
55
+        self.assertEqual(results[0]['thumbnail_src'], 'https://1x.com/images/user/testimage-123456.jpg')
56 56
         self.assertEqual(results[0]['content'], '')
57 57
         self.assertEqual(results[0]['template'], 'images.html')