summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
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.py3
-rw-r--r--searx/engines/google_images.py3
-rw-r--r--searx/engines/twitter.py4
-rw-r--r--searx/engines/www1x.py2
8 files changed, 22 insertions, 6 deletions
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py
index 4b029205a..4eb894725 100644
--- a/searx/engines/dailymotion.py
+++ b/searx/engines/dailymotion.py
@@ -62,6 +62,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 6606215e8..60c8d7ea7 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -24,7 +24,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
@@ -58,6 +58,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 8a635e6c3..000f66ba2 100644
--- a/searx/engines/digg.py
+++ b/searx/engines/digg.py
@@ -60,6 +60,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 242f93728..b852de9ba 100644
--- a/searx/engines/gigablast.py
+++ b/searx/engines/gigablast.py
@@ -19,7 +19,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.py b/searx/engines/google.py
index 9c768260a..807c58ed5 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -76,7 +76,8 @@ def request(query, params):
query=urlencode({'q': query}))
params['headers']['Accept-Language'] = language
- params['cookies']['PREF'] = get_google_pref_cookie()
+ if language.startswith('en'):
+ params['cookies']['PREF'] = get_google_pref_cookie()
return params
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index 135b3e0af..85963a16f 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -58,6 +58,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/twitter.py b/searx/engines/twitter.py
index 7407ecc95..a0ee18a47 100644
--- a/searx/engines/twitter.py
+++ b/searx/engines/twitter.py
@@ -29,8 +29,8 @@ search_url = base_url + 'search?'
# specific xpath variables
results_xpath = '//li[@data-item-type="tweet"]'
link_xpath = './/small[@class="time"]//a'
-title_xpath = './/span[@class="username js-action-profile-name"]'
-content_xpath = './/p[@class="js-tweet-text tweet-text"]'
+title_xpath = './/span[contains(@class, "username")]'
+content_xpath = './/p[contains(@class, "tweet-text")]'
timestamp_xpath = './/span[contains(@class,"_timestamp")]'
diff --git a/searx/engines/www1x.py b/searx/engines/www1x.py
index bfb55e331..12868ad22 100644
--- a/searx/engines/www1x.py
+++ b/searx/engines/www1x.py
@@ -20,7 +20,7 @@ import re
categories = ['images']
paging = False
-# search-url
+# search-url, no HTTPS (there is a valid certificate for https://api2.1x.com/ )
base_url = 'http://1x.com'
search_url = base_url+'/backend/search.php?{query}'