summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2015-05-02 11:43:12 +0200
committerAlexandre Flament <alex@al-f.net>2015-05-02 11:43:12 +0200
commit78edc16e66fccbfb16c522f4453c88a85de61bf4 (patch)
treeef5844cfb06bf16681fcb34cdb0a322287cf7dc8 /searx/engines
parentbbd83f5a519381ac7ea690a1645258d106a9ba8a (diff)
downloadsearxng-78edc16e66fccbfb16c522f4453c88a85de61bf4.tar.gz
searxng-78edc16e66fccbfb16c522f4453c88a85de61bf4.zip
[enh] reduce the number of http outgoing connections.
engines that still use http : gigablast, bing image for thumbnails, 1x and dbpedia autocompleter
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/dailymotion.py3
-rw-r--r--searx/engines/deviantart.py8
-rw-r--r--searx/engines/digg.py3
-rw-r--r--searx/engines/gigablast.py2
-rw-r--r--searx/engines/google_images.py3
-rw-r--r--searx/engines/www1x.py4
6 files changed, 19 insertions, 4 deletions
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py
index 03b1dbb8b..187639706 100644
--- a/searx/engines/dailymotion.py
+++ b/searx/engines/dailymotion.py
@@ -60,6 +60,9 @@ def response(resp):
publishedDate = datetime.fromtimestamp(res['created_time'], None)
embedded = embedded_url.format(videoid=res['id'])
+ # http to https
+ thumbnail = thumbnail.replace("http://", "https://")
+
results.append({'template': 'videos.html',
'url': url,
'title': title,
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 4198e8c76..43cd8bbce 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -22,7 +22,7 @@ paging = True
# search-url
base_url = 'https://www.deviantart.com/'
-search_url = base_url+'search?offset={offset}&{query}'
+search_url = base_url+'browse/all/?offset={offset}&{query}'
# do search-request
@@ -56,6 +56,12 @@ def response(resp):
thumbnail_src = link.xpath('.//img')[0].attrib.get('src')
img_src = regex.sub('/', thumbnail_src)
+ # http to https, remove domain sharding
+ thumbnail_src = re.sub(r"https?://(th|fc)\d+.", "https://th01.", thumbnail_src)
+ thumbnail_src = re.sub(r"http://", "https://", thumbnail_src)
+
+ url = re.sub(r"http://(.*)\.deviantart\.com/", "https://\\1.deviantart.com/", url)
+
# append result
results.append({'url': url,
'title': title,
diff --git a/searx/engines/digg.py b/searx/engines/digg.py
index 1b5f2c8e4..5cb4ca8d9 100644
--- a/searx/engines/digg.py
+++ b/searx/engines/digg.py
@@ -58,6 +58,9 @@ def response(resp):
pubdate = result.xpath(pubdate_xpath)[0].attrib.get('datetime')
publishedDate = parser.parse(pubdate)
+ # http to https
+ thumbnail = thumbnail.replace("http://static.digg.com", "https://static.digg.com")
+
# append result
results.append({'url': url,
'title': title,
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py
index 8749c3256..69717db99 100644
--- a/searx/engines/gigablast.py
+++ b/searx/engines/gigablast.py
@@ -17,7 +17,7 @@ categories = ['general']
paging = True
number_of_results = 5
-# search-url
+# search-url, invalid HTTPS certificate
base_url = 'http://gigablast.com/'
search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0'
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index 1c0e62f5c..21ca8946b 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -56,6 +56,9 @@ def response(resp):
continue
thumbnail_src = result['tbUrl']
+ # http to https
+ thumbnail_src = thumbnail_src.replace("http://", "https://")
+
# append result
results.append({'url': href,
'title': title,
diff --git a/searx/engines/www1x.py b/searx/engines/www1x.py
index a68c105ce..df9254f2e 100644
--- a/searx/engines/www1x.py
+++ b/searx/engines/www1x.py
@@ -19,8 +19,8 @@ import re
categories = ['images']
paging = False
-# search-url
-base_url = 'http://1x.com'
+# search-url, no HTTPS
+base_url = 'https://1x.com'
search_url = base_url+'/backend/search.php?{query}'