summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
Diffstat (limited to 'searx')
-rw-r--r--searx/__init__.py9
-rw-r--r--searx/autocomplete.py24
-rw-r--r--searx/engines/__init__.py51
-rw-r--r--searx/engines/bing_images.py16
-rw-r--r--searx/engines/blekko_images.py2
-rw-r--r--searx/engines/btdigg.py2
-rw-r--r--searx/engines/deviantart.py2
-rw-r--r--searx/engines/digg.py2
-rw-r--r--searx/engines/faroo.py2
-rw-r--r--searx/engines/frinkiac.py44
-rw-r--r--searx/engines/gigablast.py57
-rw-r--r--searx/engines/google.py50
-rw-r--r--searx/engines/mediawiki.py21
-rw-r--r--searx/engines/searchcode_code.py4
-rw-r--r--searx/engines/searchcode_doc.py4
-rw-r--r--searx/engines/soundcloud.py32
-rw-r--r--searx/engines/stackoverflow.py2
-rw-r--r--searx/engines/startpage.py8
-rw-r--r--searx/engines/swisscows.py9
-rw-r--r--searx/engines/wikidata.py4
-rw-r--r--searx/engines/wolframalpha_api.py122
-rw-r--r--searx/engines/wolframalpha_noapi.py116
-rw-r--r--searx/engines/www1x.py2
-rw-r--r--searx/engines/xpath.py4
-rw-r--r--searx/engines/yandex.py7
-rw-r--r--searx/languages.py1
-rw-r--r--searx/plugins/__init__.py2
-rw-r--r--searx/plugins/https_rewrite.py4
-rw-r--r--searx/plugins/open_results_on_new_tab.py24
-rw-r--r--searx/plugins/search_on_category_select.py2
-rw-r--r--searx/poolrequests.py2
-rw-r--r--searx/results.py1
-rw-r--r--searx/search.py17
-rw-r--r--searx/settings.yml42
-rw-r--r--searx/settings_robot.yml3
-rw-r--r--searx/static/plugins/js/open_results_on_new_tab.js3
-rw-r--r--searx/static/plugins/js/search_on_category_select.js (renamed from searx/static/js/search_on_category_select.js)0
-rw-r--r--searx/static/themes/default/css/style.css2
-rw-r--r--searx/static/themes/default/less/style.less5
-rw-r--r--searx/static/themes/oscar/css/oscar.min.css2
-rw-r--r--searx/static/themes/oscar/less/oscar/infobox.less3
-rw-r--r--searx/templates/courgette/opensearch.xml4
-rw-r--r--searx/templates/default/infobox.html9
-rw-r--r--searx/templates/default/opensearch.xml4
-rw-r--r--searx/templates/oscar/base.html4
-rw-r--r--searx/templates/oscar/infobox.html6
-rw-r--r--searx/templates/oscar/navbar.html4
-rw-r--r--searx/templates/oscar/opensearch.xml4
-rw-r--r--searx/templates/oscar/preferences.html4
-rw-r--r--searx/testing.py26
-rw-r--r--searx/tests/__init__.py0
-rw-r--r--searx/tests/engines/__init__.py0
-rw-r--r--searx/tests/engines/test_bing.py90
-rw-r--r--searx/tests/engines/test_bing_images.py269
-rw-r--r--searx/tests/engines/test_bing_news.py138
-rw-r--r--searx/tests/engines/test_blekko_images.py71
-rw-r--r--searx/tests/engines/test_btdigg.py384
-rw-r--r--searx/tests/engines/test_currency_convert.py46
-rw-r--r--searx/tests/engines/test_dailymotion.py74
-rw-r--r--searx/tests/engines/test_deezer.py57
-rw-r--r--searx/tests/engines/test_deviantart.py118
-rw-r--r--searx/tests/engines/test_digg.py101
-rw-r--r--searx/tests/engines/test_duckduckgo.py91
-rw-r--r--searx/tests/engines/test_duckduckgo_definitions.py250
-rw-r--r--searx/tests/engines/test_dummy.py26
-rw-r--r--searx/tests/engines/test_faroo.py116
-rw-r--r--searx/tests/engines/test_flickr.py142
-rw-r--r--searx/tests/engines/test_flickr_noapi.py328
-rw-r--r--searx/tests/engines/test_gigablast.py57
-rw-r--r--searx/tests/engines/test_github.py61
-rw-r--r--searx/tests/engines/test_google.py178
-rw-r--r--searx/tests/engines/test_google_images.py58
-rw-r--r--searx/tests/engines/test_google_news.py136
-rw-r--r--searx/tests/engines/test_kickass.py397
-rw-r--r--searx/tests/engines/test_mediawiki.py130
-rw-r--r--searx/tests/engines/test_mixcloud.py67
-rw-r--r--searx/tests/engines/test_openstreetmap.py199
-rw-r--r--searx/tests/engines/test_photon.py166
-rw-r--r--searx/tests/engines/test_piratebay.py166
-rw-r--r--searx/tests/engines/test_qwant.py317
-rw-r--r--searx/tests/engines/test_searchcode_code.py75
-rw-r--r--searx/tests/engines/test_searchcode_doc.py73
-rw-r--r--searx/tests/engines/test_soundcloud.py192
-rw-r--r--searx/tests/engines/test_spotify.py124
-rw-r--r--searx/tests/engines/test_stackoverflow.py106
-rw-r--r--searx/tests/engines/test_startpage.py140
-rw-r--r--searx/tests/engines/test_subtitleseeker.py169
-rw-r--r--searx/tests/engines/test_swisscows.py128
-rw-r--r--searx/tests/engines/test_twitter.py502
-rw-r--r--searx/tests/engines/test_vimeo.py101
-rw-r--r--searx/tests/engines/test_www1x.py57
-rw-r--r--searx/tests/engines/test_www500px.py83
-rw-r--r--searx/tests/engines/test_yacy.py96
-rw-r--r--searx/tests/engines/test_yahoo.py141
-rw-r--r--searx/tests/engines/test_yahoo_news.py149
-rw-r--r--searx/tests/engines/test_youtube_api.py111
-rw-r--r--searx/tests/engines/test_youtube_noapi.py154
-rw-r--r--searx/tests/robot/__init__.py0
-rw-r--r--searx/tests/robot/test_basic.robot44
-rw-r--r--searx/tests/test_engines.py45
-rw-r--r--searx/tests/test_plugins.py74
-rw-r--r--searx/tests/test_results.py41
-rw-r--r--searx/tests/test_robot.py23
-rw-r--r--searx/tests/test_search.py10
-rw-r--r--searx/tests/test_utils.py101
-rw-r--r--searx/tests/test_webapp.py151
-rw-r--r--searx/translations/bg/LC_MESSAGES/messages.mobin0 -> 9643 bytes
-rw-r--r--searx/translations/bg/LC_MESSAGES/messages.po686
-rw-r--r--searx/translations/de/LC_MESSAGES/messages.mobin8048 -> 8110 bytes
-rw-r--r--searx/translations/de/LC_MESSAGES/messages.po25
-rw-r--r--searx/translations/el_GR/LC_MESSAGES/messages.mobin0 -> 8297 bytes
-rw-r--r--searx/translations/el_GR/LC_MESSAGES/messages.po686
-rw-r--r--searx/translations/en/LC_MESSAGES/messages.mobin5984 -> 7565 bytes
-rw-r--r--searx/translations/en/LC_MESSAGES/messages.po224
-rw-r--r--searx/translations/eo/LC_MESSAGES/messages.mobin0 -> 7653 bytes
-rw-r--r--searx/translations/eo/LC_MESSAGES/messages.po686
-rw-r--r--searx/translations/es/LC_MESSAGES/messages.mobin8146 -> 8193 bytes
-rw-r--r--searx/translations/es/LC_MESSAGES/messages.po27
-rw-r--r--searx/translations/fr/LC_MESSAGES/messages.mobin8281 -> 8328 bytes
-rw-r--r--searx/translations/fr/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/he/LC_MESSAGES/messages.mobin8675 -> 8728 bytes
-rw-r--r--searx/translations/he/LC_MESSAGES/messages.po38
-rw-r--r--searx/translations/hu/LC_MESSAGES/messages.mobin7829 -> 7878 bytes
-rw-r--r--searx/translations/hu/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/it/LC_MESSAGES/messages.mobin7663 -> 7751 bytes
-rw-r--r--searx/translations/it/LC_MESSAGES/messages.po55
-rw-r--r--searx/translations/ja/LC_MESSAGES/messages.mobin7753 -> 9052 bytes
-rw-r--r--searx/translations/ja/LC_MESSAGES/messages.po215
-rw-r--r--searx/translations/nl/LC_MESSAGES/messages.mobin7868 -> 7918 bytes
-rw-r--r--searx/translations/nl/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/pt/LC_MESSAGES/messages.mobin6350 -> 7931 bytes
-rw-r--r--searx/translations/pt/LC_MESSAGES/messages.po246
-rw-r--r--searx/translations/pt_BR/LC_MESSAGES/messages.mobin0 -> 8064 bytes
-rw-r--r--searx/translations/pt_BR/LC_MESSAGES/messages.po686
-rw-r--r--searx/translations/ro/LC_MESSAGES/messages.mobin8099 -> 8156 bytes
-rw-r--r--searx/translations/ro/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/ru/LC_MESSAGES/messages.mobin9480 -> 9537 bytes
-rw-r--r--searx/translations/ru/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/tr/LC_MESSAGES/messages.mobin8018 -> 8075 bytes
-rw-r--r--searx/translations/tr/LC_MESSAGES/messages.po22
-rw-r--r--searx/translations/zh_CN/LC_MESSAGES/messages.mobin7412 -> 7465 bytes
-rw-r--r--searx/translations/zh_CN/LC_MESSAGES/messages.po41
-rw-r--r--searx/webapp.py8
143 files changed, 4012 insertions, 7640 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index ea21e8f13..7b67a394f 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -15,9 +15,11 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
+import certifi
import logging
from os import environ
from os.path import realpath, dirname, join, abspath
+from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
try:
from yaml import load
except:
@@ -47,4 +49,11 @@ else:
logger = logging.getLogger('searx')
+# Workaround for openssl versions <1.0.2
+# https://github.com/certifi/python-certifi/issues/26
+if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):
+ if hasattr(certifi, 'old_where'):
+ environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
+ logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))
+
logger.info('Initialisation done')
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index 264d0cc1f..94913e8d8 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -114,8 +114,7 @@ def dbpedia(query):
# dbpedia autocompleter, no HTTPS
autocomplete_url = 'http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?'
- response = get(autocomplete_url
- + urlencode(dict(QueryString=query)))
+ response = get(autocomplete_url + urlencode(dict(QueryString=query)))
results = []
@@ -141,8 +140,7 @@ def google(query):
# google autocompleter
autocomplete_url = 'https://suggestqueries.google.com/complete/search?client=toolbar&'
- response = get(autocomplete_url
- + urlencode(dict(q=query)))
+ response = get(autocomplete_url + urlencode(dict(q=query)))
results = []
@@ -163,6 +161,23 @@ def startpage(query):
return []
+def qwant(query):
+ # qwant autocompleter (additional parameter : lang=en_en&count=xxx )
+ url = 'https://api.qwant.com/api/suggest?{query}'
+
+ resp = get(url.format(query=urlencode({'q': query})))
+
+ results = []
+
+ if resp.ok:
+ data = loads(resp.text)
+ if data['status'] == 'success':
+ for item in data['data']['items']:
+ results.append(item['value'])
+
+ return results
+
+
def wikipedia(query):
# wikipedia autocompleter
url = 'https://en.wikipedia.org/w/api.php?action=opensearch&{0}&limit=10&namespace=0&format=json'
@@ -177,5 +192,6 @@ backends = {'dbpedia': dbpedia,
'duckduckgo': duckduckgo,
'google': google,
'startpage': startpage,
+ 'qwant': qwant,
'wikipedia': wikipedia
}
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 447138d3b..6d5066733 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -34,6 +34,15 @@ engines = {}
categories = {'general': []}
engine_shortcuts = {}
+engine_default_args = {'paging': False,
+ 'categories': ['general'],
+ 'language_support': True,
+ 'safesearch': False,
+ 'timeout': settings['outgoing']['request_timeout'],
+ 'shortcut': '-',
+ 'disabled': False,
+ 'suspend_end_time': 0,
+ 'continuous_errors': 0}
def load_module(filename):
@@ -62,26 +71,9 @@ def load_engine(engine_data):
continue
setattr(engine, param_name, engine_data[param_name])
- if not hasattr(engine, 'paging'):
- engine.paging = False
-
- if not hasattr(engine, 'categories'):
- engine.categories = ['general']
-
- if not hasattr(engine, 'language_support'):
- engine.language_support = True
-
- if not hasattr(engine, 'safesearch'):
- engine.safesearch = False
-
- if not hasattr(engine, 'timeout'):
- engine.timeout = settings['outgoing']['request_timeout']
-
- if not hasattr(engine, 'shortcut'):
- engine.shortcut = ''
-
- if not hasattr(engine, 'disabled'):
- engine.disabled = False
+ for arg_name, arg_value in engine_default_args.iteritems():
+ if not hasattr(engine, arg_name):
+ setattr(engine, arg_name, arg_value)
# checking required variables
for engine_attr in dir(engine):
@@ -100,18 +92,15 @@ def load_engine(engine_data):
'errors': 0
}
- if hasattr(engine, 'categories'):
- for category_name in engine.categories:
- categories.setdefault(category_name, []).append(engine)
- else:
- categories['general'].append(engine)
+ for category_name in engine.categories:
+ categories.setdefault(category_name, []).append(engine)
+
+ if engine.shortcut in engine_shortcuts:
+ logger.error('Engine config error: ambigious shortcut: {0}'.format(engine.shortcut))
+ sys.exit(1)
+
+ engine_shortcuts[engine.shortcut] = engine.name
- if engine.shortcut:
- if engine.shortcut in engine_shortcuts:
- logger.error('Engine config error: ambigious shortcut: {0}'
- .format(engine.shortcut))
- sys.exit(1)
- engine_shortcuts[engine.shortcut] = engine.name
return engine
diff --git a/searx/engines/bing_images.py b/searx/engines/bing_images.py
index 06850dfe1..2664b795f 100644
--- a/searx/engines/bing_images.py
+++ b/searx/engines/bing_images.py
@@ -17,7 +17,7 @@
from urllib import urlencode
from lxml import html
-from yaml import load
+from json import loads
import re
# engine dependent config
@@ -36,6 +36,9 @@ safesearch_types = {2: 'STRICT',
0: 'OFF'}
+_quote_keys_regex = re.compile('({|,)([a-z][a-z0-9]*):(")', re.I | re.U)
+
+
# do search-request
def request(query, params):
offset = (params['pageno'] - 1) * 10 + 1
@@ -65,22 +68,19 @@ def response(resp):
dom = html.fromstring(resp.text)
- # init regex for yaml-parsing
- p = re.compile('({|,)([a-z]+):(")')
-
# parse results
for result in dom.xpath('//div[@class="dg_u"]'):
link = result.xpath('./a')[0]
- # parse yaml-data (it is required to add a space, to make it parsable)
- yaml_data = load(p.sub(r'\1\2: \3', link.attrib.get('m')))
+ # parse json-data (it is required to add a space, to make it parsable)
+ json_data = loads(_quote_keys_regex.sub(r'\1"\2": \3', link.attrib.get('m')))
title = link.attrib.get('t1')
ihk = link.attrib.get('ihk')
# url = 'http://' + link.attrib.get('t3')
- url = yaml_data.get('surl')
- img_src = yaml_data.get('imgurl')
+ url = json_data.get('surl')
+ img_src = json_data.get('imgurl')
# append result
results.append({'template': 'images.html',
diff --git a/searx/engines/blekko_images.py b/searx/engines/blekko_images.py
index 93ac6616b..c0664f390 100644
--- a/searx/engines/blekko_images.py
+++ b/searx/engines/blekko_images.py
@@ -37,7 +37,7 @@ def request(query, params):
c=c)
if params['pageno'] != 1:
- params['url'] += '&page={pageno}'.format(pageno=(params['pageno']-1))
+ params['url'] += '&page={pageno}'.format(pageno=(params['pageno'] - 1))
# let Blekko know we wan't have profiling
params['cookies']['tag_lesslogging'] = '1'
diff --git a/searx/engines/btdigg.py b/searx/engines/btdigg.py
index 192ed6ee9..c2b22f003 100644
--- a/searx/engines/btdigg.py
+++ b/searx/engines/btdigg.py
@@ -29,7 +29,7 @@ search_url = url + '/search?q={search_term}&p={pageno}'
# do search-request
def request(query, params):
params['url'] = search_url.format(search_term=quote(query),
- pageno=params['pageno']-1)
+ pageno=params['pageno'] - 1)
return params
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 60c8d7ea7..135aeb324 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+'browse/all/?offset={offset}&{query}'
+search_url = base_url + 'browse/all/?offset={offset}&{query}'
# do search-request
diff --git a/searx/engines/digg.py b/searx/engines/digg.py
index 000f66ba2..a10b38bb6 100644
--- a/searx/engines/digg.py
+++ b/searx/engines/digg.py
@@ -22,7 +22,7 @@ paging = True
# search-url
base_url = 'https://digg.com/'
-search_url = base_url+'api/search/{query}.json?position={position}&format=html'
+search_url = base_url + 'api/search/{query}.json?position={position}&format=html'
# specific xpath variables
results_xpath = '//article'
diff --git a/searx/engines/faroo.py b/searx/engines/faroo.py
index 43df14eef..9fa244e77 100644
--- a/searx/engines/faroo.py
+++ b/searx/engines/faroo.py
@@ -88,7 +88,7 @@ def response(resp):
for result in search_res['results']:
if result['news']:
# timestamp (milliseconds since 1970)
- publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0) # noqa
+ publishedDate = datetime.datetime.fromtimestamp(result['date'] / 1000.0) # noqa
# append news result
results.append({'url': result['url'],
diff --git a/searx/engines/frinkiac.py b/searx/engines/frinkiac.py
new file mode 100644
index 000000000..a9383f862
--- /dev/null
+++ b/searx/engines/frinkiac.py
@@ -0,0 +1,44 @@
+"""
+Frinkiac (Images)
+
+@website https://www.frinkiac.com
+@provide-api no
+@using-api no
+@results JSON
+@stable no
+@parse url, title, img_src
+"""
+
+from json import loads
+from urllib import urlencode
+
+categories = ['images']
+
+BASE = 'https://frinkiac.com/'
+SEARCH_URL = '{base}api/search?{query}'
+RESULT_URL = '{base}?{query}'
+THUMB_URL = '{base}img/{episode}/{timestamp}/medium.jpg'
+IMAGE_URL = '{base}img/{episode}/{timestamp}.jpg'
+
+
+def request(query, params):
+ params['url'] = SEARCH_URL.format(base=BASE, query=urlencode({'q': query}))
+ return params
+
+
+def response(resp):
+ results = []
+ response_data = loads(resp.text)
+ for result in response_data:
+ episode = result['Episode']
+ timestamp = result['Timestamp']
+
+ results.append({'template': 'images.html',
+ 'url': RESULT_URL.format(base=BASE,
+ query=urlencode({'p': 'caption', 'e': episode, 't': timestamp})),
+ 'title': episode,
+ 'content': '',
+ 'thumbnail_src': THUMB_URL.format(base=BASE, episode=episode, timestamp=timestamp),
+ 'img_src': IMAGE_URL.format(base=BASE, episode=episode, timestamp=timestamp)})
+
+ return results
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py
index 3fef102f4..1cc243104 100644
--- a/searx/engines/gigablast.py
+++ b/searx/engines/gigablast.py
@@ -10,20 +10,30 @@
@parse url, title, content
"""
-from urllib import urlencode
from cgi import escape
-from lxml import etree
+from json import loads
from random import randint
from time import time
+from urllib import urlencode
# engine dependent config
categories = ['general']
paging = True
-number_of_results = 5
+number_of_results = 10
+language_support = True
+safesearch = True
-# search-url, invalid HTTPS certificate
+# search-url
base_url = 'https://gigablast.com/'
-search_string = 'search?{query}&n={number_of_results}&s={offset}&format=xml&qh=0&rxiyd={rxiyd}&rand={rand}'
+search_string = 'search?{query}'\
+ '&n={number_of_results}'\
+ '&c=main'\
+ '&s={offset}'\
+ '&format=json'\
+ '&qh=0'\
+ '&rxiwd={rxiwd}'\
+ '&qlang={lang}'\
+ '&ff={safesearch}'
# specific xpath variables
results_xpath = '//response//result'
@@ -36,12 +46,23 @@ content_xpath = './/sum'
def request(query, params):
offset = (params['pageno'] - 1) * number_of_results
- search_path = search_string.format(
- query=urlencode({'q': query}),
- offset=offset,
- number_of_results=number_of_results,
- rxiyd=randint(10000, 10000000),
- rand=int(time()))
+ if params['language'] == 'all':
+ language = 'xx'
+ else:
+ language = params['language'][0:2]
+
+ if params['safesearch'] >= 1:
+ safesearch = 1
+ else:
+ safesearch = 0
+
+ search_path = search_string.format(query=urlencode({'q': query}),
+ offset=offset,
+ number_of_results=number_of_results,
+ rxiwd=1,
+ # rand=int(time()),
+ lang=language,
+ safesearch=safesearch)
params['url'] = base_url + search_path
@@ -52,18 +73,14 @@ def request(query, params):
def response(resp):
results = []
- dom = etree.fromstring(resp.content)
-
# parse results
- for result in dom.xpath(results_xpath):
- url = result.xpath(url_xpath)[0].text
- title = result.xpath(title_xpath)[0].text
- content = escape(result.xpath(content_xpath)[0].text)
+ response_json = loads(resp.text)
+ for result in response_json['results']:
# append result
- results.append({'url': url,
- 'title': title,
- 'content': content})
+ results.append({'url': result['url'],
+ 'title': escape(result['title']),
+ 'content': escape(result['sum'])})
# return results
return results
diff --git a/searx/engines/google.py b/searx/engines/google.py
index e82260356..dbca205a1 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -90,7 +90,7 @@ url_map = 'https://www.openstreetmap.org/'\
search_path = '/search'
search_url = ('https://{hostname}' +
search_path +
- '?{query}&start={offset}&gbv=1&gws_rd=cr')
+ '?{query}&start={offset}&gbv=1&gws_rd=ssl')
# other URLs
map_hostname_start = 'maps.google.'
@@ -99,7 +99,7 @@ redirect_path = '/url'
images_path = '/images'
# specific xpath variables
-results_xpath = '//li[@class="g"]'
+results_xpath = '//div[@class="g"]'
url_xpath = './/h3/a/@href'
title_xpath = './/h3'
content_xpath = './/span[@class="st"]'
@@ -209,29 +209,29 @@ def response(resp):
parsed_url = urlparse(url, google_hostname)
# map result
- if ((parsed_url.netloc == google_hostname and parsed_url.path.startswith(maps_path))
- or (parsed_url.netloc.startswith(map_hostname_start))):
- x = result.xpath(map_near)
- if len(x) > 0:
- # map : near the location
- results = results + parse_map_near(parsed_url, x, google_hostname)
- else:
- # map : detail about a location
- results = results + parse_map_detail(parsed_url, result, google_hostname)
-
- # google news
- elif (parsed_url.netloc == google_hostname
- and parsed_url.path == search_path):
- # skipping news results
- pass
-
- # images result
- elif (parsed_url.netloc == google_hostname
- and parsed_url.path == images_path):
- # only thumbnail image provided,
- # so skipping image results
- # results = results + parse_images(result, google_hostname)
- pass
+ if parsed_url.netloc == google_hostname:
+ # TODO fix inside links
+ continue
+ # if parsed_url.path.startswith(maps_path) or parsed_url.netloc.startswith(map_hostname_start):
+ # print "yooooo"*30
+ # x = result.xpath(map_near)
+ # if len(x) > 0:
+ # # map : near the location
+ # results = results + parse_map_near(parsed_url, x, google_hostname)
+ # else:
+ # # map : detail about a location
+ # results = results + parse_map_detail(parsed_url, result, google_hostname)
+ # # google news
+ # elif parsed_url.path == search_path:
+ # # skipping news results
+ # pass
+
+ # # images result
+ # elif parsed_url.path == images_path:
+ # # only thumbnail image provided,
+ # # so skipping image results
+ # # results = results + parse_images(result, google_hostname)
+ # pass
else:
# normal result
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py
index 9fb72e830..26d3720d9 100644
--- a/searx/engines/mediawiki.py
+++ b/searx/engines/mediawiki.py
@@ -24,13 +24,13 @@ number_of_results = 1
# search-url
base_url = 'https://{language}.wikipedia.org/'
-search_url = base_url + 'w/api.php?action=query'\
- '&list=search'\
- '&{query}'\
- '&srprop=timestamp'\
- '&format=json'\
- '&sroffset={offset}'\
- '&srlimit={limit}' # noqa
+search_postfix = 'w/api.php?action=query'\
+ '&list=search'\
+ '&{query}'\
+ '&format=json'\
+ '&sroffset={offset}'\
+ '&srlimit={limit}'\
+ '&srwhat=nearmatch' # search for a near match in the title
# do search-request
@@ -48,12 +48,15 @@ def request(query, params):
else:
language = params['language'].split('_')[0]
- if len(format_strings) > 1:
+ # format_string [('https://', 'language', '', None), ('.wikipedia.org/', None, None, None)]
+ if any(x[1] == 'language' for x in format_strings):
string_args['language'] = language
# write search-language back to params, required in response
params['language'] = language
+ search_url = base_url + search_postfix
+
params['url'] = search_url.format(**string_args)
return params
@@ -71,6 +74,8 @@ def response(resp):
# parse results
for result in search_results['query']['search']:
+ if result.get('snippet', '').startswith('#REDIRECT'):
+ continue
url = base_url.format(language=resp.search_params['language']) +\
'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8'))
diff --git a/searx/engines/searchcode_code.py b/searx/engines/searchcode_code.py
index bd5eb71d2..de8cd43be 100644
--- a/searx/engines/searchcode_code.py
+++ b/searx/engines/searchcode_code.py
@@ -20,7 +20,7 @@ paging = True
# search-url
url = 'https://searchcode.com/'
-search_url = url+'api/codesearch_I/?{query}&p={pageno}'
+search_url = url + 'api/codesearch_I/?{query}&p={pageno}'
# special code-endings which are not recognised by the file ending
code_endings = {'cs': 'c#',
@@ -32,7 +32,7 @@ code_endings = {'cs': 'c#',
# do search-request
def request(query, params):
params['url'] = search_url.format(query=urlencode({'q': query}),
- pageno=params['pageno']-1)
+ pageno=params['pageno'] - 1)
# Disable SSL verification
# error: (60) SSL certificate problem: unable to get local issuer
diff --git a/searx/engines/searchcode_doc.py b/searx/engines/searchcode_doc.py
index 9453f31a4..f24fe6f90 100644
--- a/searx/engines/searchcode_doc.py
+++ b/searx/engines/searchcode_doc.py
@@ -19,13 +19,13 @@ paging = True
# search-url
url = 'https://searchcode.com/'
-search_url = url+'api/search_IV/?{query}&p={pageno}'
+search_url = url + 'api/search_IV/?{query}&p={pageno}'
# do search-request
def request(query, params):
params['url'] = search_url.format(query=urlencode({'q': query}),
- pageno=params['pageno']-1)
+ pageno=params['pageno'] - 1)
# Disable SSL verification
# error: (60) SSL certificate problem: unable to get local issuer
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index 46e17fc81..ac23c1e83 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -10,17 +10,19 @@
@parse url, title, content, publishedDate, embedded
"""
+import re
+from StringIO import StringIO
from json import loads
+from lxml import etree
from urllib import urlencode, quote_plus
from dateutil import parser
+from searx import logger
+from searx.poolrequests import get as http_get
# engine dependent config
categories = ['music']
paging = True
-# api-key
-guest_client_id = 'b45b1aa10f1ac2941910a7f0d10f8e28'
-
# search-url
url = 'https://api.soundcloud.com/'
search_url = url + 'search?{query}'\
@@ -35,6 +37,30 @@ embedded_url = '<iframe width="100%" height="166" ' +\
'data-src="https://w.soundcloud.com/player/?url={uri}"></iframe>'
+def get_client_id():
+ response = http_get("https://soundcloud.com")
+ rx_namespace = {"re": "http://exslt.org/regular-expressions"}
+
+ if response.ok:
+ tree = etree.parse(StringIO(response.content), etree.HTMLParser())
+ script_tags = tree.xpath("//script[re:match(@src, '(.*app.*js)')]", namespaces=rx_namespace)
+ app_js_urls = [script_tag.get('src') for script_tag in script_tags if script_tag is not None]
+
+ # extracts valid app_js urls from soundcloud.com content
+ for app_js_url in app_js_urls:
+ # gets app_js and searches for the clientid
+ response = http_get(app_js_url)
+ if response.ok:
+ cids = re.search(r'client_id:"([^"]*)"', response.content, re.M | re.I)
+ if cids is not None and len(cids.groups()):
+ return cids.groups()[0]
+ logger.warning("Unable to fetch guest client_id from SoundCloud, check parser!")
+ return ""
+
+# api-key
+guest_client_id = get_client_id()
+
+
# do search-request
def request(query, params):
offset = (params['pageno'] - 1) * 20
diff --git a/searx/engines/stackoverflow.py b/searx/engines/stackoverflow.py
index 34ecabae7..fdd3711a9 100644
--- a/searx/engines/stackoverflow.py
+++ b/searx/engines/stackoverflow.py
@@ -22,7 +22,7 @@ paging = True
# search-url
url = 'https://stackoverflow.com/'
-search_url = url+'search?{query}&page={pageno}'
+search_url = url + 'search?{query}&page={pageno}'
# specific xpath variables
results_xpath = '//div[contains(@class,"question-summary")]'
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index a91cafa00..52dd0b92f 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -90,8 +90,8 @@ def response(resp):
# check if search result starts with something like: "2 Sep 2014 ... "
if re.match("^([1-9]|[1-2][0-9]|3[0-1]) [A-Z][a-z]{2} [0-9]{4} \.\.\. ", content):
- date_pos = content.find('...')+4
- date_string = content[0:date_pos-5]
+ date_pos = content.find('...') + 4
+ date_string = content[0:date_pos - 5]
published_date = parser.parse(date_string, dayfirst=True)
# fix content string
@@ -99,8 +99,8 @@ def response(resp):
# check if search result starts with something like: "5 days ago ... "
elif re.match("^[0-9]+ days? ago \.\.\. ", content):
- date_pos = content.find('...')+4
- date_string = content[0:date_pos-5]
+ date_pos = content.find('...') + 4
+ date_string = content[0:date_pos - 5]
# calculate datetime
published_date = datetime.now() - timedelta(days=int(re.match(r'\d+', date_string).group()))
diff --git a/searx/engines/swisscows.py b/searx/engines/swisscows.py
index 2d31264ca..864436a52 100644
--- a/searx/engines/swisscows.py
+++ b/searx/engines/swisscows.py
@@ -10,6 +10,7 @@
@parse url, title, content
"""
+from cgi import escape
from json import loads
from urllib import urlencode, unquote
import re
@@ -77,7 +78,7 @@ def response(resp):
# append result
results.append({'url': result['SourceUrl'],
- 'title': result['Title'],
+ 'title': escape(result['Title']),
'content': '',
'img_src': img_url,
'template': 'images.html'})
@@ -89,8 +90,8 @@ def response(resp):
# append result
results.append({'url': result_url,
- 'title': result_title,
- 'content': result_content})
+ 'title': escape(result_title),
+ 'content': escape(result_content)})
# parse images
for result in json.get('Images', []):
@@ -99,7 +100,7 @@ def response(resp):
# append result
results.append({'url': result['SourceUrl'],
- 'title': result['Title'],
+ 'title': escape(result['Title']),
'content': '',
'img_src': img_url,
'template': 'images.html'})
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index fc840d47c..9f3496b72 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -295,7 +295,7 @@ def get_geolink(claims, propertyName, defaultValue=''):
if precision < 0.0003:
zoom = 19
else:
- zoom = int(15 - precision*8.8322 + precision*precision*0.625447)
+ zoom = int(15 - precision * 8.8322 + precision * precision * 0.625447)
url = url_map\
.replace('{latitude}', str(value.get('latitude', 0)))\
@@ -318,6 +318,6 @@ def get_wikilink(result, wikiid):
def get_wiki_firstlanguage(result, wikipatternid):
for k in result.get('sitelinks', {}).keys():
- if k.endswith(wikipatternid) and len(k) == (2+len(wikipatternid)):
+ if k.endswith(wikipatternid) and len(k) == (2 + len(wikipatternid)):
return k[0:2]
return None
diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py
new file mode 100644
index 000000000..4526c825f
--- /dev/null
+++ b/searx/engines/wolframalpha_api.py
@@ -0,0 +1,122 @@
+# Wolfram Alpha (Science)
+#
+# @website https://www.wolframalpha.com
+# @provide-api yes (https://api.wolframalpha.com/v2/)
+#
+# @using-api yes
+# @results XML
+# @stable yes
+# @parse url, infobox
+
+from urllib import urlencode
+from lxml import etree
+
+# search-url
+search_url = 'https://api.wolframalpha.com/v2/query?appid={api_key}&{query}'
+site_url = 'https://www.wolframalpha.com/input/?{query}'
+api_key = '' # defined in settings.yml
+
+# xpath variables
+failure_xpath = '/queryresult[attribute::success="false"]'
+answer_xpath = '//pod[attribute::primary="true"]/subpod/plaintext'
+input_xpath = '//pod[starts-with(attribute::id, "Input")]/subpod/plaintext'
+pods_xpath = '//pod'
+subpods_xpath = './subpod'
+pod_id_xpath = './@id'
+pod_title_xpath = './@title'
+plaintext_xpath = './plaintext'
+image_xpath = './img'
+img_src_xpath = './@src'
+img_alt_xpath = './@alt'
+
+# pods to display as image in infobox
+# this pods do return a plaintext, but they look better and are more useful as images
+image_pods = {'VisualRepresentation',
+ 'Illustration'}
+
+
+# do search-request
+def request(query, params):
+ params['url'] = search_url.format(query=urlencode({'input': query}),
+ api_key=api_key)
+ params['headers']['Referer'] = site_url.format(query=urlencode({'i': query}))
+
+ return params
+
+
+# replace private user area characters to make text legible
+def replace_pua_chars(text):
+ pua_chars = {u'\uf522': u'\u2192', # rigth arrow
+ u'\uf7b1': u'\u2115', # set of natural numbers
+ u'\uf7b4': u'\u211a', # set of rational numbers
+ u'\uf7b5': u'\u211d', # set of real numbers
+ u'\uf7bd': u'\u2124', # set of integer numbers
+ u'\uf74c': 'd', # differential
+ u'\uf74d': u'\u212f', # euler's number
+ u'\uf74e': 'i', # imaginary number
+ u'\uf7d9': '='} # equals sign
+
+ for k, v in pua_chars.iteritems():
+ text = text.replace(k, v)
+
+ return text
+
+
+# get response from search-request
+def response(resp):
+ results = []
+
+ search_results = etree.XML(resp.content)
+
+ # return empty array if there are no results
+ if search_results.xpath(failure_xpath):
+ return []
+
+ try:
+ infobox_title = search_results.xpath(input_xpath)[0].text
+ except:
+ infobox_title = None
+
+ pods = search_results.xpath(pods_xpath)
+ result_chunks = []
+ for pod in pods:
+ pod_id = pod.xpath(pod_id_xpath)[0]
+ pod_title = pod.xpath(pod_title_xpath)[0]
+
+ subpods = pod.xpath(subpods_xpath)
+ if not subpods:
+ continue
+
+ # Appends either a text or an image, depending on which one is more suitable
+ for subpod in subpods:
+ content = subpod.xpath(plaintext_xpath)[0].text
+ image = subpod.xpath(image_xpath)
+
+ if content and pod_id not in image_pods:
+
+ # if no input pod was found, title is first plaintext pod
+ if not infobox_title:
+ infobox_title = content
+
+ content = replace_pua_chars(content)
+ result_chunks.append({'label': pod_title, 'value': content})
+
+ elif image:
+ result_chunks.append({'label': pod_title,
+ 'image': {'src': image[0].xpath(img_src_xpath)[0],
+ 'alt': image[0].xpath(img_alt_xpath)[0]}})
+
+ if not result_chunks:
+ return []
+
+ # append infobox
+ results.append({'infobox': infobox_title,
+ 'attributes': result_chunks,
+ 'urls': [{'title': 'Wolfram|Alpha', 'url': resp.request.headers['Referer'].decode('utf8')}]})
+
+ # append link to site
+ results.append({'url': resp.request.headers['Referer'].decode('utf8'),
+ 'title': 'Wolfram|Alpha',
+ 'content': infobox_title})
+
+ return results
diff --git a/searx/engines/wolframalpha_noapi.py b/searx/engines/wolframalpha_noapi.py
new file mode 100644
index 000000000..59629b833
--- /dev/null
+++ b/searx/engines/wolframalpha_noapi.py
@@ -0,0 +1,116 @@
+# Wolfram|Alpha (Science)
+#
+# @website https://www.wolframalpha.com/
+# @provide-api yes (https://api.wolframalpha.com/v2/)
+#
+# @using-api no
+# @results JSON
+# @stable no
+# @parse url, infobox
+
+from cgi import escape
+from json import loads
+from time import time
+from urllib import urlencode
+from lxml.etree import XML
+
+from searx.poolrequests import get as http_get
+
+# search-url
+url = 'https://www.wolframalpha.com/'
+
+search_url = url + 'input/json.jsp'\
+ '?async=false'\
+ '&banners=raw'\
+ '&debuggingdata=false'\
+ '&format=image,plaintext,imagemap,minput,moutput'\
+ '&formattimeout=2'\
+ '&{query}'\
+ '&output=JSON'\
+ '&parsetimeout=2'\
+ '&proxycode={token}'\
+ '&scantimeout=0.5'\
+ '&sponsorcategories=true'\
+ '&statemethod=deploybutton'
+
+referer_url = url + 'input/?{query}'
+
+token = {'value': '',
+ 'last_updated': None}
+
+# pods to display as image in infobox
+# this pods do return a plaintext, but they look better and are more useful as images
+image_pods = {'VisualRepresentation',
+ 'Illustration',
+ 'Symbol'}
+
+
+# seems, wolframalpha resets its token in every hour
+def obtain_token():
+ update_time = time() - (time() % 3600)
+ try:
+ token_response = http_get('https://www.wolframalpha.com/input/api/v1/code?ts=9999999999999999999', timeout=2.0)
+ token['value'] = loads(token_response.text)['code']
+ token['last_updated'] = update_time
+ except:
+ pass
+ return token
+
+
+obtain_token()
+
+
+# do search-request
+def request(query, params):
+ # obtain token if last update was more than an hour
+ if time() - token['last_updated'] > 3600:
+ obtain_token()
+ params['url'] = search_url.format(query=urlencode({'input': query}), token=token['value'])
+ params['headers']['Referer'] = referer_url.format(query=urlencode({'i': query}))
+
+ return params
+
+
+# get response from search-request
+def response(resp):
+ results = []
+
+ resp_json = loads(resp.text)
+
+ if not resp_json['queryresult']['success']:
+ return []
+
+ # TODO handle resp_json['queryresult']['assumptions']
+ result_chunks = []
+ infobox_title = None
+ for pod in resp_json['queryresult']['pods']:
+ pod_id = pod.get('id', '')
+ pod_title = pod.get('title', '')
+
+ if 'subpods' not in pod:
+ continue
+
+ if pod_id == 'Input' or not infobox_title:
+ infobox_title = pod['subpods'][0]['plaintext']
+
+ for subpod in pod['subpods']:
+ if subpod['plaintext'] != '' and pod_id not in image_pods:
+ # append unless it's not an actual answer
+ if subpod['plaintext'] != '(requires interactivity)':
+ result_chunks.append({'label': pod_title, 'value': subpod['plaintext']})
+
+ elif 'img' in subpod:
+ result_chunks.append({'label': pod_title, 'image': subpod['img']})
+
+ if not result_chunks:
+ return []
+
+ results.append({'infobox': infobox_title,
+ 'attributes': result_chunks,
+ 'urls': [{'title': 'Wolfram|Alpha', 'url': resp.request.headers['Referer'].decode('utf8')}]})
+
+ results.append({'url': resp.request.headers['Referer'].decode('utf8'),
+ 'title': 'Wolfram|Alpha',
+ 'content': infobox_title})
+
+ return results
diff --git a/searx/engines/www1x.py b/searx/engines/www1x.py
index ddb79bfea..1269a5422 100644
--- a/searx/engines/www1x.py
+++ b/searx/engines/www1x.py
@@ -22,7 +22,7 @@ paging = False
# search-url
base_url = 'https://1x.com'
-search_url = base_url+'/backend/search.php?{query}'
+search_url = base_url + '/backend/search.php?{query}'
# do search-request
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index 1a599dc0a..f51634be0 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -43,7 +43,7 @@ def extract_url(xpath_results, search_url):
if url.startswith('//'):
# add http or https to this kind of url //example.com/
parsed_search_url = urlparse(search_url)
- url = parsed_search_url.scheme+url
+ url = parsed_search_url.scheme + url
elif url.startswith('/'):
# fix relative url to the search engine
url = urljoin(search_url, url)
@@ -69,7 +69,7 @@ def normalize_url(url):
p = parsed_url.path
mark = p.find('/**')
if mark != -1:
- return unquote(p[mark+3:]).decode('utf-8')
+ return unquote(p[mark + 3:]).decode('utf-8')
return url
diff --git a/searx/engines/yandex.py b/searx/engines/yandex.py
index edc6ad5f2..be3ec36ce 100644
--- a/searx/engines/yandex.py
+++ b/searx/engines/yandex.py
@@ -9,6 +9,7 @@
@parse url, title, content
"""
+from cgi import escape
from urllib import urlencode
from lxml import html
from searx.search import logger
@@ -38,7 +39,7 @@ content_xpath = './/div[@class="serp-item__text"]//text()'
def request(query, params):
lang = params['language'].split('_')[0]
host = base_url.format(tld=language_map.get(lang) or default_tld)
- params['url'] = host + search_url.format(page=params['pageno']-1,
+ params['url'] = host + search_url.format(page=params['pageno'] - 1,
query=urlencode({'text': query}))
return params
@@ -51,8 +52,8 @@ def response(resp):
for result in dom.xpath(results_xpath):
try:
res = {'url': result.xpath(url_xpath)[0],
- 'title': ''.join(result.xpath(title_xpath)),
- 'content': ''.join(result.xpath(content_xpath))}
+ 'title': escape(''.join(result.xpath(title_xpath))),
+ 'content': escape(''.join(result.xpath(content_xpath)))}
except:
logger.exception('yandex parse crash')
continue
diff --git a/searx/languages.py b/searx/languages.py
index df5fabf74..b67da9d22 100644
--- a/searx/languages.py
+++ b/searx/languages.py
@@ -58,6 +58,7 @@ language_codes = (
("ko_KR", "Korean", "Korea"),
("lt_LT", "Lithuanian", "Lithuania"),
("lv_LV", "Latvian", "Latvia"),
+ ("oc_OC", "Occitan", "Occitan"),
("nb_NO", "Norwegian", "Norway"),
("nl_BE", "Dutch", "Belgium"),
("nl_NL", "Dutch", "Netherlands"),
diff --git a/searx/plugins/__init__.py b/searx/plugins/__init__.py
index a4d7ad8a8..87cc01382 100644
--- a/searx/plugins/__init__.py
+++ b/searx/plugins/__init__.py
@@ -20,6 +20,7 @@ from searx import logger
logger = logger.getChild('plugins')
from searx.plugins import (https_rewrite,
+ open_results_on_new_tab,
self_info,
search_on_category_select,
tracker_url_remover)
@@ -72,6 +73,7 @@ class PluginStore():
plugins = PluginStore()
plugins.register(https_rewrite)
+plugins.register(open_results_on_new_tab)
plugins.register(self_info)
plugins.register(search_on_category_select)
plugins.register(tracker_url_remover)
diff --git a/searx/plugins/https_rewrite.py b/searx/plugins/https_rewrite.py
index a24f15a28..0a58cc85d 100644
--- a/searx/plugins/https_rewrite.py
+++ b/searx/plugins/https_rewrite.py
@@ -103,10 +103,10 @@ def load_single_https_ruleset(rules_path):
# into a valid python regex group
rule_from = ruleset.attrib['from'].replace('$', '\\')
if rule_from.endswith('\\'):
- rule_from = rule_from[:-1]+'$'
+ rule_from = rule_from[:-1] + '$'
rule_to = ruleset.attrib['to'].replace('$', '\\')
if rule_to.endswith('\\'):
- rule_to = rule_to[:-1]+'$'
+ rule_to = rule_to[:-1] + '$'
# TODO, not working yet because of the hack above,
# currently doing that in webapp.py
diff --git a/searx/plugins/open_results_on_new_tab.py b/searx/plugins/open_results_on_new_tab.py
new file mode 100644
index 000000000..5ebece142
--- /dev/null
+++ b/searx/plugins/open_results_on_new_tab.py
@@ -0,0 +1,24 @@
+'''
+searx is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+searx is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with searx. If not, see < http://www.gnu.org/licenses/ >.
+
+(C) 2016 by Adam Tauber, <asciimoo@gmail.com>
+'''
+from flask.ext.babel import gettext
+name = gettext('Open result links on new browser tabs')
+description = gettext('Results are opened in the same window by default. '
+ 'This plugin overwrites the default behaviour to open links on new tabs/windows. '
+ '(JavaScript required)')
+default_on = False
+
+js_dependencies = ('plugins/js/open_results_on_new_tab.js',)
diff --git a/searx/plugins/search_on_category_select.py b/searx/plugins/search_on_category_select.py
index a1667021d..53585faea 100644
--- a/searx/plugins/search_on_category_select.py
+++ b/searx/plugins/search_on_category_select.py
@@ -20,4 +20,4 @@ description = gettext('Perform search immediately if a category selected. '
'Disable to select multiple categories. (JavaScript required)')
default_on = True
-js_dependencies = ('js/search_on_category_select.js',)
+js_dependencies = ('plugins/js/search_on_category_select.js',)
diff --git a/searx/poolrequests.py b/searx/poolrequests.py
index 4761f6ae8..13c6a906e 100644
--- a/searx/poolrequests.py
+++ b/searx/poolrequests.py
@@ -92,7 +92,7 @@ def head(url, **kwargs):
return request('head', url, **kwargs)
-def post(url, data=None, **kwargs):
+def post(url, data=None, **kwargs):
return request('post', url, data=data, **kwargs)
diff --git a/searx/results.py b/searx/results.py
index bc656f2ac..7e087382c 100644
--- a/searx/results.py
+++ b/searx/results.py
@@ -138,6 +138,7 @@ class ResultContainer(object):
# if the result has no scheme, use http as default
if not result['parsed_url'].scheme:
result['parsed_url'] = result['parsed_url']._replace(scheme="http")
+ result['url'] = result['parsed_url'].geturl()
result['host'] = result['parsed_url'].netloc
diff --git a/searx/search.py b/searx/search.py
index 655b7808a..ce41b231b 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -34,16 +34,23 @@ number_of_searches = 0
def search_request_wrapper(fn, url, engine_name, **kwargs):
+ ret = None
+ engine = engines[engine_name]
try:
- return fn(url, **kwargs)
+ ret = fn(url, **kwargs)
+ with threading.RLock():
+ engine.continuous_errors = 0
+ engine.suspend_end_time = 0
except:
# increase errors stats
with threading.RLock():
- engines[engine_name].stats['errors'] += 1
+ engine.stats['errors'] += 1
+ engine.continuous_errors += 1
+ engine.suspend_end_time = time() + min(60, engine.continuous_errors)
# print engine name and specific error message
logger.exception('engine crash: {0}'.format(engine_name))
- return
+ return ret
def threaded_requests(requests):
@@ -241,6 +248,10 @@ class Search(object):
for engine in categories[categ]
if (engine.name, categ) not in self.blocked_engines)
+ # remove suspended engines
+ self.engines = [e for e in self.engines
+ if engines[e['name']].suspend_end_time <= time()]
+
# do search-request
def search(self, request):
global number_of_searches
diff --git a/searx/settings.yml b/searx/settings.yml
index c7f659e5f..e8e442f23 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -1,5 +1,6 @@
general:
debug : False # Debug mode, only for development
+ instance_name : "searx" # displayed name
search:
safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict
@@ -110,6 +111,11 @@ engines:
# Or you can use the html non-stable engine, activated by default
engine : flickr_noapi
+ - name : frinkiac
+ engine : frinkiac
+ shortcut : frk
+ disabled : True
+
- name : gigablast
engine : gigablast
shortcut : gb
@@ -300,6 +306,16 @@ engines:
engine : vimeo
shortcut : vm
+ - name : wolframalpha
+ shortcut : wa
+ # You can use the engine using the official stable API, but you need an API key
+ # See : http://products.wolframalpha.com/api/
+ # engine : wolframalpha_api
+ # api_key: '' # required!
+ engine : wolframalpha_noapi
+ timeout: 6.0
+ categories : science
+
#The blekko technology and team have joined IBM Watson! -> https://blekko.com/
# - name : blekko images
# engine : blekko_images
@@ -315,16 +331,20 @@ engines:
locales:
en : English
- de : Deutsch
- he : עברית
- hu : Magyar
- fr : Français
- es : Español
- it : Italiano
- nl : Nederlands
+ bg : Български (Bulgarian)
+ de : Deutsch (German)
+ el_GR : Ελληνικά (Greek_Greece)
+ eo : Esperanto (Esperanto)
+ es : Español (Spanish)
+ fr : Français (French)
+ he : עברית (Hebrew)
+ hu : Magyar (Hungarian)
+ it : Italiano (Italian)
ja : 日本語 (Japanese)
- tr : Türkçe
- pt : Português
- ru : Russian
- ro : Romanian
+ nl : Nederlands (Dutch)
+ pt : Português (Portuguese)
+ pt_BR : Português (Portuguese_Brazil)
+ ro : Română (Romanian)
+ ru : Русский (Russian)
+ tr : Türkçe (Turkish)
zh : 中文 (Chinese)
diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml
index f14443cf5..fb193e43d 100644
--- a/searx/settings_robot.yml
+++ b/searx/settings_robot.yml
@@ -1,5 +1,6 @@
general:
debug : False
+ instance_name : "searx_test"
search:
safe_search : 0
@@ -25,10 +26,12 @@ engines:
- name : general_dummy
engine : dummy
categories : general
+ shortcut : gd
- name : dummy_dummy
engine : dummy
categories : dummy
+ shortcut : dd
locales:
en : English
diff --git a/searx/static/plugins/js/open_results_on_new_tab.js b/searx/static/plugins/js/open_results_on_new_tab.js
new file mode 100644
index 000000000..99ef382a0
--- /dev/null
+++ b/searx/static/plugins/js/open_results_on_new_tab.js
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+ $('.result_header > a').attr('target', '_blank');
+});
diff --git a/searx/static/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js
index 5ecc2cdb9..5ecc2cdb9 100644
--- a/searx/static/js/search_on_category_select.js
+++ b/searx/static/plugins/js/search_on_category_select.js
diff --git a/searx/static/themes/default/css/style.css b/searx/static/themes/default/css/style.css
index 5be452e98..71422bc94 100644
--- a/searx/static/themes/default/css/style.css
+++ b/searx/static/themes/default/css/style.css
@@ -1 +1 @@
-.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid #f00}.highlight .k{color:#008000;font-weight:bold}.highlight .o{color:#666}.highlight .cm{color:#408080;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#408080;font-style:italic}.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:#f00}.highlight .gh{color:#000080;font-weight:bold}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:#000080;font-weight:bold}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#04d}.highlight .kc{color:#008000;font-weight:bold}.highlight .kd{color:#008000;font-weight:bold}.highlight .kn{color:#008000;font-weight:bold}.highlight .kp{color:#008000}.highlight .kr{color:#008000;font-weight:bold}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:#008000}.highlight .nc{color:#00f;font-weight:bold}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:bold}.highlight .ne{color:#d2413a;font-weight:bold}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00f;font-weight:bold}.highlight .nt{color:#008000;font-weight:bold}.highlight .nv{color:#19177c}.highlight .ow{color:#a2f;font-weight:bold}.highlight .w{color:#bbb}.highlight .mf{color:#666}.highlight .mh{color:#666}.highlight .mi{color:#666}.highlight .mo{color:#666}.highlight .sb{color:#ba2121}.highlight .sc{color:#ba2121}.highlight .sd{color:#ba2121;font-style:italic}.highlight .s2{color:#ba2121}.highlight .se{color:#b62;font-weight:bold}.highlight .sh{color:#ba2121}.highlight .si{color:#b68;font-weight:bold}.highlight .sx{color:#008000}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:#008000}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.highlight pre{overflow:auto}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.highlight .lineno::selection{background:transparent}.highlight .lineno::-moz-selection{background:transparent}html{font-family:sans-serif;font-size:.9em;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:#444;padding:0;margin:0}body,#container{padding:0;margin:0}#container{width:100%;position:absolute;top:0}.search{padding:0;margin:0}.search .checkbox_container label{font-size:.9em;border-bottom:2px solid #e8e7e6}.search .checkbox_container label:hover{border-bottom:2px solid #3498db}.search .checkbox_container input[type="checkbox"]:checked+label{border-bottom:2px solid #2980b9}#search_wrapper{position:relative;width:50em;padding:10px}.center #search_wrapper{margin-left:auto;margin-right:auto}.q{background:none repeat scroll 0 0 #fff;border:1px solid #3498db;color:#222;font-size:16px;height:28px;margin:0;outline:medium none;padding:2px;padding-left:8px;padding-right:0 !important;width:100%;z-index:2}#search_submit{position:absolute;top:13px;right:1px;padding:0;border:0;background:url('../img/search-icon.png') no-repeat;background-size:24px 24px;opacity:.8;width:24px;height:30px;font-size:0}@media screen and (max-width:50em){#search_wrapper{width:90%;clear:both;overflow:hidden}}ul.autocompleter-choices{position:absolute;margin:0;padding:0;list-style:none;border:1px solid #3498db;border-left-color:#3498db;border-right-color:#3498db;border-bottom-color:#3498db;text-align:left;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;z-index:50;background-color:#fff;color:#444}ul.autocompleter-choices li{position:relative;margin:-2px 0 0 0;padding:.2em 1.5em .2em 1em;display:block;float:none !important;cursor:pointer;font-weight:normal;white-space:nowrap;font-size:1em;line-height:1.5em}ul.autocompleter-choices li.autocompleter-selected{background-color:#444;color:#fff}ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried{color:#9fcfff}ul.autocompleter-choices span.autocompleter-queried{display:inline;float:none;font-weight:bold;margin:0;padding:0}.row{max-width:800px;margin:20px auto;text-align:justify}.row h1{font-size:3em;margin-top:50px}.row p{padding:0 10px;max-width:700px}.row h3,.row ul{margin:4px 8px}.hmarg{margin:0 20px;border:1px solid #3498db;padding:4px 10px}a:link.hmarg{color:#3498db}a:visited.hmarg{color:#3498db}a:active.hmarg{color:#3498db}a:hover.hmarg{color:#3498db}.top_margin{margin-top:60px}.center{text-align:center}h1{font-size:5em}div.title{background:url('../img/searx.png') no-repeat;width:100%;min-height:80px;background-position:center}div.title h1{visibility:hidden}input[type="submit"]{padding:2px 6px;margin:2px 4px;display:inline-block;background:#3498db;color:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0;cursor:pointer}input[type="checkbox"]{visibility:hidden}fieldset{margin:8px;border:1px solid #3498db}#categories{margin:0 10px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.checkbox_container{display:inline-block;position:relative;margin:0 3px;padding:0}.checkbox_container input{display:none}.checkbox_container label,.engine_checkbox label{cursor:pointer;padding:4px 10px;margin:0;display:block;text-transform:capitalize;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.checkbox_container input[type="checkbox"]:checked+label{background:#3498db;color:#fff}.engine_checkbox{padding:4px}label.allow{background:#e74c3c;padding:4px 8px;color:#fff;display:none}label.deny{background:#2ecc71;padding:4px 8px;color:#444;display:inline}.engine_checkbox input[type="checkbox"]:checked+label:nth-child(2)+label{display:none}.engine_checkbox input[type="checkbox"]:checked+label.allow{display:inline}a{text-decoration:none;color:#1a11be}a:visited{color:#8e44ad}.result{margin:19px 0 18px 0;padding:0;clear:both}.result_title{margin-bottom:0}.result_title a{color:#2980b9;font-weight:normal;font-size:1.1em}.result_title a:hover{text-decoration:underline}.result_title a:visited{color:#8e44ad}.cache_link{font-size:10px !important}.result h3{font-size:1em;word-wrap:break-word;margin:5px 0 1px 0;padding:0}.result .content{font-size:.8em;margin:0;padding:0;max-width:54em;word-wrap:break-word;line-height:1.24}.result .content img{float:left;margin-right:5px;max-width:200px;max-height:100px}.result .content br.last{clear:both}.result .url{font-size:.8em;margin:0 0 3px 0;padding:0;max-width:54em;word-wrap:break-word;color:#c0392b}.result .published_date{font-size:.8em;color:#888;Margin:5px 20px}.result .thumbnail{width:400px}.engines{color:#888}.small_font{font-size:.8em}.small p{margin:2px 0}.right{float:right}.invisible{display:none}.left{float:left}.highlight{color:#094089}.content .highlight{color:#000}.image_result{display:inline-block;margin:10px 10px;position:relative;max-height:160px}.image_result img{border:0;max-height:160px}.image_result p{margin:0;padding:0}.image_result p span a{display:none;color:#fff}.image_result p:hover span a{display:block;position:absolute;bottom:0;right:0;padding:4px;background-color:rgba(0,0,0,0.6);font-size:.7em}.torrent_result{border-left:10px solid lightgray;padding-left:3px}.torrent_result p{margin:3px;font-size:.8em}.torrent_result a{color:#2980b9}.torrent_result a:hover{text-decoration:underline}.torrent_result a:visited{color:#8e44ad}.definition_result{border-left:10px solid gray;padding-left:3px}.percentage{position:relative;width:300px}.percentage div{background:#444}table{width:100%}td{padding:0 4px}tr:hover{background:#ddd}#results{margin:auto;padding:0;width:50em;margin-bottom:20px}#sidebar{position:fixed;bottom:10px;left:10px;margin:0 2px 5px 5px;padding:0 2px 2px 2px;width:14em}#sidebar input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}#sidebar input[type="submit"]{text-decoration:underline}#suggestions form{display:inline}#suggestions,#answers{margin-top:20px;max-width:45em}#suggestions input,#answers input,#infoboxes input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}#suggestions input[type="submit"],#answers input[type="submit"],#infoboxes input[type="submit"]{text-decoration:underline}#suggestions-title{color:#888}#answers{border:2px solid #2980b9;padding:20px}#answers form,#infoboxes form{min-width:210px}#infoboxes{position:absolute;top:100px;right:20px;margin:0 2px 5px 5px;padding:0 2px 2px;max-width:21em}#infoboxes .infobox{margin:10px 0 10px;border:1px solid #ddd;padding:5px;font-size:.8em}#infoboxes .infobox img{max-width:20em;max-heigt:12em;display:block;margin:5px;padding:5px}#infoboxes .infobox h2{margin:0}#infoboxes .infobox table{width:auto}#infoboxes .infobox table td{vertical-align:top}#infoboxes .infobox input{font-size:1em}#infoboxes .infobox br{clear:both}#search_url{margin-top:8px}#search_url input{border:1px solid #888;padding:4px;color:#444;width:14em;display:block;margin:4px;font-size:.8em}#preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none}#pagination{clear:both}#pagination br{clear:both}#apis{margin-top:8px;clear:both}#categories_container{position:relative}@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%}.github{display:none}.checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}.preferences_container{display:none;postion:fixed !important;top:100px;right:0}}@media screen and (max-width:75em){div.title h1{font-size:1em}html.touch #categories{width:95%;height:30px;text-align:left;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}html.touch #categories #categories_container{width:1000px;width:-moz-max-content;width:-webkit-max-content;width:max-content}html.touch #categories #categories_container .checkbox_container{display:inline-block;width:auto}#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto}#suggestions,#answers{margin-top:5px}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em}#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto}#sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0}#apis{display:none}#search_url{display:none}.result{border-top:1px solid #e8e7e6;margin:8px 0 8px 0}.result .thumbnail{max-width:98%}.image_result{max-width:98%}.image_result img{max-width:98%}}.favicon{float:left;margin-right:4px;margin-top:2px}.preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff}.hidden{opacity:0;overflow:hidden;font-size:.8em;position:absolute;bottom:-20px;width:100%;text-position:center;background:white;transition:opacity 1s ease}#categories_container:hover .hidden{transition:opacity 1s ease;opacity:.8} \ No newline at end of file
+.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid #f00}.highlight .k{color:#008000;font-weight:bold}.highlight .o{color:#666}.highlight .cm{color:#408080;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#408080;font-style:italic}.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:#f00}.highlight .gh{color:#000080;font-weight:bold}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:#000080;font-weight:bold}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#04d}.highlight .kc{color:#008000;font-weight:bold}.highlight .kd{color:#008000;font-weight:bold}.highlight .kn{color:#008000;font-weight:bold}.highlight .kp{color:#008000}.highlight .kr{color:#008000;font-weight:bold}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:#008000}.highlight .nc{color:#00f;font-weight:bold}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:bold}.highlight .ne{color:#d2413a;font-weight:bold}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00f;font-weight:bold}.highlight .nt{color:#008000;font-weight:bold}.highlight .nv{color:#19177c}.highlight .ow{color:#a2f;font-weight:bold}.highlight .w{color:#bbb}.highlight .mf{color:#666}.highlight .mh{color:#666}.highlight .mi{color:#666}.highlight .mo{color:#666}.highlight .sb{color:#ba2121}.highlight .sc{color:#ba2121}.highlight .sd{color:#ba2121;font-style:italic}.highlight .s2{color:#ba2121}.highlight .se{color:#b62;font-weight:bold}.highlight .sh{color:#ba2121}.highlight .si{color:#b68;font-weight:bold}.highlight .sx{color:#008000}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:#008000}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.highlight pre{overflow:auto}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.highlight .lineno::selection{background:transparent}.highlight .lineno::-moz-selection{background:transparent}html{font-family:sans-serif;font-size:.9em;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:#444;padding:0;margin:0}body,#container{padding:0;margin:0}#container{width:100%;position:absolute;top:0}.search{padding:0;margin:0}.search .checkbox_container label{font-size:.9em;border-bottom:2px solid #e8e7e6}.search .checkbox_container label:hover{border-bottom:2px solid #3498db}.search .checkbox_container input[type="checkbox"]:checked+label{border-bottom:2px solid #2980b9}#search_wrapper{position:relative;width:50em;padding:10px}.center #search_wrapper{margin-left:auto;margin-right:auto}.q{background:none repeat scroll 0 0 #fff;border:1px solid #3498db;color:#222;font-size:16px;height:28px;margin:0;outline:medium none;padding:2px;padding-left:8px;padding-right:0 !important;width:100%;z-index:2}#search_submit{position:absolute;top:13px;right:1px;padding:0;border:0;background:url('../img/search-icon.png') no-repeat;background-size:24px 24px;opacity:.8;width:24px;height:30px;font-size:0}@media screen and (max-width:50em){#search_wrapper{width:90%;clear:both;overflow:hidden}}ul.autocompleter-choices{position:absolute;margin:0;padding:0;list-style:none;border:1px solid #3498db;border-left-color:#3498db;border-right-color:#3498db;border-bottom-color:#3498db;text-align:left;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;z-index:50;background-color:#fff;color:#444}ul.autocompleter-choices li{position:relative;margin:-2px 0 0 0;padding:.2em 1.5em .2em 1em;display:block;float:none !important;cursor:pointer;font-weight:normal;white-space:nowrap;font-size:1em;line-height:1.5em}ul.autocompleter-choices li.autocompleter-selected{background-color:#444;color:#fff}ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried{color:#9fcfff}ul.autocompleter-choices span.autocompleter-queried{display:inline;float:none;font-weight:bold;margin:0;padding:0}.row{max-width:800px;margin:20px auto;text-align:justify}.row h1{font-size:3em;margin-top:50px}.row p{padding:0 10px;max-width:700px}.row h3,.row ul{margin:4px 8px}.hmarg{margin:0 20px;border:1px solid #3498db;padding:4px 10px}a:link.hmarg{color:#3498db}a:visited.hmarg{color:#3498db}a:active.hmarg{color:#3498db}a:hover.hmarg{color:#3498db}.top_margin{margin-top:60px}.center{text-align:center}h1{font-size:5em}div.title{background:url('../img/searx.png') no-repeat;width:100%;min-height:80px;background-position:center}div.title h1{visibility:hidden}input[type="submit"]{padding:2px 6px;margin:2px 4px;display:inline-block;background:#3498db;color:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0;cursor:pointer}input[type="checkbox"]{visibility:hidden}fieldset{margin:8px;border:1px solid #3498db}#categories{margin:0 10px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.checkbox_container{display:inline-block;position:relative;margin:0 3px;padding:0}.checkbox_container input{display:none}.checkbox_container label,.engine_checkbox label{cursor:pointer;padding:4px 10px;margin:0;display:block;text-transform:capitalize;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.checkbox_container input[type="checkbox"]:checked+label{background:#3498db;color:#fff}.engine_checkbox{padding:4px}label.allow{background:#e74c3c;padding:4px 8px;color:#fff;display:none}label.deny{background:#2ecc71;padding:4px 8px;color:#444;display:inline}.engine_checkbox input[type="checkbox"]:checked+label:nth-child(2)+label{display:none}.engine_checkbox input[type="checkbox"]:checked+label.allow{display:inline}a{text-decoration:none;color:#1a11be}a:visited{color:#8e44ad}.result{margin:19px 0 18px 0;padding:0;clear:both}.result_title{margin-bottom:0}.result_title a{color:#2980b9;font-weight:normal;font-size:1.1em}.result_title a:hover{text-decoration:underline}.result_title a:visited{color:#8e44ad}.cache_link{font-size:10px !important}.result h3{font-size:1em;word-wrap:break-word;margin:5px 0 1px 0;padding:0}.result .content{font-size:.8em;margin:0;padding:0;max-width:54em;word-wrap:break-word;line-height:1.24}.result .content img{float:left;margin-right:5px;max-width:200px;max-height:100px}.result .content br.last{clear:both}.result .url{font-size:.8em;margin:0 0 3px 0;padding:0;max-width:54em;word-wrap:break-word;color:#c0392b}.result .published_date{font-size:.8em;color:#888;Margin:5px 20px}.result .thumbnail{width:400px}.engines{color:#888}.small_font{font-size:.8em}.small p{margin:2px 0}.right{float:right}.invisible{display:none}.left{float:left}.highlight{color:#094089}.content .highlight{color:#000}.image_result{display:inline-block;margin:10px 10px;position:relative;max-height:160px}.image_result img{border:0;max-height:160px}.image_result p{margin:0;padding:0}.image_result p span a{display:none;color:#fff}.image_result p:hover span a{display:block;position:absolute;bottom:0;right:0;padding:4px;background-color:rgba(0,0,0,0.6);font-size:.7em}.torrent_result{border-left:10px solid lightgray;padding-left:3px}.torrent_result p{margin:3px;font-size:.8em}.torrent_result a{color:#2980b9}.torrent_result a:hover{text-decoration:underline}.torrent_result a:visited{color:#8e44ad}.definition_result{border-left:10px solid gray;padding-left:3px}.percentage{position:relative;width:300px}.percentage div{background:#444}table{width:100%}td{padding:0 4px}tr:hover{background:#ddd}#results{margin:auto;padding:0;width:50em;margin-bottom:20px}#sidebar{position:fixed;bottom:10px;left:10px;margin:0 2px 5px 5px;padding:0 2px 2px 2px;width:14em}#sidebar input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}#sidebar input[type="submit"]{text-decoration:underline}#suggestions form{display:inline}#suggestions,#answers{margin-top:20px;max-width:45em}#suggestions input,#answers input,#infoboxes input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}#suggestions input[type="submit"],#answers input[type="submit"],#infoboxes input[type="submit"]{text-decoration:underline}#suggestions-title{color:#888}#answers{border:2px solid #2980b9;padding:20px}#answers form,#infoboxes form{min-width:210px}#infoboxes{position:absolute;top:100px;right:20px;margin:0 2px 5px 5px;padding:0 2px 2px;max-width:21em;word-wrap:break-word;}#infoboxes .infobox{margin:10px 0 10px;border:1px solid #ddd;padding:5px;font-size:.8em}#infoboxes .infobox img{max-width:90%;max-heigt:12em;display:block;margin:5px;padding:5px}#infoboxes .infobox h2{margin:0}#infoboxes .infobox table{table-layout:fixed;}#infoboxes .infobox table td{vertical-align:top}#infoboxes .infobox input{font-size:1em}#infoboxes .infobox br{clear:both}#search_url{margin-top:8px}#search_url input{border:1px solid #888;padding:4px;color:#444;width:14em;display:block;margin:4px;font-size:.8em}#preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none}#pagination{clear:both}#pagination br{clear:both}#apis{margin-top:8px;clear:both}#categories_container{position:relative}@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%}.github{display:none}.checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}.preferences_container{display:none;postion:fixed !important;top:100px;right:0}}@media screen and (max-width:75em){div.title h1{font-size:1em}html.touch #categories{width:95%;height:30px;text-align:left;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}html.touch #categories #categories_container{width:1000px;width:-moz-max-content;width:-webkit-max-content;width:max-content}html.touch #categories #categories_container .checkbox_container{display:inline-block;width:auto}#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto}#suggestions,#answers{margin-top:5px}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em}#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto}#sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0}#apis{display:none}#search_url{display:none}.result{border-top:1px solid #e8e7e6;margin:8px 0 8px 0}.result .thumbnail{max-width:98%}.image_result{max-width:98%}.image_result img{max-width:98%}}.favicon{float:left;margin-right:4px;margin-top:2px}.preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff}.hidden{opacity:0;overflow:hidden;font-size:.8em;position:absolute;bottom:-20px;width:100%;text-position:center;background:white;transition:opacity 1s ease}#categories_container:hover .hidden{transition:opacity 1s ease;opacity:.8}
diff --git a/searx/static/themes/default/less/style.less b/searx/static/themes/default/less/style.less
index 575bc222c..4374f7d68 100644
--- a/searx/static/themes/default/less/style.less
+++ b/searx/static/themes/default/less/style.less
@@ -476,6 +476,7 @@ color: @color-font-light;
margin: 0px 2px 5px 5px;
padding: 0px 2px 2px;
max-width: 21em;
+ word-wrap: break-word;
.infobox {
margin: 10px 0 10px;
@@ -485,7 +486,7 @@ color: @color-font-light;
/* box-shadow: 0px 0px 5px #CCC; */
img {
- max-width: 20em;
+ max-width: 90%;
max-heigt: 12em;
display: block;
margin: 5px;
@@ -497,7 +498,7 @@ color: @color-font-light;
}
table {
- width: auto;
+ table-layout: fixed;
td {
vertical-align: top;
diff --git a/searx/static/themes/oscar/css/oscar.min.css b/searx/static/themes/oscar/css/oscar.min.css
index f7aba2bbc..60b5c3715 100644
--- a/searx/static/themes/oscar/css/oscar.min.css
+++ b/searx/static/themes/oscar/css/oscar.min.css
@@ -17,7 +17,7 @@ input[type=checkbox]:not(:checked)+.label_hide_if_not_checked,input[type=checkbo
.result_download{margin-right:5px}
#pagination{margin-top:30px;padding-bottom:50px}
.label-default{color:#aaa;background:#fff}
-.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word}
+.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word;table-layout:fixed}
.infobox .infobox_part:last-child{margin-bottom:0}
.search_categories{margin:10px 0;text-transform:capitalize}
.cursor-text{cursor:text !important}
diff --git a/searx/static/themes/oscar/less/oscar/infobox.less b/searx/static/themes/oscar/less/oscar/infobox.less
index d8f6f9264..41375f277 100644
--- a/searx/static/themes/oscar/less/oscar/infobox.less
+++ b/searx/static/themes/oscar/less/oscar/infobox.less
@@ -1,7 +1,8 @@
.infobox {
.infobox_part {
margin-bottom: 20px;
- word-wrap: break-word;
+ word-wrap: break-word;
+ table-layout: fixed;
}
.infobox_part:last-child {
diff --git a/searx/templates/courgette/opensearch.xml b/searx/templates/courgette/opensearch.xml
index b85c3a7f5..15d3eb792 100644
--- a/searx/templates/courgette/opensearch.xml
+++ b/searx/templates/courgette/opensearch.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
- <ShortName>searx</ShortName>
+ <ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/templates/default/infobox.html b/searx/templates/default/infobox.html
index 1733f7753..178a27e6d 100644
--- a/searx/templates/default/infobox.html
+++ b/searx/templates/default/infobox.html
@@ -7,7 +7,14 @@
<div class="attributes">
<table>
{% for attribute in infobox.attributes %}
- <tr><td>{{ attribute.label }}</td><td>{{ attribute.value }}</td></tr>
+ <tr>
+ <td>{{ attribute.label }}</td>
+ {% if attribute.image %}
+ <td><img src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td>
+ {% else %}
+ <td>{{ attribute.value }}</td>
+ {% endif %}
+ </tr>
{% endfor %}
</table>
</div>
diff --git a/searx/templates/default/opensearch.xml b/searx/templates/default/opensearch.xml
index b85c3a7f5..15d3eb792 100644
--- a/searx/templates/default/opensearch.xml
+++ b/searx/templates/default/opensearch.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
- <ShortName>searx</ShortName>
+ <ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html
index 9c15f5a71..4d48537e1 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -9,7 +9,7 @@
<meta name="referrer" content="no-referrer">
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" />
{% block meta %}{% endblock %}
- <title>{% block title %}{% endblock %}searx</title>
+ <title>{% block title %}{% endblock %}{{ instance_name }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/oscar.min.css') }}" type="text/css" />
@@ -31,7 +31,7 @@
{% block head %}
{% endblock %}
- <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
+ <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
<script type="text/javascript">
searx = {};
diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html
index 2abdbf0ec..d87d98453 100644
--- a/searx/templates/oscar/infobox.html
+++ b/searx/templates/oscar/infobox.html
@@ -1,6 +1,6 @@
<div class="panel panel-default infobox">
<div class="panel-heading">
- <h4 class="panel-title">{{ infobox.infobox }}</h4>
+ <h4 class="panel-title infobox_part">{{ infobox.infobox }}</h4>
</div>
<div class="panel-body">
{% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" alt="{{ infobox.infobox }}" />{% endif %}
@@ -11,7 +11,11 @@
{% for attribute in infobox.attributes %}
<tr>
<td>{{ attribute.label }}</td>
+ {% if attribute.image %}
+ <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td>
+ {% else %}
<td>{{ attribute.value }}</td>
+ {% endif %}
</tr>
{% endfor %}
</table>
diff --git a/searx/templates/oscar/navbar.html b/searx/templates/oscar/navbar.html
index 0c92b09dd..c59bcda3d 100644
--- a/searx/templates/oscar/navbar.html
+++ b/searx/templates/oscar/navbar.html
@@ -16,7 +16,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="{{ url_for('index') }}">searx</a>
+ <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a>
</div>
{% else %}
<div class="navbar-header">
@@ -26,7 +26,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="{{ url_for('index') }}">searx</a>
+ <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right"> <!-- results.html -->
diff --git a/searx/templates/oscar/opensearch.xml b/searx/templates/oscar/opensearch.xml
index b85c3a7f5..15d3eb792 100644
--- a/searx/templates/oscar/opensearch.xml
+++ b/searx/templates/oscar/opensearch.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
- <ShortName>searx</ShortName>
+ <ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index ea36a14b9..c677a0c66 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -191,10 +191,10 @@
{% for plugin in plugins %}
<div class="panel panel-default">
<div class="panel-heading">
- <h3 class="panel-title">{{ plugin.name }}</h3>
+ <h3 class="panel-title">{{ _(plugin.name) }}</h3>
</div>
<div class="panel-body">
- <div class="col-xs-6 col-sm-4 col-md-6">{{ plugin.description }}</div>
+ <div class="col-xs-6 col-sm-4 col-md-6">{{ _(plugin.description) }}</div>
<div class="col-xs-6 col-sm-4 col-md-6">
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
</div>
diff --git a/searx/testing.py b/searx/testing.py
index e22ecf8fe..312e9f295 100644
--- a/searx/testing.py
+++ b/searx/testing.py
@@ -3,6 +3,7 @@
from plone.testing import Layer
from unittest2 import TestCase
+from os.path import dirname, join, abspath
import os
@@ -42,11 +43,11 @@ class SearxRobotLayer(Layer):
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'webapp.py'
)
- exe = os.path.abspath(os.path.dirname(__file__) + '/../bin/py')
+ exe = 'python'
# set robot settings path
- os.environ['SEARX_SETTINGS_PATH'] = os.path.abspath(
- os.path.dirname(__file__) + '/settings_robot.yml')
+ os.environ['SEARX_SETTINGS_PATH'] = abspath(
+ dirname(__file__) + '/settings_robot.yml')
# run the server
self.server = subprocess.Popen(
@@ -56,7 +57,7 @@ class SearxRobotLayer(Layer):
)
def tearDown(self):
- os.kill(self.server.pid, 15)
+ os.kill(self.server.pid, 9)
# remove previously set environment variable
del os.environ['SEARX_SETTINGS_PATH']
@@ -68,3 +69,20 @@ class SearxTestCase(TestCase):
"""Base test case for non-robot tests."""
layer = SearxTestLayer
+
+
+if __name__ == '__main__':
+ from tests.test_robot import test_suite
+ import sys
+ from zope.testrunner.runner import Runner
+
+ base_dir = abspath(join(dirname(__file__), '../tests'))
+ if sys.argv[1] == 'robot':
+ r = Runner(['--color',
+ '--auto-progress',
+ '--stop-on-error',
+ '--path',
+ base_dir],
+ found_suites=[test_suite()])
+ r.run()
+ sys.exit(int(r.failed))
diff --git a/searx/tests/__init__.py b/searx/tests/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/searx/tests/__init__.py
+++ /dev/null
diff --git a/searx/tests/engines/__init__.py b/searx/tests/engines/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/searx/tests/engines/__init__.py
+++ /dev/null
diff --git a/searx/tests/engines/test_bing.py b/searx/tests/engines/test_bing.py
deleted file mode 100644
index bce221440..000000000
--- a/searx/tests/engines/test_bing.py
+++ /dev/null
@@ -1,90 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import bing
-from searx.testing import SearxTestCase
-
-
-class TestBingEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
- params = bing.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('bing.com' in params['url'])
- self.assertTrue('SRCHHPGUSR' in params['cookies'])
- self.assertTrue('fr' in params['cookies']['SRCHHPGUSR'])
-
- dicto['language'] = 'all'
- params = bing.request(query, dicto)
- self.assertTrue('SRCHHPGUSR' in params['cookies'])
- self.assertTrue('en' in params['cookies']['SRCHHPGUSR'])
-
- def test_response(self):
- self.assertRaises(AttributeError, bing.response, None)
- self.assertRaises(AttributeError, bing.response, [])
- self.assertRaises(AttributeError, bing.response, '')
- self.assertRaises(AttributeError, bing.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(bing.response(response), [])
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(bing.response(response), [])
-
- html = """
- <div class="sa_cc" u="0|5109|4755453613245655|UAGjXgIrPH5yh-o5oNHRx_3Zta87f_QO">
- <div Class="sa_mc">
- <div class="sb_tlst">
- <h3>
- <a href="http://this.should.be.the.link/" h="ID=SERP,5124.1">
- <strong>This</strong> should be the title</a>
- </h3>
- </div>
- <div class="sb_meta"><cite><strong>this</strong>.meta.com</cite>
- <span class="c_tlbxTrg">
- <span class="c_tlbxH" H="BASE:CACHEDPAGEDEFAULT" K="SERP,5125.1">
- </span>
- </span>
- </div>
- <p><strong>This</strong> should be the content.</p>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = bing.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
-
- html = """
- <li class="b_algo" u="0|5109|4755453613245655|UAGjXgIrPH5yh-o5oNHRx_3Zta87f_QO">
- <div Class="sa_mc">
- <div class="sb_tlst">
- <h2>
- <a href="http://this.should.be.the.link/" h="ID=SERP,5124.1">
- <strong>This</strong> should be the title</a>
- </h2>
- </div>
- <div class="sb_meta"><cite><strong>this</strong>.meta.com</cite>
- <span class="c_tlbxTrg">
- <span class="c_tlbxH" H="BASE:CACHEDPAGEDEFAULT" K="SERP,5125.1">
- </span>
- </span>
- </div>
- <p><strong>This</strong> should be the content.</p>
- </div>
- </li>
- """
- response = mock.Mock(text=html)
- results = bing.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
diff --git a/searx/tests/engines/test_bing_images.py b/searx/tests/engines/test_bing_images.py
deleted file mode 100644
index f42dff7e8..000000000
--- a/searx/tests/engines/test_bing_images.py
+++ /dev/null
@@ -1,269 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import bing_images
-from searx.testing import SearxTestCase
-
-
-class TestBingImagesEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- dicto['safesearch'] = 1
- params = bing_images.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('bing.com' in params['url'])
- self.assertTrue('SRCHHPGUSR' in params['cookies'])
- self.assertTrue('fr' in params['cookies']['SRCHHPGUSR'])
-
- dicto['language'] = 'all'
- params = bing_images.request(query, dicto)
- self.assertIn('SRCHHPGUSR', params['cookies'])
- self.assertIn('en', params['cookies']['SRCHHPGUSR'])
-
- def test_response(self):
- self.assertRaises(AttributeError, bing_images.response, None)
- self.assertRaises(AttributeError, bing_images.response, [])
- self.assertRaises(AttributeError, bing_images.response, '')
- self.assertRaises(AttributeError, bing_images.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(bing_images.response(response), [])
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(bing_images.response(response), [])
-
- html = """
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- """
- html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
- response = mock.Mock(text=html)
- results = bing_images.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Test Query')
- self.assertEqual(results[0]['url'], 'http://www.page.url/')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['thumbnail_src'], 'https://www.bing.com/th?id=HN.608003696942779811')
- self.assertEqual(results[0]['img_src'], 'http://test.url/Test%20Query.jpg')
-
- html = """
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
- mid:&quot;59EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
- surl:&quot;http://www.page.url/&quot;,
- imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,oh:&quot;238&quot;,
- tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- """
- response = mock.Mock(text=html)
- results = bing_images.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- html = """
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- <div class="dg_u" style="width:178px;height:144px;left:17px;top:0px">
- <a href="#" ihk="HN.608003696942779811"
- m="{ns:&quot;images&quot;,k:&quot;5045&quot;,
-mid:&quot;659EB92C317974F34517A1CCAEBEF76A578E08DEE&quot;,
-surl:&quot;http://www.page.url/&quot;,imgurl:&quot;http://test.url/Test%20Query.jpg&quot;,
-oh:&quot;238&quot;,tft:&quot;0&quot;,oi:&quot;http://www.image.url/Images/Test%20Query.jpg&quot;}"
- mid="59EB92C317974F34517A1CCAEBEF76A578E08DEE" onclick="return false;"
- t1="Test Query" t2="650 x 517 · 31 kB · jpeg" t3="www.short.url" h="ID=images,5045.1">
- <img src="https://tse4.mm.bing.net/th?id=HN.608003696942779811&amp;o=4&amp;pid=1.7"
- style="height:144px;" width="178" height="144"/>
- </a>
- </div>
- """
- html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
- response = mock.Mock(text=html)
- results = bing_images.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 10)
diff --git a/searx/tests/engines/test_bing_news.py b/searx/tests/engines/test_bing_news.py
deleted file mode 100644
index a64d59b7b..000000000
--- a/searx/tests/engines/test_bing_news.py
+++ /dev/null
@@ -1,138 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import bing_news
-from searx.testing import SearxTestCase
-import lxml
-
-
-class TestBingNewsEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = bing_news.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('bing.com', params['url'])
- self.assertIn('fr', params['url'])
-
- dicto['language'] = 'all'
- params = bing_news.request(query, dicto)
- self.assertIn('en', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, bing_news.response, None)
- self.assertRaises(AttributeError, bing_news.response, [])
- self.assertRaises(AttributeError, bing_news.response, '')
- self.assertRaises(AttributeError, bing_news.response, '[]')
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(bing_news.response(response), [])
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(bing_news.response(response), [])
-
- html = """<?xml version="1.0" encoding="utf-8" ?>
-<rss version="2.0" xmlns:News="https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS">
- <channel>
- <title>python - Bing News</title>
- <link>https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- <description>Search results</description>
- <image>
- <url>http://10.53.64.9/rsslogo.gif</url>
- <title>test</title>
- <link>https://www.bing.com:443/news/search?q=test&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- </image>
- <copyright>Copyright</copyright>
- <item>
- <title>Title</title>
- <link>https://www.bing.com/news/apiclick.aspx?ref=FexRss&amp;aid=&amp;tid=c237eccc50bd4758b106a5e3c94fce09&amp;url=http%3a%2f%2furl.of.article%2f&amp;c=xxxxxxxxx&amp;mkt=en-us</link>
- <description>Article Content</description>
- <pubDate>Tue, 02 Jun 2015 13:37:00 GMT</pubDate>
- <News:Source>Infoworld</News:Source>
- <News:Image>http://a1.bing4.com/th?id=ON.13371337133713371337133713371337&amp;pid=News</News:Image>
- <News:ImageSize>w={0}&amp;h={1}&amp;c=7</News:ImageSize>
- <News:ImageKeepOriginalRatio></News:ImageKeepOriginalRatio>
- <News:ImageMaxWidth>620</News:ImageMaxWidth>
- <News:ImageMaxHeight>413</News:ImageMaxHeight>
- </item>
- <item>
- <title>Another Title</title>
- <link>https://www.bing.com/news/apiclick.aspx?ref=FexRss&amp;aid=&amp;tid=c237eccc50bd4758b106a5e3c94fce09&amp;url=http%3a%2f%2fanother.url.of.article%2f&amp;c=xxxxxxxxx&amp;mkt=en-us</link>
- <description>Another Article Content</description>
- <pubDate>Tue, 02 Jun 2015 13:37:00 GMT</pubDate>
- </item>
- </channel>
-</rss>""" # noqa
- response = mock.Mock(content=html)
- results = bing_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 2)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://url.of.article/')
- self.assertEqual(results[0]['content'], 'Article Content')
- self.assertEqual(results[0]['thumbnail'], 'https://www.bing.com/th?id=ON.13371337133713371337133713371337')
- self.assertEqual(results[1]['title'], 'Another Title')
- self.assertEqual(results[1]['url'], 'http://another.url.of.article/')
- self.assertEqual(results[1]['content'], 'Another Article Content')
- self.assertNotIn('thumbnail', results[1])
-
- html = """<?xml version="1.0" encoding="utf-8" ?>
-<rss version="2.0" xmlns:News="https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS">
- <channel>
- <title>python - Bing News</title>
- <link>https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- <description>Search results</description>
- <image>
- <url>http://10.53.64.9/rsslogo.gif</url>
- <title>test</title>
- <link>https://www.bing.com:443/news/search?q=test&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- </image>
- <copyright>Copyright</copyright>
- <item>
- <title>Title</title>
- <link>http://another.url.of.article/</link>
- <description>Article Content</description>
- <pubDate>garbage</pubDate>
- <News:Source>Infoworld</News:Source>
- <News:Image>http://another.bing.com/image</News:Image>
- <News:ImageSize>w={0}&amp;h={1}&amp;c=7</News:ImageSize>
- <News:ImageKeepOriginalRatio></News:ImageKeepOriginalRatio>
- <News:ImageMaxWidth>620</News:ImageMaxWidth>
- <News:ImageMaxHeight>413</News:ImageMaxHeight>
- </item>
- </channel>
-</rss>""" # noqa
- response = mock.Mock(content=html)
- results = bing_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://another.url.of.article/')
- self.assertEqual(results[0]['content'], 'Article Content')
- self.assertEqual(results[0]['thumbnail'], 'http://another.bing.com/image')
-
- html = """<?xml version="1.0" encoding="utf-8" ?>
-<rss version="2.0" xmlns:News="https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS">
- <channel>
- <title>python - Bing News</title>
- <link>https://www.bing.com:443/news/search?q=python&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- <description>Search results</description>
- <image>
- <url>http://10.53.64.9/rsslogo.gif</url>
- <title>test</title>
- <link>https://www.bing.com:443/news/search?q=test&amp;setmkt=en-US&amp;first=1&amp;format=RSS</link>
- </image>
- </channel>
-</rss>""" # noqa
-
- response = mock.Mock(content=html)
- results = bing_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- html = """<?xml version="1.0" encoding="utf-8" ?>gabarge"""
- response = mock.Mock(content=html)
- self.assertRaises(lxml.etree.XMLSyntaxError, bing_news.response, response)
diff --git a/searx/tests/engines/test_blekko_images.py b/searx/tests/engines/test_blekko_images.py
deleted file mode 100644
index beb0853e3..000000000
--- a/searx/tests/engines/test_blekko_images.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import blekko_images
-from searx.testing import SearxTestCase
-
-
-class TestBlekkoImagesEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['safesearch'] = 1
- params = blekko_images.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('blekko.com', params['url'])
- self.assertIn('page', params['url'])
-
- dicto['pageno'] = 1
- params = blekko_images.request(query, dicto)
- self.assertNotIn('page', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, blekko_images.response, None)
- self.assertRaises(AttributeError, blekko_images.response, [])
- self.assertRaises(AttributeError, blekko_images.response, '')
- self.assertRaises(AttributeError, blekko_images.response, '[]')
-
- response = mock.Mock(text='[]')
- self.assertEqual(blekko_images.response(response), [])
-
- json = """
- [
- {
- "c": 1,
- "page_url": "http://result_url.html",
- "title": "Photo title",
- "tn_url": "http://ts1.mm.bing.net/th?id=HN.608050619474382748&pid=15.1",
- "url": "http://result_image.jpg"
- },
- {
- "c": 2,
- "page_url": "http://companyorange.simpsite.nl/OSM",
- "title": "OSM",
- "tn_url": "http://ts2.mm.bing.net/th?id=HN.608048068264919461&pid=15.1",
- "url": "http://simpsite.nl/userdata2/58985/Home/OSM.bmp"
- },
- {
- "c": 3,
- "page_url": "http://invincible.webklik.nl/page/osm",
- "title": "OSM",
- "tn_url": "http://ts1.mm.bing.net/th?id=HN.608024514657649476&pid=15.1",
- "url": "http://www.webklik.nl/user_files/2009_09/65324/osm.gif"
- },
- {
- "c": 4,
- "page_url": "http://www.offshorenorway.no/event/companyDetail/id/12492",
- "title": "Go to OSM Offshore AS homepage",
- "tn_url": "http://ts2.mm.bing.net/th?id=HN.608054265899847285&pid=15.1",
- "url": "http://www.offshorenorway.no/firmalogo/OSM-logo.png"
- }
- ]
- """
- response = mock.Mock(text=json)
- results = blekko_images.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 4)
- self.assertEqual(results[0]['title'], 'Photo title')
- self.assertEqual(results[0]['url'], 'http://result_url.html')
- self.assertEqual(results[0]['img_src'], 'http://result_image.jpg')
diff --git a/searx/tests/engines/test_btdigg.py b/searx/tests/engines/test_btdigg.py
deleted file mode 100644
index 2721f4e7c..000000000
--- a/searx/tests/engines/test_btdigg.py
+++ /dev/null
@@ -1,384 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import btdigg
-from searx.testing import SearxTestCase
-
-
-class TestBtdiggEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = btdigg.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('btdigg.org', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, btdigg.response, None)
- self.assertRaises(AttributeError, btdigg.response, [])
- self.assertRaises(AttributeError, btdigg.response, '')
- self.assertRaises(AttributeError, btdigg.response, '[]')
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(btdigg.response(response), [])
-
- html = """
- <div id="search_res">
- <table>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">8 B</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">710</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">5</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- </table>
- </div>
- """
- response = mock.Mock(content=html)
- results = btdigg.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Should be the title')
- self.assertEqual(results[0]['url'], 'https://btdigg.org/url')
- self.assertEqual(results[0]['content'], 'Content')
- self.assertEqual(results[0]['seed'], 5)
- self.assertEqual(results[0]['leech'], 0)
- self.assertEqual(results[0]['filesize'], 8)
- self.assertEqual(results[0]['files'], 710)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:magnet&dn=Test')
-
- html = """
- <div id="search_res">
- <table>
- </table>
- </div>
- """
- response = mock.Mock(content=html)
- results = btdigg.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- html = """
- <div id="search_res">
- <table>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">1 KB</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">710</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">5</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">1 MB</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">a</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">4</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">1 GB</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">710</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">3</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">1 TB</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">710</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">2</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- <tr>
- <td class="idx">1</td>
- <td>
- <table class="torrent_name_tbl">
- <tr>
- <td class="torrent_name">
- <a href="/url">Should be the title</a>
- </td>
- </tr>
- </table>
- <table class="torrent_name_tbl">
- <tr>
- <td class="ttth">
- <a onclick="fclck(this.href)" href="magnet:?xt=urn:btih:magnet&amp;dn=Test"
- title="Télécharger des liens Magnet">[magnet]</a>
- </td>
- <td class="ttth">
- <a href="https://btcloud.io/manager?cmd=add&amp;info_hash=hash"
- target="_blank" title="Ajouter à BTCloud">[cloud]</a>
- </td>
- <td>
- <span class="attr_name">Taille:</span>
- <span class="attr_val">a TB</span>
- </td>
- <td>
- <span class="attr_name">Fichiers:</span>
- <span class="attr_val">710</span>
- </td>
- <td>
- <span class="attr_name">Téléchargements:</span>
- <span class="attr_val">z</span>
- </td>
- <td>
- <span class="attr_name">Temps:</span>
- <span class="attr_val">417.8&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Dernière&nbsp;mise&nbsp;à&nbsp;jour:</span>
- <span class="attr_val">5.3&nbsp;jours</span>
- </td>
- <td>
- <span class="attr_name">Faux:</span>
- <span class="attr_val">Aucun</span>
- </td>
- </tr>
- </table>
- <pre class="snippet">
- Content
- </pre>
- </td>
- </tr>
- </table>
- </div>
- """
- response = mock.Mock(content=html)
- results = btdigg.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 5)
- self.assertEqual(results[0]['title'], 'Should be the title')
- self.assertEqual(results[0]['url'], 'https://btdigg.org/url')
- self.assertEqual(results[0]['content'], 'Content')
- self.assertEqual(results[0]['seed'], 5)
- self.assertEqual(results[0]['leech'], 0)
- self.assertEqual(results[0]['files'], 710)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:magnet&dn=Test')
- self.assertEqual(results[0]['filesize'], 1024)
- self.assertEqual(results[1]['filesize'], 1048576)
- self.assertEqual(results[2]['filesize'], 1073741824)
- self.assertEqual(results[3]['filesize'], 1099511627776)
diff --git a/searx/tests/engines/test_currency_convert.py b/searx/tests/engines/test_currency_convert.py
deleted file mode 100644
index 84ec3b742..000000000
--- a/searx/tests/engines/test_currency_convert.py
+++ /dev/null
@@ -1,46 +0,0 @@
-from collections import defaultdict
-from datetime import datetime
-import mock
-from searx.engines import currency_convert
-from searx.testing import SearxTestCase
-
-
-class TestCurrencyConvertEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = currency_convert.request(query, dicto)
- self.assertNotIn('url', params)
-
- query = '1.1.1 EUR in USD'
- params = currency_convert.request(query, dicto)
- self.assertNotIn('url', params)
-
- query = '10 eur in usd'
- params = currency_convert.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn('finance.yahoo.com', params['url'])
- self.assertIn('EUR', params['url'])
- self.assertIn('USD', params['url'])
-
- def test_response(self):
- dicto = defaultdict(dict)
- dicto['ammount'] = float(10)
- dicto['from'] = "EUR"
- dicto['to'] = "USD"
- dicto['from_name'] = "euro"
- dicto['to_name'] = "United States dollar"
- response = mock.Mock(text='a,b,c,d', search_params=dicto)
- self.assertEqual(currency_convert.response(response), [])
-
- csv = "2,0.5,1"
- response = mock.Mock(text=csv, search_params=dicto)
- results = currency_convert.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['answer'], '10.0 EUR = 5.0 USD, 1 EUR (euro) = 0.5 USD (United States dollar)')
- now_date = datetime.now().strftime('%Y%m%d')
- self.assertEqual(results[0]['url'], 'https://finance.yahoo.com/currency/converter-results/' +
- now_date + '/10.0-eur-to-usd.html')
diff --git a/searx/tests/engines/test_dailymotion.py b/searx/tests/engines/test_dailymotion.py
deleted file mode 100644
index 4c31ff5d5..000000000
--- a/searx/tests/engines/test_dailymotion.py
+++ /dev/null
@@ -1,74 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import dailymotion
-from searx.testing import SearxTestCase
-
-
-class TestDailymotionEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
- params = dailymotion.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('dailymotion.com' in params['url'])
- self.assertTrue('fr' in params['url'])
-
- dicto['language'] = 'all'
- params = dailymotion.request(query, dicto)
- self.assertTrue('en' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, dailymotion.response, None)
- self.assertRaises(AttributeError, dailymotion.response, [])
- self.assertRaises(AttributeError, dailymotion.response, '')
- self.assertRaises(AttributeError, dailymotion.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(dailymotion.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(dailymotion.response(response), [])
-
- json = """
- {
- "page": 1,
- "limit": 5,
- "explicit": false,
- "total": 289487,
- "has_more": true,
- "list": [
- {
- "created_time": 1422173451,
- "title": "Title",
- "description": "Description",
- "duration": 81,
- "url": "http://www.url",
- "thumbnail_360_url": "http://thumbnail",
- "id": "x2fit7q"
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = dailymotion.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://www.url')
- self.assertEqual(results[0]['content'], 'Description')
- self.assertIn('x2fit7q', results[0]['embedded'])
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.dailymotion.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = dailymotion.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_deezer.py b/searx/tests/engines/test_deezer.py
deleted file mode 100644
index ad09d2a2c..000000000
--- a/searx/tests/engines/test_deezer.py
+++ /dev/null
@@ -1,57 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import deezer
-from searx.testing import SearxTestCase
-
-
-class TestDeezerEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = deezer.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('deezer.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, deezer.response, None)
- self.assertRaises(AttributeError, deezer.response, [])
- self.assertRaises(AttributeError, deezer.response, '')
- self.assertRaises(AttributeError, deezer.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(deezer.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(deezer.response(response), [])
-
- json = """
- {"data":[
- {"id":100, "title":"Title of track",
- "link":"https:\/\/www.deezer.com\/track\/1094042","duration":232,
- "artist":{"id":200,"name":"Artist Name",
- "link":"https:\/\/www.deezer.com\/artist\/1217","type":"artist"},
- "album":{"id":118106,"title":"Album Title","type":"album"},"type":"track"}
- ]}
- """
- response = mock.Mock(text=json)
- results = deezer.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title of track')
- self.assertEqual(results[0]['url'], 'https://www.deezer.com/track/1094042')
- self.assertEqual(results[0]['content'], 'Artist Name &bull; Album Title &bull; Title of track')
- self.assertTrue('100' in results[0]['embedded'])
-
- json = """
- {"data":[
- {"id":200,"name":"Artist Name",
- "link":"https:\/\/www.deezer.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = deezer.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_deviantart.py b/searx/tests/engines/test_deviantart.py
deleted file mode 100644
index 78a391334..000000000
--- a/searx/tests/engines/test_deviantart.py
+++ /dev/null
@@ -1,118 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import deviantart
-from searx.testing import SearxTestCase
-
-
-class TestDeviantartEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = deviantart.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('deviantart.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, deviantart.response, None)
- self.assertRaises(AttributeError, deviantart.response, [])
- self.assertRaises(AttributeError, deviantart.response, '')
- self.assertRaises(AttributeError, deviantart.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(deviantart.response(response), [])
-
- response = mock.Mock(status_code=302)
- self.assertEqual(deviantart.response(response), [])
-
- html = """
- <div class="tt-a tt-fh tt-boxed" collect_rid="1:149167425"
- usericon="http://a.deviantart.net/avatars/t/e/test-0.gif" userid="233301"
- username="test-0" symbol="~" category="digitalart/animation">
- <span class="tt-w" style="width: auto; max-width: 277px;">
- <span class="tt-fh-tc" style="width: 202px;">
- <span class="tt-bb" style="width: 202px;">
- </span>
- <span class="shadow">
- <a class="thumb" href="http://url.of.result/2nd.part.of.url"
- title="Behoimi BE Animation Test by test-0, Jan 4,
- 2010 in Digital Art &gt; Animation"> <i></i>
- <img width="200" height="200" alt="Test"
- src="http://url.of.thumbnail" data-src="http://th08.deviantart.net/test.jpg">
- </a>
- </span>
- <!-- ^TTT -->
- </span>
- <span class="details">
- <a href="http://test-0.deviantart.com/art/Test" class="t"
- title="Behoimi BE Animation Test by test-0, Jan 4, 2010">
- <span class="tt-fh-oe">Title of image</span> </a>
- <small>
- <span class="category">
- <span class="age">
- 5 years ago
- </span>
- in <a title="Behoimi BE Animation Test by test-0, Jan 4, 2010"
- href="http://www.deviantart.com/browse/all/digitalart/animation/">Animation</a>
- </span>
- <div class="commentcount">
- <a href="http://test-0.deviantart.com/art/Test#comments">
- <span class="iconcommentsstats"></span>9 Comments</a>
- </div>
- <a class="mlt-link" href="http://www.deviantart.com/morelikethis/149167425">
- <span class="mlt-icon"></span> <span class="mlt-text">More Like This</span> </a>
- </span>
- </small> <!-- TTT$ -->
- </span>
- </div>
- """
- response = mock.Mock(text=html)
- results = deviantart.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title of image')
- self.assertEqual(results[0]['url'], 'http://url.of.result/2nd.part.of.url')
- self.assertNotIn('content', results[0])
- self.assertEqual(results[0]['thumbnail_src'], 'https://url.of.thumbnail')
-
- html = """
- <span class="tt-fh-tc" style="width: 202px;">
- <span class="tt-bb" style="width: 202px;">
- </span>
- <span class="shadow">
- <a class="thumb" href="http://url.of.result/2nd.part.of.url"
- title="Behoimi BE Animation Test by test-0, Jan 4,
- 2010 in Digital Art &gt; Animation"> <i></i>
- <img width="200" height="200" alt="Test"
- src="http://url.of.thumbnail" data-src="http://th08.deviantart.net/test.jpg">
- </a>
- </span>
- <!-- ^TTT -->
- </span>
- <span class="details">
- <a href="http://test-0.deviantart.com/art/Test" class="t"
- title="Behoimi BE Animation Test by test-0, Jan 4, 2010">
- <span class="tt-fh-oe">Title of image</span> </a>
- <small>
- <span class="category">
- <span class="age">
- 5 years ago
- </span>
- in <a title="Behoimi BE Animation Test by test-0, Jan 4, 2010"
- href="http://www.deviantart.com/browse/all/digitalart/animation/">Animation</a>
- </span>
- <div class="commentcount">
- <a href="http://test-0.deviantart.com/art/Test#comments">
- <span class="iconcommentsstats"></span>9 Comments</a>
- </div>
- <a class="mlt-link" href="http://www.deviantart.com/morelikethis/149167425">
- <span class="mlt-icon"></span> <span class="mlt-text">More Like This</span> </a>
- </span>
- </small> <!-- TTT$ -->
- """
- response = mock.Mock(text=html)
- results = deviantart.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_digg.py b/searx/tests/engines/test_digg.py
deleted file mode 100644
index 6e7c9cc99..000000000
--- a/searx/tests/engines/test_digg.py
+++ /dev/null
@@ -1,101 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import digg
-from searx.testing import SearxTestCase
-
-
-class TestDiggEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = digg.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('digg.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, digg.response, None)
- self.assertRaises(AttributeError, digg.response, [])
- self.assertRaises(AttributeError, digg.response, '')
- self.assertRaises(AttributeError, digg.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(digg.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(digg.response(response), [])
-
- json = """
- {
- "status": "ok",
- "num": 10,
- "next_position": 20,
- "html": "<article itemscope itemtype=\\"http://schema.org/Article\\"
- class=\\"story-container digg-story-el hentry entry story-1sRANah col-1\\"
- data-content-id=\\"1sRANah\\" data-contenturl=\\"http://url.of.link\\"
- data-position=\\"0\\" data-diggs=\\"24\\" data-tweets=\\"69\\"
- data-digg-score=\\"1190\\"> <div class=\\"story-image story-image-thumb\\">
- <a data-position=\\"0\\" data-content-id=\\"1sRANah\\"
- class=\\"story-link\\" href=\\"http://www.thedailybeast.com/\\"
- target=\\"_blank\\"><img class=\\"story-image-img\\"
- src=\\"http://url.of.image.jpeg\\" width=\\"312\\" height=\\"170\\"
- alt=\\"\\" /> </a> </div> <div class=\\"story-content\\"><header
- class=\\"story-header\\"> <div itemprop=\\"alternativeHeadline\\"
- class=\\"story-kicker\\" >Kicker</div> <h2 itemprop=\\"headline\\"
- class=\\"story-title entry-title\\"><a class=\\"story-title-link story-link\\"
- rel=\\"bookmark\\" itemprop=\\"url\\" href=\\"http://www.thedailybeast.com/\\"
- target=\\"_blank\\">Title of article</h2> <div class=\\"story-meta\\">
- <div class=\\"story-score \\">
- <div class=\\"story-score-diggscore diggscore-1sRANah\\">1190</div>
- <div class=\\"story-score-details\\"> <div class=\\"arrow\\"></div>
- <ul class=\\"story-score-details-list\\"> <li
- class=\\"story-score-detail story-score-diggs\\"><span
- class=\\"label\\">Diggs:</span> <span class=\\"count diggs-1sRANah\\">24</span>
- </li> <li class=\\"story-score-detail story-score-twitter\\"><span
- class=\\"label\\">Tweets:</span> <span class=\\"count tweets-1sRANah\\">69</span>
- </li> <li class=\\"story-score-detail story-score-facebook\\"><span
- class=\\"label\\">Facebook Shares:</span> <span
- class=\\"count fb_shares-1sRANah\\">1097</span></li> </ul> </div> </div>
- <span class=\\"story-meta-item story-source\\"> <a
- itemprop=\\"publisher copyrightHolder sourceOrganization provider\\"
- class=\\"story-meta-item-link story-source-link\\"
- href=\\"/source/thedailybeast.com\\">The Daily Beast </a> </span>
- <span class=\\"story-meta-item story-tag first-tag\\"> <a
- itemprop=\\"keywords\\" rel=\\"tag\\"
- class=\\"story-meta-item-link story-tag-link\\" href=\\"/tag/news\\">News</a>
- </span> <abbr class=\\"published story-meta-item story-timestamp\\"
- title=\\"2014-10-18 14:53:45\\"> <time datetime=\\"2014-10-18 14:53:45\\">18 Oct 2014</time>
- </abbr> </div> </header> </div> <ul class=\\"story-actions\\"> <li
- class=\\"story-action story-action-digg btn-story-action-container\\">
- <a class=\\"target digg-1sRANah\\" href=\\"#\\">Digg</a></li> <li
- class=\\"story-action story-action-save btn-story-action-container\\">
- <a class=\\"target save-1sRANah\\" href=\\"#\\">Save</a></li> <li
- class=\\"story-action story-action-share\\"><a
- class=\\"target share-facebook\\" href=\\"https://www.facebook.com/\\">Facebook</a></li>
- <li class=\\"story-action story-action-share\\"><a class=\\"target share-twitter\\"
- href=\\"https://twitter.com/\\">Twitter</a></li> </ul> </article>"
- }
- """
- json = json.replace('\r\n', '').replace('\n', '').replace('\r', '')
- response = mock.Mock(text=json)
- results = digg.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title of article')
- self.assertEqual(results[0]['url'], 'http://url.of.link')
- self.assertEqual(results[0]['thumbnail'], 'http://url.of.image.jpeg')
- self.assertEqual(results[0]['content'], '')
-
- json = """
- {
- "status": "error",
- "num": 10,
- "next_position": 20
- }
- """
- response = mock.Mock(text=json)
- results = digg.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_duckduckgo.py b/searx/tests/engines/test_duckduckgo.py
deleted file mode 100644
index 14cd9cd87..000000000
--- a/searx/tests/engines/test_duckduckgo.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import duckduckgo
-from searx.testing import SearxTestCase
-
-
-class TestDuckduckgoEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = duckduckgo.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('duckduckgo.com', params['url'])
- self.assertIn('fr-fr', params['url'])
-
- dicto['language'] = 'all'
- params = duckduckgo.request(query, dicto)
- self.assertIn('en-us', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, duckduckgo.response, None)
- self.assertRaises(AttributeError, duckduckgo.response, [])
- self.assertRaises(AttributeError, duckduckgo.response, '')
- self.assertRaises(AttributeError, duckduckgo.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(duckduckgo.response(response), [])
-
- html = u"""
- <div class="results_links results_links_deep web-result">
- <div class="icon_fav" style="display: block;">
- <a rel="nofollow" href="https://www.test.com/">
- <img width="16" height="16" alt=""
- src="/i/www.test.com.ico" style="visibility: visible;" name="i15" />
- </a>
- </div>
- <div class="links_main links_deep"> <!-- This is the visible part -->
- <a rel="nofollow" class="large" href="http://this.should.be.the.link/ű">
- This <b>is</b> <b>the</b> title
- </a>
- <div class="snippet"><b>This</b> should be the content.</div>
- <div class="url">
- http://this.should.be.the.link/
- </div>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = duckduckgo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], u'http://this.should.be.the.link/ű')
- self.assertEqual(results[0]['content'], 'This should be the content.')
-
- html = """
- <div class="results_links results_links_deep web-result">
- <div class="icon_fav" style="display: block;">
- </div>
- <div class="links_main links_deep"> <!-- This is the visible part -->
- <div class="snippet"><b>This</b> should be the content.</div>
- <div class="url">
- http://this.should.be.the.link/
- </div>
- </div>
- </div>
- <div class="results_links results_links_deep web-result">
- <div class="icon_fav" style="display: block;">
- <img width="16" height="16" alt=""
- src="/i/www.test.com.ico" style="visibility: visible;" name="i15" />
- </div>
- <div class="links_main links_deep"> <!-- This is the visible part -->
- <a rel="nofollow" class="large" href="">
- This <b>is</b> <b>the</b> title
- </a>
- <div class="snippet"><b>This</b> should be the content.</div>
- <div class="url">
- http://this.should.be.the.link/
- </div>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = duckduckgo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_duckduckgo_definitions.py b/searx/tests/engines/test_duckduckgo_definitions.py
deleted file mode 100644
index 71c84235c..000000000
--- a/searx/tests/engines/test_duckduckgo_definitions.py
+++ /dev/null
@@ -1,250 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import duckduckgo_definitions
-from searx.testing import SearxTestCase
-
-
-class TestDDGDefinitionsEngine(SearxTestCase):
-
- def test_result_to_text(self):
- url = ''
- text = 'Text'
- html_result = 'Html'
- result = duckduckgo_definitions.result_to_text(url, text, html_result)
- self.assertEqual(result, text)
-
- html_result = '<a href="url">Text in link</a>'
- result = duckduckgo_definitions.result_to_text(url, text, html_result)
- self.assertEqual(result, 'Text in link')
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = duckduckgo_definitions.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('duckduckgo.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, duckduckgo_definitions.response, None)
- self.assertRaises(AttributeError, duckduckgo_definitions.response, [])
- self.assertRaises(AttributeError, duckduckgo_definitions.response, '')
- self.assertRaises(AttributeError, duckduckgo_definitions.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(duckduckgo_definitions.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(duckduckgo_definitions.response(response), [])
-
- json = """
- {
- "DefinitionSource": "definition source",
- "Heading": "heading",
- "ImageWidth": 0,
- "RelatedTopics": [
- {
- "Result": "Top-level domains",
- "Icon": {
- "URL": "",
- "Height": "",
- "Width": ""
- },
- "FirstURL": "https://first.url",
- "Text": "text"
- },
- {
- "Topics": [
- {
- "Result": "result topic",
- "Icon": {
- "URL": "",
- "Height": "",
- "Width": ""
- },
- "FirstURL": "https://duckduckgo.com/?q=2%2F2",
- "Text": "result topic text"
- }
- ],
- "Name": "name"
- }
- ],
- "Entity": "Entity",
- "Type": "A",
- "Redirect": "",
- "DefinitionURL": "http://definition.url",
- "AbstractURL": "https://abstract.url",
- "Definition": "this is the definition",
- "AbstractSource": "abstract source",
- "Infobox": {
- "content": [
- {
- "data_type": "string",
- "value": "1999",
- "label": "Introduced",
- "wiki_order": 0
- }
- ],
- "meta": [
- {
- "data_type": "string",
- "value": ".test",
- "label": "article_title"
- }
- ]
- },
- "Image": "image.png",
- "ImageIsLogo": 0,
- "Abstract": "abstract",
- "AbstractText": "abstract text",
- "AnswerType": "",
- "ImageHeight": 0,
- "Results": [{
- "Result" : "result title",
- "Icon" : {
- "URL" : "result url",
- "Height" : 16,
- "Width" : 16
- },
- "FirstURL" : "result first url",
- "Text" : "result text"
- }
- ],
- "Answer": "answer"
- }
- """
- response = mock.Mock(text=json)
- results = duckduckgo_definitions.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 4)
- self.assertEqual(results[0]['answer'], 'answer')
- self.assertEqual(results[1]['title'], 'heading')
- self.assertEqual(results[1]['url'], 'result first url')
- self.assertEqual(results[2]['suggestion'], 'text')
- self.assertEqual(results[3]['infobox'], 'heading')
- self.assertEqual(results[3]['id'], 'http://definition.url')
- self.assertEqual(results[3]['entity'], 'Entity')
- self.assertIn('abstract', results[3]['content'])
- self.assertIn('this is the definition', results[3]['content'])
- self.assertEqual(results[3]['img_src'], 'image.png')
- self.assertIn('Introduced', results[3]['attributes'][0]['label'])
- self.assertIn('1999', results[3]['attributes'][0]['value'])
- self.assertIn({'url': 'https://abstract.url', 'title': 'abstract source'}, results[3]['urls'])
- self.assertIn({'url': 'http://definition.url', 'title': 'definition source'}, results[3]['urls'])
- self.assertIn({'name': 'name', 'suggestions': ['result topic text']}, results[3]['relatedTopics'])
-
- json = """
- {
- "DefinitionSource": "definition source",
- "Heading": "heading",
- "ImageWidth": 0,
- "RelatedTopics": [],
- "Entity": "Entity",
- "Type": "A",
- "Redirect": "",
- "DefinitionURL": "",
- "AbstractURL": "https://abstract.url",
- "Definition": "",
- "AbstractSource": "abstract source",
- "Image": "",
- "ImageIsLogo": 0,
- "Abstract": "",
- "AbstractText": "abstract text",
- "AnswerType": "",
- "ImageHeight": 0,
- "Results": [],
- "Answer": ""
- }
- """
- response = mock.Mock(text=json)
- results = duckduckgo_definitions.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['url'], 'https://abstract.url')
- self.assertEqual(results[0]['title'], 'heading')
- self.assertEqual(results[0]['content'], '')
-
- json = """
- {
- "DefinitionSource": "definition source",
- "Heading": "heading",
- "ImageWidth": 0,
- "RelatedTopics": [
- {
- "Result": "Top-level domains",
- "Icon": {
- "URL": "",
- "Height": "",
- "Width": ""
- },
- "FirstURL": "https://first.url",
- "Text": "heading"
- },
- {
- "Name": "name"
- },
- {
- "Topics": [
- {
- "Result": "result topic",
- "Icon": {
- "URL": "",
- "Height": "",
- "Width": ""
- },
- "FirstURL": "https://duckduckgo.com/?q=2%2F2",
- "Text": "heading"
- }
- ],
- "Name": "name"
- }
- ],
- "Entity": "Entity",
- "Type": "A",
- "Redirect": "",
- "DefinitionURL": "http://definition.url",
- "AbstractURL": "https://abstract.url",
- "Definition": "this is the definition",
- "AbstractSource": "abstract source",
- "Infobox": {
- "meta": [
- {
- "data_type": "string",
- "value": ".test",
- "label": "article_title"
- }
- ]
- },
- "Image": "image.png",
- "ImageIsLogo": 0,
- "Abstract": "abstract",
- "AbstractText": "abstract text",
- "AnswerType": "",
- "ImageHeight": 0,
- "Results": [{
- "Result" : "result title",
- "Icon" : {
- "URL" : "result url",
- "Height" : 16,
- "Width" : 16
- },
- "Text" : "result text"
- }
- ],
- "Answer": ""
- }
- """
- response = mock.Mock(text=json)
- results = duckduckgo_definitions.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['infobox'], 'heading')
- self.assertEqual(results[0]['id'], 'http://definition.url')
- self.assertEqual(results[0]['entity'], 'Entity')
- self.assertIn('abstract', results[0]['content'])
- self.assertIn('this is the definition', results[0]['content'])
- self.assertEqual(results[0]['img_src'], 'image.png')
- self.assertIn({'url': 'https://abstract.url', 'title': 'abstract source'}, results[0]['urls'])
- self.assertIn({'url': 'http://definition.url', 'title': 'definition source'}, results[0]['urls'])
- self.assertIn({'name': 'name', 'suggestions': []}, results[0]['relatedTopics'])
diff --git a/searx/tests/engines/test_dummy.py b/searx/tests/engines/test_dummy.py
deleted file mode 100644
index 9399beaaf..000000000
--- a/searx/tests/engines/test_dummy.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from searx.engines import dummy
-from searx.testing import SearxTestCase
-
-
-class TestDummyEngine(SearxTestCase):
-
- def test_request(self):
- test_params = [
- [1, 2, 3],
- ['a'],
- [],
- 1
- ]
- for params in test_params:
- self.assertEqual(dummy.request(None, params), params)
-
- def test_response(self):
- responses = [
- None,
- [],
- True,
- dict(),
- tuple()
- ]
- for response in responses:
- self.assertEqual(dummy.response(response), [])
diff --git a/searx/tests/engines/test_faroo.py b/searx/tests/engines/test_faroo.py
deleted file mode 100644
index acebdda86..000000000
--- a/searx/tests/engines/test_faroo.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import faroo
-from searx.testing import SearxTestCase
-
-
-class TestFarooEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- dicto['category'] = 'general'
- params = faroo.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('faroo.com', params['url'])
- self.assertIn('en', params['url'])
- self.assertIn('web', params['url'])
-
- dicto['language'] = 'all'
- params = faroo.request(query, dicto)
- self.assertIn('en', params['url'])
-
- dicto['language'] = 'de_DE'
- params = faroo.request(query, dicto)
- self.assertIn('de', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, faroo.response, None)
- self.assertRaises(AttributeError, faroo.response, [])
- self.assertRaises(AttributeError, faroo.response, '')
- self.assertRaises(AttributeError, faroo.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(faroo.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(faroo.response(response), [])
-
- response = mock.Mock(text='{"data": []}', status_code=401)
- self.assertRaises(Exception, faroo.response, response)
-
- response = mock.Mock(text='{"data": []}', status_code=429)
- self.assertRaises(Exception, faroo.response, response)
-
- json = """
- {
- "results": [
- {
- "title": "This is the title",
- "kwic": "This is the content",
- "content": "",
- "url": "http://this.is.the.url/",
- "iurl": "",
- "domain": "css3test.com",
- "author": "Jim Dalrymple",
- "news": true,
- "votes": "10",
- "date": 1360622563000,
- "related": []
- },
- {
- "title": "This is the title2",
- "kwic": "This is the content2",
- "content": "",
- "url": "http://this.is.the.url2/",
- "iurl": "",
- "domain": "css3test.com",
- "author": "Jim Dalrymple",
- "news": false,
- "votes": "10",
- "related": []
- },
- {
- "title": "This is the title3",
- "kwic": "This is the content3",
- "content": "",
- "url": "http://this.is.the.url3/",
- "iurl": "http://upload.wikimedia.org/optimized.jpg",
- "domain": "css3test.com",
- "author": "Jim Dalrymple",
- "news": false,
- "votes": "10",
- "related": []
- }
- ],
- "query": "test",
- "suggestions": [],
- "count": 100,
- "start": 1,
- "length": 10,
- "time": "15"
- }
- """
- response = mock.Mock(text=json)
- results = faroo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 4)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
- self.assertEqual(results[0]['content'], 'This is the content')
- self.assertEqual(results[1]['title'], 'This is the title2')
- self.assertEqual(results[1]['url'], 'http://this.is.the.url2/')
- self.assertEqual(results[1]['content'], 'This is the content2')
- self.assertEqual(results[3]['img_src'], 'http://upload.wikimedia.org/optimized.jpg')
-
- json = """
- {}
- """
- response = mock.Mock(text=json)
- results = faroo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_flickr.py b/searx/tests/engines/test_flickr.py
deleted file mode 100644
index 8b39e922f..000000000
--- a/searx/tests/engines/test_flickr.py
+++ /dev/null
@@ -1,142 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import flickr
-from searx.testing import SearxTestCase
-
-
-class TestFlickrEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = flickr.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('flickr.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, flickr.response, None)
- self.assertRaises(AttributeError, flickr.response, [])
- self.assertRaises(AttributeError, flickr.response, '')
- self.assertRaises(AttributeError, flickr.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(flickr.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(flickr.response(response), [])
-
- json = """
- { "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
- "photo": [
- { "id": "15751017054", "owner": "66847915@N08",
- "secret": "69c22afc40", "server": "7285", "farm": 8,
- "title": "Photo title", "ispublic": 1,
- "isfriend": 0, "isfamily": 0,
- "description": { "_content": "Description" },
- "ownername": "Owner",
- "url_o": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_9178e0f963_o.jpg",
- "height_o": "2100", "width_o": "2653",
- "url_n": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_69c22afc40_n.jpg",
- "height_n": "253", "width_n": "320",
- "url_z": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_69c22afc40_z.jpg",
- "height_z": "507", "width_z": "640" }
- ] }, "stat": "ok" }
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Photo title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/66847915@N08/15751017054')
- self.assertTrue('o.jpg' in results[0]['img_src'])
- self.assertTrue('n.jpg' in results[0]['thumbnail_src'])
- self.assertTrue('Owner' in results[0]['content'])
- self.assertTrue('Description' in results[0]['content'])
-
- json = """
- { "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
- "photo": [
- { "id": "15751017054", "owner": "66847915@N08",
- "secret": "69c22afc40", "server": "7285", "farm": 8,
- "title": "Photo title", "ispublic": 1,
- "isfriend": 0, "isfamily": 0,
- "description": { "_content": "Description" },
- "ownername": "Owner",
- "url_z": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_69c22afc40_z.jpg",
- "height_z": "507", "width_z": "640" }
- ] }, "stat": "ok" }
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Photo title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/66847915@N08/15751017054')
- self.assertTrue('z.jpg' in results[0]['img_src'])
- self.assertTrue('z.jpg' in results[0]['thumbnail_src'])
- self.assertTrue('Owner' in results[0]['content'])
- self.assertTrue('Description' in results[0]['content'])
-
- json = """
- { "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
- "photo": [
- { "id": "15751017054", "owner": "66847915@N08",
- "secret": "69c22afc40", "server": "7285", "farm": 8,
- "title": "Photo title", "ispublic": 1,
- "isfriend": 0, "isfamily": 0,
- "description": { "_content": "Description" },
- "ownername": "Owner",
- "url_o": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_9178e0f963_o.jpg",
- "height_o": "2100", "width_o": "2653" }
- ] }, "stat": "ok" }
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Photo title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/66847915@N08/15751017054')
- self.assertTrue('o.jpg' in results[0]['img_src'])
- self.assertTrue('o.jpg' in results[0]['thumbnail_src'])
- self.assertTrue('Owner' in results[0]['content'])
- self.assertTrue('Description' in results[0]['content'])
-
- json = """
- { "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
- "photo": [
- { "id": "15751017054", "owner": "66847915@N08",
- "secret": "69c22afc40", "server": "7285", "farm": 8,
- "title": "Photo title", "ispublic": 1,
- "isfriend": 0, "isfamily": 0,
- "description": { "_content": "Description" },
- "ownername": "Owner",
- "url_n": "https:\/\/farm8.staticflickr.com\/7285\/15751017054_69c22afc40_n.jpg",
- "height_n": "253", "width_n": "320" }
- ] }, "stat": "ok" }
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- { "photos": { "page": 1, "pages": "41001", "perpage": 100, "total": "4100032",
- "toto": [] }, "stat": "ok" }
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.flickr.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = flickr.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_flickr_noapi.py b/searx/tests/engines/test_flickr_noapi.py
deleted file mode 100644
index 3b337a2d8..000000000
--- a/searx/tests/engines/test_flickr_noapi.py
+++ /dev/null
@@ -1,328 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import flickr_noapi
-from searx.testing import SearxTestCase
-
-
-class TestFlickrNoapiEngine(SearxTestCase):
-
- def test_build_flickr_url(self):
- url = flickr_noapi.build_flickr_url("uid", "pid")
- self.assertIn("uid", url)
- self.assertIn("pid", url)
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = flickr_noapi.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('flickr.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, flickr_noapi.response, None)
- self.assertRaises(AttributeError, flickr_noapi.response, [])
- self.assertRaises(AttributeError, flickr_noapi.response, '')
- self.assertRaises(AttributeError, flickr_noapi.response, '[]')
-
- response = mock.Mock(text='"search-photos-lite-models","photos":{},"totalItems":')
- self.assertEqual(flickr_noapi.response(response), [])
-
- response = mock.Mock(text='search-photos-lite-models","photos":{"data": []},"totalItems":')
- self.assertEqual(flickr_noapi.response(response), [])
-
- # everthing is ok test
- json = """
- "search-photos-lite-models","photos":
- {
- "_data": [
- {
- "_flickrModelRegistry": "photo-lite-models",
- "title": "This is the title",
- "username": "Owner",
- "pathAlias": "klink692",
- "realname": "Owner",
- "license": 0,
- "ownerNsid": "59729010@N00",
- "canComment": false,
- "commentCount": 14,
- "faveCount": 21,
- "id": "14001294434",
- "sizes": {
- "c": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_c.jpg",
- "width": 541,
- "height": 800,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_c.jpg",
- "key": "c"
- },
- "h": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_761d32237a_h.jpg",
- "width": 1081,
- "height": 1600,
- "url": "//c4.staticflickr.com/8/7246/14001294434_761d32237a_h.jpg",
- "key": "h"
- },
- "k": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_f145a2c11a_k.jpg",
- "width": 1383,
- "height": 2048,
- "url": "//c4.staticflickr.com/8/7246/14001294434_f145a2c11a_k.jpg",
- "key": "k"
- },
- "l": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_b.jpg",
- "width": 692,
- "height": 1024,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_b.jpg",
- "key": "l"
- },
- "m": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777.jpg",
- "width": 338,
- "height": 500,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777.jpg",
- "key": "m"
- },
- "n": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_n.jpg",
- "width": 216,
- "height": 320,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_n.jpg",
- "key": "n"
- },
- "q": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_q.jpg",
- "width": 150,
- "height": 150,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_q.jpg",
- "key": "q"
- },
- "s": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_m.jpg",
- "width": 162,
- "height": 240,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_m.jpg",
- "key": "s"
- },
- "sq": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_s.jpg",
- "width": 75,
- "height": 75,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_s.jpg",
- "key": "sq"
- },
- "t": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_t.jpg",
- "width": 68,
- "height": 100,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_t.jpg",
- "key": "t"
- },
- "z": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_z.jpg",
- "width": 433,
- "height": 640,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
- "key": "z"
- }
- }
- }
- ],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- json = json.replace('\r\n', '').replace('\n', '').replace('\r', '')
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/59729010@N00/14001294434')
- self.assertIn('k.jpg', results[0]['img_src'])
- self.assertIn('n.jpg', results[0]['thumbnail_src'])
- self.assertIn('Owner', results[0]['content'])
-
- # no n size, only the z size
- json = """
- "search-photos-lite-models","photos":
- {
- "_data": [
- {
- "_flickrModelRegistry": "photo-lite-models",
- "title": "This is the title",
- "username": "Owner",
- "pathAlias": "klink692",
- "realname": "Owner",
- "license": 0,
- "ownerNsid": "59729010@N00",
- "canComment": false,
- "commentCount": 14,
- "faveCount": 21,
- "id": "14001294434",
- "sizes": {
- "z": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_z.jpg",
- "width": 433,
- "height": 640,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
- "key": "z"
- }
- }
- }
- ],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/59729010@N00/14001294434')
- self.assertIn('z.jpg', results[0]['img_src'])
- self.assertIn('z.jpg', results[0]['thumbnail_src'])
- self.assertIn('Owner', results[0]['content'])
-
- # no z or n size
- json = """
- "search-photos-lite-models","photos":
- {
- "_data": [
- {
- "_flickrModelRegistry": "photo-lite-models",
- "title": "This is the title",
- "username": "Owner",
- "pathAlias": "klink692",
- "realname": "Owner",
- "license": 0,
- "ownerNsid": "59729010@N00",
- "canComment": false,
- "commentCount": 14,
- "faveCount": 21,
- "id": "14001294434",
- "sizes": {
- "o": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
- "width": 433,
- "height": 640,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
- "key": "o"
- }
- }
- }
- ],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://www.flickr.com/photos/59729010@N00/14001294434')
- self.assertIn('o.jpg', results[0]['img_src'])
- self.assertIn('o.jpg', results[0]['thumbnail_src'])
- self.assertIn('Owner', results[0]['content'])
-
- # no image test
- json = """
- "search-photos-lite-models","photos":
- {
- "_data": [
- {
- "_flickrModelRegistry": "photo-lite-models",
- "title": "This is the title",
- "username": "Owner",
- "pathAlias": "klink692",
- "realname": "Owner",
- "license": 0,
- "ownerNsid": "59729010@N00",
- "canComment": false,
- "commentCount": 14,
- "faveCount": 21,
- "id": "14001294434",
- "sizes": {
- }
- }
- ],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- # null test
- json = """
- "search-photos-models","photos":
- {
- "_data": [null],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- # no ownerNsid test
- json = """
- "search-photos-lite-models","photos":
- {
- "_data": [
- {
- "_flickrModelRegistry": "photo-lite-models",
- "title": "This is the title",
- "username": "Owner",
- "pathAlias": "klink692",
- "realname": "Owner",
- "license": 0,
- "canComment": false,
- "commentCount": 14,
- "faveCount": 21,
- "id": "14001294434",
- "sizes": {
- "o": {
- "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
- "width": 433,
- "height": 640,
- "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
- "key": "o"
- }
- }
- }
- ],
- "fetchedStart": true,
- "fetchedEnd": false,
- "totalItems": "4386039"
- },"totalItems":
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- # garbage test
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.flickr.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = flickr_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_gigablast.py b/searx/tests/engines/test_gigablast.py
deleted file mode 100644
index 38264913f..000000000
--- a/searx/tests/engines/test_gigablast.py
+++ /dev/null
@@ -1,57 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import gigablast
-from searx.testing import SearxTestCase
-
-
-class TestGigablastEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = gigablast.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('gigablast.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, gigablast.response, None)
- self.assertRaises(AttributeError, gigablast.response, [])
- self.assertRaises(AttributeError, gigablast.response, '')
- self.assertRaises(AttributeError, gigablast.response, '[]')
-
- response = mock.Mock(content='<response></response>')
- self.assertEqual(gigablast.response(response), [])
-
- response = mock.Mock(content='<response></response>')
- self.assertEqual(gigablast.response(response), [])
-
- xml = """<?xml version="1.0" encoding="UTF-8" ?>
- <response>
- <hits>5941888</hits>
- <moreResultsFollow>1</moreResultsFollow>
- <result>
- <title><![CDATA[This should be the title]]></title>
- <sum><![CDATA[This should be the content.]]></sum>
- <url><![CDATA[http://this.should.be.the.link/]]></url>
- <size>90.5</size>
- <docId>145414002633</docId>
- <siteId>2660021087</siteId>
- <domainId>2660021087</domainId>
- <spidered>1320519373</spidered>
- <indexed>1320519373</indexed>
- <pubdate>4294967295</pubdate>
- <isModDate>0</isModDate>
- <language><![CDATA[English]]></language>
- <charset><![CDATA[UTF-8]]></charset>
- </result>
- </response>
- """
- response = mock.Mock(content=xml)
- results = gigablast.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
diff --git a/searx/tests/engines/test_github.py b/searx/tests/engines/test_github.py
deleted file mode 100644
index 460be8c3d..000000000
--- a/searx/tests/engines/test_github.py
+++ /dev/null
@@ -1,61 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import github
-from searx.testing import SearxTestCase
-
-
-class TestGitHubEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- params = github.request(query, defaultdict(dict))
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('github.com' in params['url'])
- self.assertEqual(params['headers']['Accept'], github.accept_header)
-
- def test_response(self):
- self.assertRaises(AttributeError, github.response, None)
- self.assertRaises(AttributeError, github.response, [])
- self.assertRaises(AttributeError, github.response, '')
- self.assertRaises(AttributeError, github.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(github.response(response), [])
-
- response = mock.Mock(text='{"items": []}')
- self.assertEqual(github.response(response), [])
-
- json = """
- {
- "items": [
- {
- "name": "title",
- "html_url": "url",
- "description": ""
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = github.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'title')
- self.assertEqual(results[0]['url'], 'url')
- self.assertEqual(results[0]['content'], '')
-
- json = """
- {
- "items": [
- {
- "name": "title",
- "html_url": "url",
- "description": "desc"
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = github.response(response)
- self.assertEqual(results[0]['content'], "desc")
diff --git a/searx/tests/engines/test_google.py b/searx/tests/engines/test_google.py
deleted file mode 100644
index 04f12b830..000000000
--- a/searx/tests/engines/test_google.py
+++ /dev/null
@@ -1,178 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-import lxml
-from searx.engines import google
-from searx.testing import SearxTestCase
-
-
-class TestGoogleEngine(SearxTestCase):
-
- def mock_response(self, text):
- response = mock.Mock(text=text, url='https://www.google.com/search?q=test&start=0&gbv=1&gws_rd=cr')
- response.search_params = mock.Mock()
- response.search_params.get = mock.Mock(return_value='www.google.com')
- return response
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = google.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('google.fr', params['url'])
- self.assertIn('fr', params['headers']['Accept-Language'])
-
- dicto['language'] = 'all'
- params = google.request(query, dicto)
- self.assertIn('google.com', params['url'])
- self.assertIn('en', params['headers']['Accept-Language'])
-
- def test_response(self):
- self.assertRaises(AttributeError, google.response, None)
- self.assertRaises(AttributeError, google.response, [])
- self.assertRaises(AttributeError, google.response, '')
- self.assertRaises(AttributeError, google.response, '[]')
-
- response = self.mock_response('<html></html>')
- self.assertEqual(google.response(response), [])
-
- html = """
- <li class="g">
- <h3 class="r">
- <a href="http://this.should.be.the.link/">
- <b>This</b> is <b>the</b> title
- </a>
- </h3>
- <div class="s">
- <div class="kv" style="margin-bottom:2px">
- <cite>
- <b>test</b>.psychologies.com/
- </cite>
- <div class="_nBb">‎
- <div style="display:inline" onclick="google.sham(this);" aria-expanded="false"
- aria-haspopup="true" tabindex="0" data-ved="0CBUQ7B0wAA">
- <span class="_O0">
- </span>
- </div>
- <div style="display:none" class="am-dropdown-menu" role="menu" tabindex="-1">
- <ul>
- <li class="_Ykb">
- <a class="_Zkb" href="http://www.google.fr/url?url=http://webcache.googleusercontent
- .com/search%3Fcache:R1Z_4pGXjuIJ:http://test.psychologies.com/">
- En cache
- </a>
- </li>
- <li class="_Ykb">
- <a class="_Zkb" href="/search?safe=off&amp;q=related:test.psy.com/">
- Pages similaires
- </a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <span class="st">
- This should be the content.
- </span>
- <br>
- <div class="osl">‎
- <a href="http://www.google.fr/url?url=http://test.psychologies.com/tests/">
- Test Personnalité
- </a> - ‎
- <a href="http://www.google.fr/url?url=http://test.psychologies.com/test/">
- Tests - Moi
- </a> - ‎
- <a href="http://www.google.fr/url?url=http://test.psychologies.com/test/tests-couple">
- Test Couple
- </a>
- - ‎
- <a href="http://www.google.fr/url?url=http://test.psychologies.com/tests/tests-amour">
- Test Amour
- </a>
- </div>
- </div>
- </li>
- <li class="g">
- <h3 class="r">
- <a href="http://www.google.com/images?q=toto">
- <b>This</b>
- </a>
- </h3>
- </li>
- <li class="g">
- <h3 class="r">
- <a href="http://www.google.com/search?q=toto">
- <b>This</b> is
- </a>
- </h3>
- </li>
- <li class="g">
- <h3 class="r">
- <a href="€">
- <b>This</b> is <b>the</b>
- </a>
- </h3>
- </li>
- <li class="g">
- <h3 class="r">
- <a href="/url?q=url">
- <b>This</b> is <b>the</b>
- </a>
- </h3>
- </li>
- <p class="_Bmc" style="margin:3px 8px">
- <a href="/search?num=20&amp;safe=off&amp;q=t&amp;revid=1754833769&amp;sa=X&amp;ei=-&amp;ved=">
- suggestion <b>title</b>
- </a>
- </p>
- """
- response = self.mock_response(html)
- results = google.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 2)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
- self.assertEqual(results[1]['suggestion'], 'suggestion title')
-
- html = """
- <li class="b_algo" u="0|5109|4755453613245655|UAGjXgIrPH5yh-o5oNHRx_3Zta87f_QO">
- </li>
- """
- response = self.mock_response(html)
- results = google.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- response = mock.Mock(text='<html></html>', url='https://sorry.google.com')
- response.search_params = mock.Mock()
- response.search_params.get = mock.Mock(return_value='www.google.com')
- self.assertRaises(RuntimeWarning, google.response, response)
-
- response = mock.Mock(text='<html></html>', url='https://www.google.com/sorry/IndexRedirect')
- response.search_params = mock.Mock()
- response.search_params.get = mock.Mock(return_value='www.google.com')
- self.assertRaises(RuntimeWarning, google.response, response)
-
- def test_parse_images(self):
- html = """
- <li>
- <div>
- <a href="http://www.google.com/url?q=http://this.is.the.url/">
- <img style="margin:3px 0;margin-right:6px;padding:0" height="90"
- src="https://this.is.the.image/image.jpg" width="60" align="middle" alt="" border="0">
- </a>
- </div>
- </li>
- """
- dom = lxml.html.fromstring(html)
- results = google.parse_images(dom, 'www.google.com')
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
- self.assertEqual(results[0]['title'], '')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['img_src'], 'https://this.is.the.image/image.jpg')
diff --git a/searx/tests/engines/test_google_images.py b/searx/tests/engines/test_google_images.py
deleted file mode 100644
index 876d0af1e..000000000
--- a/searx/tests/engines/test_google_images.py
+++ /dev/null
@@ -1,58 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import google_images
-from searx.testing import SearxTestCase
-
-
-class TestGoogleImagesEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['safesearch'] = 1
- params = google_images.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('safe=active', params['url'])
-
- dicto['safesearch'] = 0
- params = google_images.request(query, dicto)
- self.assertNotIn('safe', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, google_images.response, None)
- self.assertRaises(AttributeError, google_images.response, [])
- self.assertRaises(AttributeError, google_images.response, '')
- self.assertRaises(AttributeError, google_images.response, '[]')
-
- response = mock.Mock(text='<div></div>')
- self.assertEqual(google_images.response(response), [])
-
- html = """
-<div style="display:none">
- <div eid="fWhnVq4Shqpp3pWo4AM" id="isr_scm_1" style="display:none"></div>
- <div data-cei="fWhnVq4Shqpp3pWo4AM" class="rg_add_chunk"><!--m-->
- <div class="rg_di rg_el ivg-i" data-ved="0ahUKEwjuxPWQts3JAhUGVRoKHd4KCjwQMwgDKAAwAA">
- <a href="/imgres?imgurl=http://www.clker.com/cliparts/H/X/l/b/0/0/south-arrow-hi.png&amp;imgrefurl=http://www.clker.com/clipart-south-arrow.html&amp;h=598&amp;w=504&amp;tbnid=bQWQ9wz9loJmjM:&amp;docid=vlONkeBtERfDuM&amp;ei=fWhnVq4Shqpp3pWo4AM&amp;tbm=isch" jsaction="fire.ivg_o;mouseover:str.hmov;mouseout:str.hmou" class="rg_l"><img data-src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRsxy3gKnEX0lrwwpRxdPWyLJ8iZ--PXZ-ThbBA2_xXDG_bdQutMQ" data-sz="f" name="bQWQ9wz9loJmjM:" class="rg_i" alt="Image result for south" jsaction="load:str.tbn" onload="google.aft&&google.aft(this)">
- <div class="_aOd rg_ilm">
- <div class="rg_ilmbg"><span class="rg_ilmn"> 504&nbsp;&#215;&nbsp;598 - clker.com </span>
- </div>
- </div>
- </a>
- <div class="rg_meta">
- {"id":"bQWQ9wz9loJmjM:","isu":"clker.com","ity":"png","md":"/search?tbs\u003dsbi:AMhZZit7u1mHyop9pQisu-5idR-8W_1Itvwc3afChmsjQYPx_1yYMzBvUZgtkcGoojqekKZ-6n_1rjX9ySH0OWA_1eO5OijFY6BBDw_1GApr6xxb1bXJcBcj-DiguMoXWW7cZSG7MRQbwnI5SoDZNXcv_1xGszy886I7NVb_1oRKSliTHtzqbXAxhvYreM","msu":"/search?q\u003dsouth\u0026biw\u003d1364\u0026bih\u003d235\u0026tbm\u003disch\u0026tbs\u003dsimg:CAQSEgltBZD3DP2WgiG-U42R4G0RFw","oh":598,"os":"13KB","ow":504,"pt":"South Arrow Clip Art at Clker.com - vector clip art online ...","rid":"vlONkeBtERfDuM","s":"Download this image as:","sc":1,"si":"/search?q\u003dsouth\u0026biw\u003d1364\u0026bih\u003d235\u0026tbm\u003disch\u0026tbs\u003dsimg:CAESEgltBZD3DP2WgiG-U42R4G0RFw","th":245,"tu":"https://thumbnail.url/","tw":206}
- </div>
- </div><!--n--><!--m-->
- </div>
-</div>
- """ # noqa
- response = mock.Mock(text=html)
- results = google_images.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], u'South Arrow Clip Art at Clker.com - vector clip art online ...')
- self.assertEqual(results[0]['url'], 'http://www.clker.com/clipart-south-arrow.html')
- self.assertEqual(results[0]['thumbnail_src'], 'https://thumbnail.url/')
- self.assertEqual(results[0]['img_src'], 'http://www.clker.com/cliparts/H/X/l/b/0/0/south-arrow-hi.png')
- self.assertEqual(results[0]['content'], 'Download this image as:')
diff --git a/searx/tests/engines/test_google_news.py b/searx/tests/engines/test_google_news.py
deleted file mode 100644
index 31d674121..000000000
--- a/searx/tests/engines/test_google_news.py
+++ /dev/null
@@ -1,136 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import google_news
-from searx.testing import SearxTestCase
-
-
-class TestGoogleNewsEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = google_news.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('googleapis.com', params['url'])
- self.assertIn('fr', params['url'])
-
- dicto['language'] = 'all'
- params = google_news.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn('en', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, google_news.response, None)
- self.assertRaises(AttributeError, google_news.response, [])
- self.assertRaises(AttributeError, google_news.response, '')
- self.assertRaises(AttributeError, google_news.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(google_news.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(google_news.response(response), [])
-
- json = """
- {
- "responseData": {
- "results": [
- {
- "GsearchResultClass": "GnewsSearch",
- "clusterUrl": "http://news.google.com/news/story?ncl=d2d3t1LMDpNIj2MPPhdTT0ycN4sWM&hl=fr&ned=fr",
- "content": "This is the content",
- "unescapedUrl": "http://this.is.the.url",
- "url": "http://this.is.the.url",
- "title": "This is the title",
- "titleNoFormatting": "This is the title",
- "location": "",
- "publisher": "Jeux Actu",
- "publishedDate": "Fri, 30 Jan 2015 11:00:25 -0800",
- "signedRedirectUrl": "http://news.google.com/",
- "language": "fr",
- "image": {
- "url": "http://i.jeuxactus.com/datas/jeux/d/y/dying-light/vu/dying-light-54cc080b568fb.jpg",
- "tbUrl": "http://t1.gstatic.com/images?q=tbn:ANd9GcSF4yYrs9Ycw23DGiOSAZ-5SEPXYwG3LNs",
- "originalContextUrl": "http://www.jeuxactu.com/test-dying-light-sur-ps4-97208.htm",
- "publisher": "Jeux Actu",
- "tbWidth": 80,
- "tbHeight": 30
- },
- "relatedStories": [
- {
- "unescapedUrl": "http://www.jeuxvideo.com/test/415823/dying-light.htm",
- "url": "http%3A%2F%2Fwww.jeuxvideo.com%2Ftest%2F415823%2Fdying-light.htm",
- "title": "<b>Test</b> du jeu Dying Light - jeuxvideo.com",
- "titleNoFormatting": "Test du jeu Dying Light - jeuxvideo.com",
- "location": "",
- "publisher": "JeuxVideo.com",
- "publishedDate": "Fri, 30 Jan 2015 08:52:30 -0800",
- "signedRedirectUrl": "http://news.google.com/news/url?sa=T&",
- "language": "fr"
- }
- ]
- }
- ]
- },
- "responseDetails": null,
- "responseStatus": 200
- }
- """
- response = mock.Mock(text=json)
- results = google_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url')
- self.assertEqual(results[0]['content'], 'This is the content')
-
- json = """
- {
- "responseData": {
- "results": [
- {
- "GsearchResultClass": "GnewsSearch",
- "clusterUrl": "http://news.google.com/news/story?ncl=d2d3t1LMDpNIj2MPPhdTT0ycN4sWM&hl=fr&ned=fr",
- "content": "This is the content",
- "unescapedUrl": "http://this.is.the.url",
- "title": "This is the title",
- "titleNoFormatting": "This is the title",
- "location": "",
- "publisher": "Jeux Actu",
- "publishedDate": "Fri, 30 Jan 2015 11:00:25 -0800",
- "signedRedirectUrl": "http://news.google.com/news/",
- "language": "fr",
- "image": {
- "url": "http://i.jeuxactus.com/datas/jeux/d/y/dying-light/vu/dying-light-54cc080b568fb.jpg",
- "tbUrl": "http://t1.gstatic.com/images?q=tbn:b_6f-OSAZ-5SEPXYwG3LNs",
- "originalContextUrl": "http://www.jeuxactu.com/test-dying-light-sur-ps4-97208.htm",
- "publisher": "Jeux Actu",
- "tbWidth": 80,
- "tbHeight": 30
- }
- }
- ]
- },
- "responseDetails": null,
- "responseStatus": 200
- }
- """
- response = mock.Mock(text=json)
- results = google_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "responseData": {},
- "responseDetails": null,
- "responseStatus": 200
- }
- """
- response = mock.Mock(text=json)
- results = google_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_kickass.py b/searx/tests/engines/test_kickass.py
deleted file mode 100644
index 4cfcaa63c..000000000
--- a/searx/tests/engines/test_kickass.py
+++ /dev/null
@@ -1,397 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import kickass
-from searx.testing import SearxTestCase
-
-
-class TestKickassEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = kickass.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('kickass.to', params['url'])
- self.assertFalse(params['verify'])
-
- def test_response(self):
- self.assertRaises(AttributeError, kickass.response, None)
- self.assertRaises(AttributeError, kickass.response, [])
- self.assertRaises(AttributeError, kickass.response, '')
- self.assertRaises(AttributeError, kickass.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(kickass.response(response), [])
-
- html = """
- <table cellpadding="0" cellspacing="0" class="data" style="width: 100%">
- <tr class="firstr">
- <th class="width100perc nopad">torrent name</th>
- <th class="center">
- <a href="/search/test/?field=size&sorder=desc" rel="nofollow">size</a>
- </th>
- <th class="center"><span class="files">
- <a href="/search/test/?field=files_count&sorder=desc" rel="nofollow">files</a></span>
- </th>
- <th class="center"><span>
- <a href="/search/test/?field=time_add&sorder=desc" rel="nofollow">age</a></span>
- </th>
- <th class="center"><span class="seed">
- <a href="/search/test/?field=seeders&sorder=desc" rel="nofollow">seed</a></span>
- </th>
- <th class="lasttd nobr center">
- <a href="/search/test/?field=leechers&sorder=desc" rel="nofollow">leech</a>
- </th>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">449 <span>bytes</span></td>
- <td class="center">4</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">10</td>
- <td class="red lasttd center">1</td>
- </tr>
- </table>
- """
- response = mock.Mock(text=html)
- results = kickass.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'https://kickass.to/url.html')
- self.assertEqual(results[0]['content'], 'Posted by riri in Other &gt; Unsorted')
- self.assertEqual(results[0]['seed'], 10)
- self.assertEqual(results[0]['leech'], 1)
- self.assertEqual(results[0]['filesize'], 449)
- self.assertEqual(results[0]['files'], 4)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETURL&dn=test')
- self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/53917.torrent?title=test')
-
- html = """
- <table cellpadding="0" cellspacing="0" class="data" style="width: 100%">
- <tr class="firstr">
- <th class="width100perc nopad">torrent name</th>
- <th class="center">
- <a href="/search/test/?field=size&sorder=desc" rel="nofollow">size</a>
- </th>
- <th class="center"><span class="files">
- <a href="/search/test/?field=files_count&sorder=desc" rel="nofollow">files</a></span>
- </th>
- <th class="center"><span>
- <a href="/search/test/?field=time_add&sorder=desc" rel="nofollow">age</a></span>
- </th>
- <th class="center"><span class="seed">
- <a href="/search/test/?field=seeders&sorder=desc" rel="nofollow">seed</a></span>
- </th>
- <th class="lasttd nobr center">
- <a href="/search/test/?field=leechers&sorder=desc" rel="nofollow">leech</a>
- </th>
- </tr>
- </table>
- """
- response = mock.Mock(text=html)
- results = kickass.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- html = """
- <table cellpadding="0" cellspacing="0" class="data" style="width: 100%">
- <tr class="firstr">
- <th class="width100perc nopad">torrent name</th>
- <th class="center">
- <a href="/search/test/?field=size&sorder=desc" rel="nofollow">size</a>
- </th>
- <th class="center"><span class="files">
- <a href="/search/test/?field=files_count&sorder=desc" rel="nofollow">files</a></span>
- </th>
- <th class="center"><span>
- <a href="/search/test/?field=time_add&sorder=desc" rel="nofollow">age</a></span>
- </th>
- <th class="center"><span class="seed">
- <a href="/search/test/?field=seeders&sorder=desc" rel="nofollow">seed</a></span>
- </th>
- <th class="lasttd nobr center">
- <a href="/search/test/?field=leechers&sorder=desc" rel="nofollow">leech</a>
- </th>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">1 <span>KB</span></td>
- <td class="center">4</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">10</td>
- <td class="red lasttd center">1</td>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">1 <span>MB</span></td>
- <td class="center">4</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">9</td>
- <td class="red lasttd center">1</td>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">1 <span>GB</span></td>
- <td class="center">4</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">8</td>
- <td class="red lasttd center">1</td>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">1 <span>TB</span></td>
- <td class="center">4</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">7</td>
- <td class="red lasttd center">1</td>
- </tr>
- <tr class="even" id="torrent_test6478745">
- <td>
- <div class="iaconbox center floatright">
- <a rel="6478745,0" class="icommentjs icon16" href="/test-t6478745.html#comment">
- <em style="font-size: 12px; margin: 0 4px 0 4px;" class="iconvalue">3</em>
- <i class="ka ka-comment"></i>
- </a>
- <a class="iverify icon16" href="/test-t6478745.html" title="Verified Torrent">
- <i class="ka ka16 ka-verify ka-green"></i>
- </a>
- <a href="#" onclick="_scq.push([]); return false;" class="partner1Button idownload icon16">
- <i class="ka ka16 ka-arrow-down partner1Button"></i>
- </a>
- <a title="Torrent magnet link"
- href="magnet:?xt=urn:btih:MAGNETURL&dn=test" class="imagnet icon16">
- <i class="ka ka16 ka-magnet"></i>
- </a>
- <a title="Download torrent file"
- href="http://torcache.net/torrent/53917.torrent?title=test" class="idownload icon16">
- <i class="ka ka16 ka-arrow-down"></i>
- </a>
- </div>
- <div class="torrentname">
- <a href="/test-t6478745.html" class="torType txtType"></a>
- <a href="/test-t6478745.html" class="normalgrey font12px plain bold"></a>
- <div class="markeredBlock torType txtType">
- <a href="/url.html" class="cellMainLink">
- <strong class="red">This should be the title</strong>
- </a>
- <span class="font11px lightgrey block">
- Posted by <i class="ka ka-verify" style="font-size: 16px;color:orange;"></i>
- <a class="plain" href="/user/riri/">riri</a> in
- <span id="cat_6478745">
- <strong><a href="/other/">Other</a> > <a href="/unsorted/">Unsorted</a></strong>
- </span>
- </span>
- </div>
- </td>
- <td class="nobr center">z <span>bytes</span></td>
- <td class="center">r</td>
- <td class="center">2&nbsp;years</td>
- <td class="green center">a</td>
- <td class="red lasttd center">t</td>
- </tr>
- </table>
- """
- response = mock.Mock(text=html)
- results = kickass.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 5)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'https://kickass.to/url.html')
- self.assertEqual(results[0]['content'], 'Posted by riri in Other &gt; Unsorted')
- self.assertEqual(results[0]['seed'], 10)
- self.assertEqual(results[0]['leech'], 1)
- self.assertEqual(results[0]['files'], 4)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETURL&dn=test')
- self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/53917.torrent?title=test')
- self.assertEqual(results[0]['filesize'], 1024)
- self.assertEqual(results[1]['filesize'], 1048576)
- self.assertEqual(results[2]['filesize'], 1073741824)
- self.assertEqual(results[3]['filesize'], 1099511627776)
- self.assertEqual(results[4]['seed'], 0)
- self.assertEqual(results[4]['leech'], 0)
- self.assertEqual(results[4]['files'], None)
- self.assertEqual(results[4]['filesize'], None)
diff --git a/searx/tests/engines/test_mediawiki.py b/searx/tests/engines/test_mediawiki.py
deleted file mode 100644
index 63f7da6b2..000000000
--- a/searx/tests/engines/test_mediawiki.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import mediawiki
-from searx.testing import SearxTestCase
-
-
-class TestMediawikiEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = mediawiki.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('wikipedia.org', params['url'])
- self.assertIn('fr', params['url'])
-
- dicto['language'] = 'all'
- params = mediawiki.request(query, dicto)
- self.assertIn('en', params['url'])
-
- mediawiki.base_url = "http://test.url/"
- mediawiki.search_url = mediawiki.base_url +\
- 'w/api.php?action=query'\
- '&list=search'\
- '&{query}'\
- '&srprop=timestamp'\
- '&format=json'\
- '&sroffset={offset}'\
- '&srlimit={limit}' # noqa
- params = mediawiki.request(query, dicto)
- self.assertIn('test.url', params['url'])
-
- def test_response(self):
- dicto = defaultdict(dict)
- dicto['language'] = 'fr'
- mediawiki.base_url = "https://{language}.wikipedia.org/"
-
- self.assertRaises(AttributeError, mediawiki.response, None)
- self.assertRaises(AttributeError, mediawiki.response, [])
- self.assertRaises(AttributeError, mediawiki.response, '')
- self.assertRaises(AttributeError, mediawiki.response, '[]')
-
- response = mock.Mock(text='{}', search_params=dicto)
- self.assertEqual(mediawiki.response(response), [])
-
- response = mock.Mock(text='{"data": []}', search_params=dicto)
- self.assertEqual(mediawiki.response(response), [])
-
- json = """
- {
- "query-continue": {
- "search": {
- "sroffset": 1
- }
- },
- "query": {
- "searchinfo": {
- "totalhits": 29721
- },
- "search": [
- {
- "ns": 0,
- "title": "This is the title étude",
- "timestamp": "2014-12-19T17:42:52Z"
- }
- ]
- }
- }
- """
- response = mock.Mock(text=json, search_params=dicto)
- results = mediawiki.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], u'This is the title étude')
- self.assertIn('fr.wikipedia.org', results[0]['url'])
- self.assertIn('This_is_the_title', results[0]['url'])
- self.assertIn('%C3%A9tude', results[0]['url'])
- self.assertEqual(results[0]['content'], '')
-
- json = """
- {
- "query-continue": {
- "search": {
- "sroffset": 1
- }
- },
- "query": {
- "searchinfo": {
- "totalhits": 29721
- },
- "search": [
- ]
- }
- }
- """
- response = mock.Mock(text=json, search_params=dicto)
- results = mediawiki.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "query-continue": {
- "search": {
- "sroffset": 1
- }
- },
- "query": {
- }
- }
- """
- response = mock.Mock(text=json, search_params=dicto)
- results = mediawiki.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.mediawiki.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json, search_params=dicto)
- results = mediawiki.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_mixcloud.py b/searx/tests/engines/test_mixcloud.py
deleted file mode 100644
index a2ea47cf9..000000000
--- a/searx/tests/engines/test_mixcloud.py
+++ /dev/null
@@ -1,67 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import mixcloud
-from searx.testing import SearxTestCase
-
-
-class TestMixcloudEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = mixcloud.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('mixcloud.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, mixcloud.response, None)
- self.assertRaises(AttributeError, mixcloud.response, [])
- self.assertRaises(AttributeError, mixcloud.response, '')
- self.assertRaises(AttributeError, mixcloud.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(mixcloud.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(mixcloud.response(response), [])
-
- json = """
- {"data":[
- {
- "user": {
- "url": "http://www.mixcloud.com/user/",
- "username": "user",
- "name": "User",
- "key": "/user/"
- },
- "key": "/user/this-is-the-url/",
- "created_time": "2014-11-14T13:30:02Z",
- "audio_length": 3728,
- "slug": "this-is-the-url",
- "name": "Title of track",
- "url": "http://www.mixcloud.com/user/this-is-the-url/",
- "updated_time": "2014-11-14T13:14:10Z"
- }
- ]}
- """
- response = mock.Mock(text=json)
- results = mixcloud.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title of track')
- self.assertEqual(results[0]['url'], 'http://www.mixcloud.com/user/this-is-the-url/')
- self.assertEqual(results[0]['content'], 'User')
- self.assertTrue('http://www.mixcloud.com/user/this-is-the-url/' in results[0]['embedded'])
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.mixcloud.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = mixcloud.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_openstreetmap.py b/searx/tests/engines/test_openstreetmap.py
deleted file mode 100644
index 7b7783f04..000000000
--- a/searx/tests/engines/test_openstreetmap.py
+++ /dev/null
@@ -1,199 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import openstreetmap
-from searx.testing import SearxTestCase
-
-
-class TestOpenstreetmapEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = openstreetmap.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('openstreetmap.org', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, openstreetmap.response, None)
- self.assertRaises(AttributeError, openstreetmap.response, [])
- self.assertRaises(AttributeError, openstreetmap.response, '')
- self.assertRaises(AttributeError, openstreetmap.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(openstreetmap.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(openstreetmap.response(response), [])
-
- json = """
- [
- {
- "place_id": "127732055",
- "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
- "osm_type": "relation",
- "osm_id": "7444",
- "boundingbox": [
- "48.8155755",
- "48.902156",
- "2.224122",
- "2.4697602"
- ],
- "lat": "48.8565056",
- "lon": "2.3521334",
- "display_name": "This is the title",
- "class": "place",
- "type": "city",
- "importance": 0.96893459932191,
- "icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png",
- "address": {
- "city": "Paris",
- "county": "Paris",
- "state": "Île-de-France",
- "country": "France",
- "country_code": "fr"
- },
- "geojson": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- 2.224122,
- 48.854199
- ]
- ]
- ]
- }
- }
- ]
- """
- response = mock.Mock(text=json)
- results = openstreetmap.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://openstreetmap.org/relation/7444')
- self.assertIn('coordinates', results[0]['geojson'])
- self.assertEqual(results[0]['geojson']['coordinates'][0][0][0], 2.224122)
- self.assertEqual(results[0]['geojson']['coordinates'][0][0][1], 48.854199)
- self.assertEqual(results[0]['address'], None)
- self.assertIn('48.8155755', results[0]['boundingbox'])
- self.assertIn('48.902156', results[0]['boundingbox'])
- self.assertIn('2.224122', results[0]['boundingbox'])
- self.assertIn('2.4697602', results[0]['boundingbox'])
-
- json = """
- [
- {
- "place_id": "127732055",
- "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
- "osm_type": "relation",
- "osm_id": "7444",
- "boundingbox": [
- "48.8155755",
- "48.902156",
- "2.224122",
- "2.4697602"
- ],
- "lat": "48.8565056",
- "lon": "2.3521334",
- "display_name": "This is the title",
- "class": "tourism",
- "type": "city",
- "importance": 0.96893459932191,
- "icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png",
- "address": {
- "city": "Paris",
- "county": "Paris",
- "state": "Île-de-France",
- "country": "France",
- "country_code": "fr",
- "address29": "Address"
- },
- "geojson": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- 2.224122,
- 48.854199
- ]
- ]
- ]
- }
- },
- {
- "place_id": "127732055",
- "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
- "osm_type": "relation",
- "osm_id": "7444",
- "boundingbox": [
- "48.8155755",
- "48.902156",
- "2.224122",
- "2.4697602"
- ],
- "lat": "48.8565056",
- "lon": "2.3521334",
- "display_name": "This is the title",
- "class": "tourism",
- "type": "city",
- "importance": 0.96893459932191,
- "icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png",
- "address": {
- "city": "Paris",
- "county": "Paris",
- "state": "Île-de-France",
- "country": "France",
- "postcode": 75000,
- "country_code": "fr"
- },
- "geojson": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- 2.224122,
- 48.854199
- ]
- ]
- ]
- }
- },
- {
- "place_id": "127732055",
- "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
- "osm_type": "node",
- "osm_id": "7444",
- "boundingbox": [
- "48.8155755",
- "48.902156",
- "2.224122",
- "2.4697602"
- ],
- "lat": "48.8565056",
- "lon": "2.3521334",
- "display_name": "This is the title",
- "class": "tourism",
- "type": "city",
- "importance": 0.96893459932191,
- "icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png",
- "address": {
- "city": "Paris",
- "county": "Paris",
- "state": "Île-de-France",
- "country": "France",
- "country_code": "fr",
- "address29": "Address"
- }
- }
- ]
- """
- response = mock.Mock(text=json)
- results = openstreetmap.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 3)
- self.assertIn('48.8565056', results[2]['geojson']['coordinates'])
- self.assertIn('2.3521334', results[2]['geojson']['coordinates'])
diff --git a/searx/tests/engines/test_photon.py b/searx/tests/engines/test_photon.py
deleted file mode 100644
index 734497884..000000000
--- a/searx/tests/engines/test_photon.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import photon
-from searx.testing import SearxTestCase
-
-
-class TestPhotonEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'all'
- params = photon.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('photon.komoot.de', params['url'])
-
- dicto['language'] = 'all'
- params = photon.request(query, dicto)
- self.assertNotIn('lang', params['url'])
-
- dicto['language'] = 'al'
- params = photon.request(query, dicto)
- self.assertNotIn('lang', params['url'])
-
- dicto['language'] = 'fr'
- params = photon.request(query, dicto)
- self.assertIn('fr', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, photon.response, None)
- self.assertRaises(AttributeError, photon.response, [])
- self.assertRaises(AttributeError, photon.response, '')
- self.assertRaises(AttributeError, photon.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(photon.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(photon.response(response), [])
-
- json = """
- {
- "features": [
- {
- "properties": {
- "osm_key": "waterway",
- "extent": [
- -1.4508446,
- 51.1614997,
- -1.4408036,
- 51.1525635
- ],
- "name": "This is the title",
- "state": "England",
- "osm_id": 114823817,
- "osm_type": "W",
- "osm_value": "river",
- "city": "Test Valley",
- "country": "United Kingdom"
- },
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- -1.4458571,
- 51.1576661
- ]
- }
- },
- {
- "properties": {
- "osm_key": "place",
- "street": "Rue",
- "state": "Ile-de-France",
- "osm_id": 129211377,
- "osm_type": "R",
- "housenumber": "10",
- "postcode": "75011",
- "osm_value": "house",
- "city": "Paris",
- "country": "France"
- },
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 2.3725025,
- 48.8654481
- ]
- }
- },
- {
- "properties": {
- "osm_key": "amenity",
- "street": "Allée",
- "name": "Bibliothèque",
- "state": "Ile-de-France",
- "osm_id": 1028573132,
- "osm_type": "N",
- "postcode": "75001",
- "osm_value": "library",
- "city": "Paris",
- "country": "France"
- },
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 2.3445634,
- 48.862494
- ]
- }
- },
- {
- "properties": {
- "osm_key": "amenity",
- "osm_id": 1028573132,
- "osm_type": "Y",
- "postcode": "75001",
- "osm_value": "library",
- "city": "Paris",
- "country": "France"
- },
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- 2.3445634,
- 48.862494
- ]
- }
- },
- {
- }
- ],
- "type": "FeatureCollection"
- }
- """
- response = mock.Mock(text=json)
- results = photon.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 3)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['longitude'], -1.4458571)
- self.assertEqual(results[0]['latitude'], 51.1576661)
- self.assertIn(-1.4508446, results[0]['boundingbox'])
- self.assertIn(51.1614997, results[0]['boundingbox'])
- self.assertIn(-1.4408036, results[0]['boundingbox'])
- self.assertIn(51.1525635, results[0]['boundingbox'])
- self.assertIn('type', results[0]['geojson'])
- self.assertEqual(results[0]['geojson']['type'], 'Point')
- self.assertEqual(results[0]['address'], None)
- self.assertEqual(results[0]['osm']['type'], 'way')
- self.assertEqual(results[0]['osm']['id'], 114823817)
- self.assertEqual(results[0]['url'], 'https://openstreetmap.org/way/114823817')
- self.assertEqual(results[1]['osm']['type'], 'relation')
- self.assertEqual(results[2]['address']['name'], u'Bibliothèque')
- self.assertEqual(results[2]['address']['house_number'], None)
- self.assertEqual(results[2]['address']['locality'], 'Paris')
- self.assertEqual(results[2]['address']['postcode'], '75001')
- self.assertEqual(results[2]['address']['country'], 'France')
- self.assertEqual(results[2]['osm']['type'], 'node')
diff --git a/searx/tests/engines/test_piratebay.py b/searx/tests/engines/test_piratebay.py
deleted file mode 100644
index 5699380be..000000000
--- a/searx/tests/engines/test_piratebay.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import piratebay
-from searx.testing import SearxTestCase
-
-
-class TestPiratebayEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['category'] = 'Toto'
- params = piratebay.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('piratebay.se', params['url'])
- self.assertIn('0', params['url'])
-
- dicto['category'] = 'music'
- params = piratebay.request(query, dicto)
- self.assertIn('100', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, piratebay.response, None)
- self.assertRaises(AttributeError, piratebay.response, [])
- self.assertRaises(AttributeError, piratebay.response, '')
- self.assertRaises(AttributeError, piratebay.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(piratebay.response(response), [])
-
- html = """
- <table id="searchResult">
- <tr>
- </tr>
- <tr>
- <td class="vertTh">
- <center>
- <a href="#" title="More from this category">Anime</a><br/>
- (<a href="#" title="More from this category">Anime</a>)
- </center>
- </td>
- <td>
- <div class="detName">
- <a href="/this.is.the.link" class="detLink" title="Title">
- This is the title
- </a>
- </div>
- <a href="magnet:?xt=urn:btih:MAGNETLINK" title="Download this torrent using magnet">
- <img src="/static/img/icon-magnet.gif" alt="Magnet link"/>
- </a>
- <a href="http://torcache.net/torrent/TORRENTFILE.torrent" title="Download this torrent">
- <img src="/static/img/dl.gif" class="dl" alt="Download"/>
- </a>
- <a href="/user/HorribleSubs">
- <img src="/static/img/vip.gif" alt="VIP" title="VIP" style="width:11px;" border='0'/>
- </a>
- <img src="/static/img/11x11p.png"/>
- <font class="detDesc">
- This is the content <span>and should be</span> OK
- </font>
- </td>
- <td align="right">13</td>
- <td align="right">334</td>
- </tr>
- <tr>
- <td class="vertTh">
- <center>
- <a href="#" title="More from this category">Anime</a><br/>
- (<a href="#" title="More from this category">Anime</a>)
- </center>
- </td>
- <td>
- <div class="detName">
- <a href="/this.is.the.link" class="detLink" title="Title">
- This is the title
- </a>
- </div>
- <a href="magnet:?xt=urn:btih:MAGNETLINK" title="Download this torrent using magnet">
- <img src="/static/img/icon-magnet.gif" alt="Magnet link"/>
- </a>
- <a href="/user/HorribleSubs">
- <img src="/static/img/vip.gif" alt="VIP" title="VIP" style="width:11px;" border='0'/>
- </a>
- <img src="/static/img/11x11p.png"/>
- <font class="detDesc">
- This is the content <span>and should be</span> OK
- </font>
- </td>
- <td align="right">13</td>
- <td align="right">334</td>
- </tr>
- </table>
- """
- response = mock.Mock(text=html)
- results = piratebay.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 2)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
- self.assertEqual(results[0]['content'], 'This is the content and should be OK')
- self.assertEqual(results[0]['seed'], 13)
- self.assertEqual(results[0]['leech'], 334)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETLINK')
- self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/TORRENTFILE.torrent')
-
- self.assertEqual(results[1]['torrentfile'], None)
-
- html = """
- <table id="searchResult">
- <tr>
- </tr>
- <tr>
- <td class="vertTh">
- <center>
- <a href="#" title="More from this category">Anime</a><br/>
- (<a href="#" title="More from this category">Anime</a>)
- </center>
- </td>
- <td>
- <div class="detName">
- <a href="/this.is.the.link" class="detLink" title="Title">
- This is the title
- </a>
- </div>
- <a href="magnet:?xt=urn:btih:MAGNETLINK" title="Download this torrent using magnet">
- <img src="/static/img/icon-magnet.gif" alt="Magnet link"/>
- </a>
- <a href="http://torcache.net/torrent/TORRENTFILE.torrent" title="Download this torrent">
- <img src="/static/img/dl.gif" class="dl" alt="Download"/>
- </a>
- <a href="/user/HorribleSubs">
- <img src="/static/img/vip.gif" alt="VIP" title="VIP" style="width:11px;" border='0'/>
- </a>
- <img src="/static/img/11x11p.png"/>
- <font class="detDesc">
- This is the content <span>and should be</span> OK
- </font>
- </td>
- <td align="right">s</td>
- <td align="right">d</td>
- </tr>
- </table>
- """
- response = mock.Mock(text=html)
- results = piratebay.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
- self.assertEqual(results[0]['content'], 'This is the content and should be OK')
- self.assertEqual(results[0]['seed'], 0)
- self.assertEqual(results[0]['leech'], 0)
- self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETLINK')
- self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/TORRENTFILE.torrent')
-
- html = """
- <table id="searchResult">
- </table>
- """
- response = mock.Mock(text=html)
- results = piratebay.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_qwant.py b/searx/tests/engines/test_qwant.py
deleted file mode 100644
index 7d79d13d8..000000000
--- a/searx/tests/engines/test_qwant.py
+++ /dev/null
@@ -1,317 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import qwant
-from searx.testing import SearxTestCase
-
-
-class TestQwantEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
- qwant.categories = ['']
- params = qwant.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('web', params['url'])
- self.assertIn('qwant.com', params['url'])
- self.assertIn('fr_fr', params['url'])
-
- dicto['language'] = 'all'
- qwant.categories = ['news']
- params = qwant.request(query, dicto)
- self.assertFalse('fr' in params['url'])
- self.assertIn('news', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, qwant.response, None)
- self.assertRaises(AttributeError, qwant.response, [])
- self.assertRaises(AttributeError, qwant.response, '')
- self.assertRaises(AttributeError, qwant.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(qwant.response(response), [])
-
- response = mock.Mock(text='{"data": {}}')
- self.assertEqual(qwant.response(response), [])
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "items": [
- {
- "title": "Title",
- "score": 9999,
- "url": "http://www.url.xyz",
- "source": "...",
- "desc": "Description",
- "date": "",
- "_id": "db0aadd62c2a8565567ffc382f5c61fa",
- "favicon": "https://s.qwant.com/fav.ico"
- }
- ],
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- qwant.categories = ['general']
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://www.url.xyz')
- self.assertEqual(results[0]['content'], 'Description')
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "items": [
- {
- "title": "Title",
- "score": 9999,
- "url": "http://www.url.xyz",
- "source": "...",
- "media": "http://image.jpg",
- "desc": "",
- "thumbnail": "http://thumbnail.jpg",
- "date": "",
- "_id": "db0aadd62c2a8565567ffc382f5c61fa",
- "favicon": "https://s.qwant.com/fav.ico"
- }
- ],
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- qwant.categories = ['images']
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://www.url.xyz')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['thumbnail_src'], 'http://thumbnail.jpg')
- self.assertEqual(results[0]['img_src'], 'http://image.jpg')
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "items": [
- {
- "title": "Title",
- "score": 9999,
- "url": "http://www.url.xyz",
- "source": "...",
- "desc": "Description",
- "date": 1433260920,
- "_id": "db0aadd62c2a8565567ffc382f5c61fa",
- "favicon": "https://s.qwant.com/fav.ico"
- }
- ],
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- qwant.categories = ['news']
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://www.url.xyz')
- self.assertEqual(results[0]['content'], 'Description')
- self.assertIn('publishedDate', results[0])
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "items": [
- {
- "title": "Title",
- "score": 9999,
- "url": "http://www.url.xyz",
- "source": "...",
- "desc": "Description",
- "date": 1433260920,
- "_id": "db0aadd62c2a8565567ffc382f5c61fa",
- "favicon": "https://s.qwant.com/fav.ico"
- }
- ],
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- qwant.categories = ['social media']
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'http://www.url.xyz')
- self.assertEqual(results[0]['content'], 'Description')
- self.assertIn('publishedDate', results[0])
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "items": [
- {
- "title": "Title",
- "score": 9999,
- "url": "http://www.url.xyz",
- "source": "...",
- "desc": "Description",
- "date": 1433260920,
- "_id": "db0aadd62c2a8565567ffc382f5c61fa",
- "favicon": "https://s.qwant.com/fav.ico"
- }
- ],
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- qwant.categories = ['']
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "result": {
- "filters": []
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "status": "success",
- "data": {
- "query": {
- "locale": "en_us",
- "query": "Test",
- "offset": 10
- },
- "cache": {
- "key": "e66aa864c00147a0e3a16ff7a5efafde",
- "created": 1433092754,
- "expiration": 259200,
- "status": "miss",
- "age": 0
- }
- }
- }
- """
- response = mock.Mock(text=json)
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "status": "success"
- }
- """
- response = mock.Mock(text=json)
- results = qwant.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_searchcode_code.py b/searx/tests/engines/test_searchcode_code.py
deleted file mode 100644
index c0ac2025c..000000000
--- a/searx/tests/engines/test_searchcode_code.py
+++ /dev/null
@@ -1,75 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import searchcode_code
-from searx.testing import SearxTestCase
-
-
-class TestSearchcodeCodeEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = searchcode_code.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('searchcode.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, searchcode_code.response, None)
- self.assertRaises(AttributeError, searchcode_code.response, [])
- self.assertRaises(AttributeError, searchcode_code.response, '')
- self.assertRaises(AttributeError, searchcode_code.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(searchcode_code.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(searchcode_code.response(response), [])
-
- json = """
- {
- "matchterm": "test",
- "previouspage": null,
- "searchterm": "test",
- "query": "test",
- "total": 1000,
- "page": 0,
- "nextpage": 1,
- "results": [
- {
- "repo": "https://repo",
- "linescount": 1044,
- "location": "/tests",
- "name": "Name",
- "url": "https://url",
- "md5hash": "ecac6e479edd2b9406c9e08603cec655",
- "lines": {
- "1": "// Test 011",
- "2": "// Source: "
- },
- "id": 51223527,
- "filename": "File.CPP"
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = searchcode_code.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Name - File.CPP')
- self.assertEqual(results[0]['url'], 'https://url')
- self.assertEqual(results[0]['repository'], 'https://repo')
- self.assertEqual(results[0]['code_language'], 'cpp')
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.searchcode_code.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = searchcode_code.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_searchcode_doc.py b/searx/tests/engines/test_searchcode_doc.py
deleted file mode 100644
index b9dcf380b..000000000
--- a/searx/tests/engines/test_searchcode_doc.py
+++ /dev/null
@@ -1,73 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import searchcode_doc
-from searx.testing import SearxTestCase
-
-
-class TestSearchcodeDocEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = searchcode_doc.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('searchcode.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, searchcode_doc.response, None)
- self.assertRaises(AttributeError, searchcode_doc.response, [])
- self.assertRaises(AttributeError, searchcode_doc.response, '')
- self.assertRaises(AttributeError, searchcode_doc.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(searchcode_doc.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(searchcode_doc.response(response), [])
-
- json = """
- {
- "matchterm": "test",
- "previouspage": null,
- "searchterm": "test",
- "query": "test",
- "total": 60,
- "page": 0,
- "nextpage": 1,
- "results": [
- {
- "synopsis": "Synopsis",
- "displayname": null,
- "name": "test",
- "url": "http://url",
- "type": "Type",
- "icon": null,
- "namespace": "Namespace",
- "description": "Description"
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = searchcode_doc.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], '[Type] Namespace test')
- self.assertEqual(results[0]['url'], 'http://url')
- self.assertIn('Synopsis', results[0]['content'])
- self.assertIn('Type', results[0]['content'])
- self.assertIn('test', results[0]['content'])
- self.assertIn('Description', results[0]['content'])
-
- json = """
- {"toto":[
- {"id":200,"name":"Artist Name",
- "link":"http:\/\/www.searchcode_doc.com\/artist\/1217","type":"artist"}
- ]}
- """
- response = mock.Mock(text=json)
- results = searchcode_doc.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_soundcloud.py b/searx/tests/engines/test_soundcloud.py
deleted file mode 100644
index 85495dc57..000000000
--- a/searx/tests/engines/test_soundcloud.py
+++ /dev/null
@@ -1,192 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import soundcloud
-from searx.testing import SearxTestCase
-from urllib import quote_plus
-
-
-class TestSoundcloudEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = soundcloud.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('soundcloud.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, soundcloud.response, None)
- self.assertRaises(AttributeError, soundcloud.response, [])
- self.assertRaises(AttributeError, soundcloud.response, '')
- self.assertRaises(AttributeError, soundcloud.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(soundcloud.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(soundcloud.response(response), [])
-
- json = """
- {
- "collection": [
- {
- "kind": "track",
- "id": 159723640,
- "created_at": "2014/07/22 00:51:21 +0000",
- "user_id": 2976616,
- "duration": 303780,
- "commentable": true,
- "state": "finished",
- "original_content_size": 13236349,
- "last_modified": "2015/01/31 15:14:50 +0000",
- "sharing": "public",
- "tag_list": "seekae flume",
- "permalink": "seekae-test-recognise-flume-re-work",
- "streamable": true,
- "embeddable_by": "all",
- "downloadable": true,
- "purchase_url": "http://www.facebook.com/seekaemusic",
- "label_id": null,
- "purchase_title": "Seekae",
- "genre": "freedownload",
- "title": "This is the title",
- "description": "This is the content",
- "label_name": "Future Classic",
- "release": "",
- "track_type": "remix",
- "key_signature": "",
- "isrc": "",
- "video_url": null,
- "bpm": null,
- "release_year": 2014,
- "release_month": 7,
- "release_day": 22,
- "original_format": "mp3",
- "license": "all-rights-reserved",
- "uri": "https://api.soundcloud.com/tracks/159723640",
- "user": {
- "id": 2976616,
- "kind": "user",
- "permalink": "flume",
- "username": "Flume",
- "last_modified": "2014/11/24 19:21:29 +0000",
- "uri": "https://api.soundcloud.com/users/2976616",
- "permalink_url": "http://soundcloud.com/flume",
- "avatar_url": "https://i1.sndcdn.com/avatars-000044475439-4zi7ii-large.jpg"
- },
- "permalink_url": "http://soundcloud.com/this.is.the.url",
- "artwork_url": "https://i1.sndcdn.com/artworks-000085857162-xdxy5c-large.jpg",
- "waveform_url": "https://w1.sndcdn.com/DWrL1lAN8BkP_m.png",
- "stream_url": "https://api.soundcloud.com/tracks/159723640/stream",
- "download_url": "https://api.soundcloud.com/tracks/159723640/download",
- "playback_count": 2190687,
- "download_count": 54856,
- "favoritings_count": 49061,
- "comment_count": 826,
- "likes_count": 49061,
- "reposts_count": 15910,
- "attachments_uri": "https://api.soundcloud.com/tracks/159723640/attachments",
- "policy": "ALLOW"
- }
- ],
- "total_results": 375750,
- "next_href": "https://api.soundcloud.com/search?&q=test",
- "tx_id": ""
- }
- """
- response = mock.Mock(text=json)
- results = soundcloud.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'http://soundcloud.com/this.is.the.url')
- self.assertEqual(results[0]['content'], 'This is the content')
- self.assertIn(quote_plus('https://api.soundcloud.com/tracks/159723640'), results[0]['embedded'])
-
- json = """
- {
- "collection": [
- {
- "kind": "user",
- "id": 159723640,
- "created_at": "2014/07/22 00:51:21 +0000",
- "user_id": 2976616,
- "duration": 303780,
- "commentable": true,
- "state": "finished",
- "original_content_size": 13236349,
- "last_modified": "2015/01/31 15:14:50 +0000",
- "sharing": "public",
- "tag_list": "seekae flume",
- "permalink": "seekae-test-recognise-flume-re-work",
- "streamable": true,
- "embeddable_by": "all",
- "downloadable": true,
- "purchase_url": "http://www.facebook.com/seekaemusic",
- "label_id": null,
- "purchase_title": "Seekae",
- "genre": "freedownload",
- "title": "This is the title",
- "description": "This is the content",
- "label_name": "Future Classic",
- "release": "",
- "track_type": "remix",
- "key_signature": "",
- "isrc": "",
- "video_url": null,
- "bpm": null,
- "release_year": 2014,
- "release_month": 7,
- "release_day": 22,
- "original_format": "mp3",
- "license": "all-rights-reserved",
- "uri": "https://api.soundcloud.com/tracks/159723640",
- "user": {
- "id": 2976616,
- "kind": "user",
- "permalink": "flume",
- "username": "Flume",
- "last_modified": "2014/11/24 19:21:29 +0000",
- "uri": "https://api.soundcloud.com/users/2976616",
- "permalink_url": "http://soundcloud.com/flume",
- "avatar_url": "https://i1.sndcdn.com/avatars-000044475439-4zi7ii-large.jpg"
- },
- "permalink_url": "http://soundcloud.com/this.is.the.url",
- "artwork_url": "https://i1.sndcdn.com/artworks-000085857162-xdxy5c-large.jpg",
- "waveform_url": "https://w1.sndcdn.com/DWrL1lAN8BkP_m.png",
- "stream_url": "https://api.soundcloud.com/tracks/159723640/stream",
- "download_url": "https://api.soundcloud.com/tracks/159723640/download",
- "playback_count": 2190687,
- "download_count": 54856,
- "favoritings_count": 49061,
- "comment_count": 826,
- "likes_count": 49061,
- "reposts_count": 15910,
- "attachments_uri": "https://api.soundcloud.com/tracks/159723640/attachments",
- "policy": "ALLOW"
- }
- ],
- "total_results": 375750,
- "next_href": "https://api.soundcloud.com/search?&q=test",
- "tx_id": ""
- }
- """
- response = mock.Mock(text=json)
- results = soundcloud.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {
- "collection": [],
- "total_results": 375750,
- "next_href": "https://api.soundcloud.com/search?&q=test",
- "tx_id": ""
- }
- """
- response = mock.Mock(text=json)
- results = soundcloud.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_spotify.py b/searx/tests/engines/test_spotify.py
deleted file mode 100644
index fd274abbd..000000000
--- a/searx/tests/engines/test_spotify.py
+++ /dev/null
@@ -1,124 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import spotify
-from searx.testing import SearxTestCase
-
-
-class TestSpotifyEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = spotify.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('spotify.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, spotify.response, None)
- self.assertRaises(AttributeError, spotify.response, [])
- self.assertRaises(AttributeError, spotify.response, '')
- self.assertRaises(AttributeError, spotify.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(spotify.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(spotify.response(response), [])
-
- json = """
- {
- "tracks": {
- "href": "https://api.spotify.com/v1/search?query=nosfell&offset=0&limit=20&type=track",
- "items": [
- {
- "album": {
- "album_type": "album",
- "external_urls": {
- "spotify": "https://open.spotify.com/album/5c9ap1PBkSGLxT3J73toxA"
- },
- "href": "https://api.spotify.com/v1/albums/5c9ap1PBkSGLxT3J73toxA",
- "id": "5c9ap1PBkSGLxT3J73toxA",
- "name": "Album Title",
- "type": "album",
- "uri": "spotify:album:5c9ap1PBkSGLxT3J73toxA"
- },
- "artists": [
- {
- "external_urls": {
- "spotify": "https://open.spotify.com/artist/0bMc6b75FfZEpQHG1jifKu"
- },
- "href": "https://api.spotify.com/v1/artists/0bMc6b75FfZEpQHG1jifKu",
- "id": "0bMc6b75FfZEpQHG1jifKu",
- "name": "Artist Name",
- "type": "artist",
- "uri": "spotify:artist:0bMc6b75FfZEpQHG1jifKu"
- }
- ],
- "disc_number": 1,
- "duration_ms": 202386,
- "explicit": false,
- "external_ids": {
- "isrc": "FRV640600067"
- },
- "external_urls": {
- "spotify": "https://open.spotify.com/track/2GzvFiedqW8hgqUpWcASZa"
- },
- "href": "https://api.spotify.com/v1/tracks/2GzvFiedqW8hgqUpWcASZa",
- "id": "1000",
- "is_playable": true,
- "name": "Title of track",
- "popularity": 6,
- "preview_url": "https://p.scdn.co/mp3-preview/7b8ecda580965a066b768c2647f877e43f7b1a0a",
- "track_number": 3,
- "type": "track",
- "uri": "spotify:track:2GzvFiedqW8hgqUpWcASZa"
- }
- ],
- "limit": 20,
- "next": "https://api.spotify.com/v1/search?query=nosfell&offset=20&limit=20&type=track",
- "offset": 0,
- "previous": null,
- "total": 107
- }
- }
- """
- response = mock.Mock(text=json)
- results = spotify.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title of track')
- self.assertEqual(results[0]['url'], 'https://open.spotify.com/track/2GzvFiedqW8hgqUpWcASZa')
- self.assertEqual(results[0]['content'], 'Artist Name &bull; Album Title &bull; Title of track')
- self.assertIn('1000', results[0]['embedded'])
-
- json = """
- {
- "tracks": {
- "href": "https://api.spotify.com/v1/search?query=nosfell&offset=0&limit=20&type=track",
- "items": [
- {
- "href": "https://api.spotify.com/v1/tracks/2GzvFiedqW8hgqUpWcASZa",
- "id": "1000",
- "is_playable": true,
- "name": "Title of track",
- "popularity": 6,
- "preview_url": "https://p.scdn.co/mp3-preview/7b8ecda580965a066b768c2647f877e43f7b1a0a",
- "track_number": 3,
- "type": "album",
- "uri": "spotify:track:2GzvFiedqW8hgqUpWcASZa"
- }
- ],
- "limit": 20,
- "next": "https://api.spotify.com/v1/search?query=nosfell&offset=20&limit=20&type=track",
- "offset": 0,
- "previous": null,
- "total": 107
- }
- }
- """
- response = mock.Mock(text=json)
- results = spotify.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_stackoverflow.py b/searx/tests/engines/test_stackoverflow.py
deleted file mode 100644
index 18a1ff4bd..000000000
--- a/searx/tests/engines/test_stackoverflow.py
+++ /dev/null
@@ -1,106 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import stackoverflow
-from searx.testing import SearxTestCase
-
-
-class TestStackoverflowEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = stackoverflow.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('stackoverflow.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, stackoverflow.response, None)
- self.assertRaises(AttributeError, stackoverflow.response, [])
- self.assertRaises(AttributeError, stackoverflow.response, '')
- self.assertRaises(AttributeError, stackoverflow.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(stackoverflow.response(response), [])
-
- html = """
- <div class="question-summary search-result" id="answer-id-1783426">
- <div class="statscontainer">
- <div class="statsarrow"></div>
- <div class="stats">
- <div class="vote">
- <div class="votes answered">
- <span class="vote-count-post "><strong>2583</strong></span>
- <div class="viewcount">votes</div>
- </div>
- </div>
- </div>
- </div>
- <div class="summary">
- <div class="result-link">
- <span>
- <a href="/questions/this.is.the.url"
- data-searchsession="/questions"
- title="Checkout remote Git branch">
- This is the title
- </a>
- </span>
- </div>
- <div class="excerpt">
- This is the content
- </div>
- <div class="tags user-tags t-git t-git-checkout t-remote-branch">
- </div>
- <div class="started fr">
- answered <span title="2009-11-23 14:26:08Z" class="relativetime">nov 23 '09</span> by
- <a href="/users/214090/hallski">hallski</a>
- </div>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = stackoverflow.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://stackoverflow.com/questions/this.is.the.url')
- self.assertEqual(results[0]['content'], 'This is the content')
-
- html = """
- <div class="statscontainer">
- <div class="statsarrow"></div>
- <div class="stats">
- <div class="vote">
- <div class="votes answered">
- <span class="vote-count-post "><strong>2583</strong></span>
- <div class="viewcount">votes</div>
- </div>
- </div>
- </div>
- </div>
- <div class="summary">
- <div class="result-link">
- <span>
- <a href="/questions/this.is.the.url"
- data-searchsession="/questions"
- title="Checkout remote Git branch">
- This is the title
- </a>
- </span>
- </div>
- <div class="excerpt">
- This is the content
- </div>
- <div class="tags user-tags t-git t-git-checkout t-remote-branch">
- </div>
- <div class="started fr">
- answered <span title="2009-11-23 14:26:08Z" class="relativetime">nov 23 '09</span> by
- <a href="/users/214090/hallski">hallski</a>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = stackoverflow.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_startpage.py b/searx/tests/engines/test_startpage.py
deleted file mode 100644
index 9a1a09bc7..000000000
--- a/searx/tests/engines/test_startpage.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import startpage
-from searx.testing import SearxTestCase
-
-
-class TestStartpageEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = startpage.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn('startpage.com', params['url'])
- self.assertIn('data', params)
- self.assertIn('query', params['data'])
- self.assertIn(query, params['data']['query'])
- self.assertIn('with_language', params['data'])
- self.assertIn('lang_fr', params['data']['with_language'])
-
- dicto['language'] = 'all'
- params = startpage.request(query, dicto)
- self.assertNotIn('with_language', params['data'])
-
- def test_response(self):
- self.assertRaises(AttributeError, startpage.response, None)
- self.assertRaises(AttributeError, startpage.response, [])
- self.assertRaises(AttributeError, startpage.response, '')
- self.assertRaises(AttributeError, startpage.response, '[]')
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(startpage.response(response), [])
-
- html = """
- <div class='result' style=' *width : auto; *margin-right : 10%;'>
- <h3>
- <a href='http://this.should.be.the.link/' id='title_2' name='title_2' >
- This should be the title
- </a>
- <span id='title_stars_2' name='title_stars_2'> </span>
- </h3>
- <p class='desc clk'>
- This should be the content.
- </p>
- <p>
- <span class='url'>www.speed<b>test</b>.net/fr/
- </span>
- -
- <A class="proxy" id="proxy_link" HREF="https://ixquick-proxy.com/do/spg/proxy?ep=&edata=&ek=&ekdata="
- class='proxy'>
- Navigation avec Ixquick Proxy
- </A>
- -
- <A HREF="https://ixquick-proxy.com/do/spg/highlight.pl?l=francais&c=hf&cat=web&q=test&rl=NONE&rid=
- &hlq=https://startpage.com/do/search&mtabp=-1&mtcmd=process_search&mtlanguage=francais&mtengine0=
- &mtcat=web&u=http:%2F%2Fwww.speedtest.net%2Ffr%2F" class='proxy'>
- Mis en surbrillance
- </A>
- </p>
- </div>
- """
- response = mock.Mock(content=html)
- results = startpage.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
-
- html = """
- <div class='result' style=' *width : auto; *margin-right : 10%;'>
- <h3>
- <a href='http://www.google.com/aclk?sa=l&ai=C' id='title_2' name='title_2' >
- This should be the title
- </a>
- <span id='title_stars_2' name='title_stars_2'> </span>
- </h3>
- <p class='desc clk'>
- This should be the content.
- </p>
- <p>
- <span class='url'>www.speed<b>test</b>.net/fr/
- </span>
- -
- <A class="proxy" id="proxy_link" HREF="https://ixquick-proxy.com/do/spg/proxy?ep=&edata=&ek=&ekdata="
- class='proxy'>
- Navigation avec Ixquick Proxy
- </A>
- -
- <A HREF="https://ixquick-proxy.com/do/spg/highlight.pl?l=francais&c=hf&cat=web&q=test&rl=NONE&rid=
- &hlq=https://startpage.com/do/search&mtabp=-1&mtcmd=process_search&mtlanguage=francais&mtengine0=
- &mtcat=web&u=http:%2F%2Fwww.speedtest.net%2Ffr%2F" class='proxy'>
- Mis en surbrillance
- </A>
- </p>
- </div>
- <div class='result' style=' *width : auto; *margin-right : 10%;'>
- <h3>
- <span id='title_stars_2' name='title_stars_2'> </span>
- </h3>
- <p class='desc clk'>
- This should be the content.
- </p>
- <p>
- <span class='url'>www.speed<b>test</b>.net/fr/
- </span>
- </p>
- </div>
- <div class='result' style=' *width : auto; *margin-right : 10%;'>
- <h3>
- <a href='http://this.should.be.the.link/' id='title_2' name='title_2' >
- This should be the title
- </a>
- <span id='title_stars_2' name='title_stars_2'> </span>
- </h3>
- <p>
- <span class='url'>www.speed<b>test</b>.net/fr/
- </span>
- -
- <A class="proxy" id="proxy_link" HREF="https://ixquick-proxy.com/do/spg/proxy?ep=&edata=&ek=&ekdata="
- class='proxy'>
- Navigation avec Ixquick Proxy
- </A>
- -
- <A HREF="https://ixquick-proxy.com/do/spg/highlight.pl?l=francais&c=hf&cat=web&q=test&rl=NONE&rid=
- &hlq=https://startpage.com/do/search&mtabp=-1&mtcmd=process_search&mtlanguage=francais&mtengine0=
- &mtcat=web&u=http:%2F%2Fwww.speedtest.net%2Ffr%2F" class='proxy'>
- Mis en surbrillance
- </A>
- </p>
- </div>
- """
- response = mock.Mock(content=html)
- results = startpage.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['content'], '')
diff --git a/searx/tests/engines/test_subtitleseeker.py b/searx/tests/engines/test_subtitleseeker.py
deleted file mode 100644
index a641601b2..000000000
--- a/searx/tests/engines/test_subtitleseeker.py
+++ /dev/null
@@ -1,169 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import subtitleseeker
-from searx.testing import SearxTestCase
-
-
-class TestSubtitleseekerEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = subtitleseeker.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('subtitleseeker.com' in params['url'])
-
- def test_response(self):
- dicto = defaultdict(dict)
- dicto['language'] = 'fr_FR'
- response = mock.Mock(search_params=dicto)
-
- self.assertRaises(AttributeError, subtitleseeker.response, None)
- self.assertRaises(AttributeError, subtitleseeker.response, [])
- self.assertRaises(AttributeError, subtitleseeker.response, '')
- self.assertRaises(AttributeError, subtitleseeker.response, '[]')
-
- response = mock.Mock(text='<html></html>', search_params=dicto)
- self.assertEqual(subtitleseeker.response(response), [])
-
- html = """
- <div class="boxRows">
- <div class="boxRowsInner" style="width:600px;">
- <img src="http://static.subtitleseeker.com/images/movie.gif"
- style="width:16px; height:16px;" class="icon">
- <a href="http://this.is.the.url/"
- class="blue" title="Title subtitle" >
- This is the Title
- </a>
- <br><br>
- <span class="f10b grey-dark arial" style="padding:0px 0px 5px 20px">
- "Alternative Title"
- </span>
- </div>
- <div class="boxRowsInner f12b red" style="width:70px;">
- 1998
- </div>
- <div class="boxRowsInner grey-web f12" style="width:120px;">
- <img src="http://static.subtitleseeker.com/images/basket_put.png"
- style="width:16px; height:16px;" class="icon">
- 1039 Subs
- </div>
- <div class="boxRowsInner grey-web f10" style="width:130px;">
- <img src="http://static.subtitleseeker.com/images/arrow_refresh_small.png"
- style="width:16px; height:16px;" class="icon">
- 1 hours ago
- </div>
- <div class="clear"></div>
- </div>
- """
- response = mock.Mock(text=html, search_params=dicto)
- results = subtitleseeker.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the Title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/French/')
- self.assertIn('1998', results[0]['content'])
- self.assertIn('1039 Subs', results[0]['content'])
- self.assertIn('Alternative Title', results[0]['content'])
-
- html = """
- <div class="boxRows">
- <div class="boxRowsInner" style="width:600px;">
- <img src="http://static.subtitleseeker.com/images/movie.gif"
- style="width:16px; height:16px;" class="icon">
- <a href="http://this.is.the.url/"
- class="blue" title="Title subtitle" >
- This is the Title
- </a>
- </div>
- <div class="boxRowsInner f12b red" style="width:70px;">
- 1998
- </div>
- <div class="boxRowsInner grey-web f12" style="width:120px;">
- <img src="http://static.subtitleseeker.com/images/basket_put.png"
- style="width:16px; height:16px;" class="icon">
- 1039 Subs
- </div>
- <div class="boxRowsInner grey-web f10" style="width:130px;">
- <img src="http://static.subtitleseeker.com/images/arrow_refresh_small.png"
- style="width:16px; height:16px;" class="icon">
- 1 hours ago
- </div>
- <div class="clear"></div>
- </div>
- """
- dicto['language'] = 'all'
- response = mock.Mock(text=html, search_params=dicto)
- results = subtitleseeker.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the Title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
- self.assertIn('1998', results[0]['content'])
- self.assertIn('1039 Subs', results[0]['content'])
-
- html = """
- <div class="boxRows">
- <div class="boxRowsInner" style="width:600px;">
- <img src="http://static.subtitleseeker.com/images/movie.gif"
- style="width:16px; height:16px;" class="icon">
- <a href="http://this.is.the.url/"
- class="blue" title="Title subtitle" >
- This is the Title
- </a>
- </div>
- <div class="boxRowsInner f12b red" style="width:70px;">
- 1998
- </div>
- <div class="boxRowsInner grey-web f12" style="width:120px;">
- <img src="http://static.subtitleseeker.com/images/basket_put.png"
- style="width:16px; height:16px;" class="icon">
- 1039 Subs
- </div>
- <div class="boxRowsInner grey-web f10" style="width:130px;">
- <img src="http://static.subtitleseeker.com/images/arrow_refresh_small.png"
- style="width:16px; height:16px;" class="icon">
- 1 hours ago
- </div>
- <div class="clear"></div>
- </div>
- """
- subtitleseeker.language = 'English'
- response = mock.Mock(text=html, search_params=dicto)
- results = subtitleseeker.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the Title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/English/')
- self.assertIn('1998', results[0]['content'])
- self.assertIn('1039 Subs', results[0]['content'])
-
- html = """
- <div class="boxRowsInner" style="width:600px;">
- <img src="http://static.subtitleseeker.com/images/movie.gif"
- style="width:16px; height:16px;" class="icon">
- <a href="http://this.is.the.url/"
- class="blue" title="Title subtitle" >
- This is the Title
- </a>
- </div>
- <div class="boxRowsInner f12b red" style="width:70px;">
- 1998
- </div>
- <div class="boxRowsInner grey-web f12" style="width:120px;">
- <img src="http://static.subtitleseeker.com/images/basket_put.png"
- style="width:16px; height:16px;" class="icon">
- 1039 Subs
- </div>
- <div class="boxRowsInner grey-web f10" style="width:130px;">
- <img src="http://static.subtitleseeker.com/images/arrow_refresh_small.png"
- style="width:16px; height:16px;" class="icon">
- 1 hours ago
- </div>
- """
- response = mock.Mock(text=html, search_params=dicto)
- results = subtitleseeker.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_swisscows.py b/searx/tests/engines/test_swisscows.py
deleted file mode 100644
index 3b4ce7b0f..000000000
--- a/searx/tests/engines/test_swisscows.py
+++ /dev/null
@@ -1,128 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import swisscows
-from searx.testing import SearxTestCase
-
-
-class TestSwisscowsEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'de_DE'
- params = swisscows.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('swisscows.ch' in params['url'])
- self.assertTrue('uiLanguage=de' in params['url'])
- self.assertTrue('region=de-DE' in params['url'])
-
- dicto['language'] = 'all'
- params = swisscows.request(query, dicto)
- self.assertTrue('uiLanguage=browser' in params['url'])
- self.assertTrue('region=browser' in params['url'])
-
- dicto['category'] = 'images'
- params = swisscows.request(query, dicto)
- self.assertIn('image', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, swisscows.response, None)
- self.assertRaises(AttributeError, swisscows.response, [])
- self.assertRaises(AttributeError, swisscows.response, '')
- self.assertRaises(AttributeError, swisscows.response, '[]')
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(swisscows.response(response), [])
-
- response = mock.Mock(content='<html></html>')
- self.assertEqual(swisscows.response(response), [])
-
- html = u"""
- <script>
- App.Dispatcher.dispatch("initialize", {
- html5history: true,
- initialData: {"Request":
- {"Page":1,
- "ItemsCount":1,
- "Query":"This should ",
- "NormalizedQuery":"This should ",
- "Region":"de-AT",
- "UILanguage":"de"},
- "Results":{"items":[
- {"Title":"\uE000This should\uE001 be the title",
- "Description":"\uE000This should\uE001 be the content.",
- "Url":"http://this.should.be.the.link/",
- "DisplayUrl":"www.\uE000this.should.be.the\uE001.link",
- "Id":"782ef287-e439-451c-b380-6ebc14ba033d"},
- {"Title":"Datei:This should1.svg",
- "Url":"https://i.swisscows.ch/?link=http%3a%2f%2fts2.mm.This/should1.png",
- "SourceUrl":"http://de.wikipedia.org/wiki/Datei:This should1.svg",
- "DisplayUrl":"de.wikipedia.org/wiki/Datei:This should1.svg",
- "Width":950,
- "Height":534,
- "FileSize":92100,
- "ContentType":"image/jpeg",
- "Thumbnail":{
- "Url":"https://i.swisscows.ch/?link=http%3a%2f%2fts2.mm.This/should1.png",
- "ContentType":"image/jpeg",
- "Width":300,
- "Height":168,
- "FileSize":9134},
- "Id":"6a97a542-8f65-425f-b7f6-1178c3aba7be"
- }
- ],"TotalCount":55300,
- "Query":"This should "
- },
- "Images":[{"Title":"Datei:This should.svg",
- "Url":"https://i.swisscows.ch/?link=http%3a%2f%2fts2.mm.This/should.png",
- "SourceUrl":"http://de.wikipedia.org/wiki/Datei:This should.svg",
- "DisplayUrl":"de.wikipedia.org/wiki/Datei:This should.svg",
- "Width":1280,
- "Height":677,
- "FileSize":50053,
- "ContentType":"image/png",
- "Thumbnail":{"Url":"https://i.swisscows.ch/?link=http%3a%2f%2fts2.mm.This/should.png",
- "ContentType":"image/png",
- "Width":300,
- "Height":158,
- "FileSize":8023},
- "Id":"ae230fd8-a06a-47d6-99d5-e74766d8143a"}]},
- environment: "production"
- }).then(function (options) {
- $('#Search_Form').on('submit', function (e) {
- if (!Modernizr.history) return;
- e.preventDefault();
-
- var $form = $(this),
- $query = $('#Query'),
- query = $.trim($query.val()),
- path = App.Router.makePath($form.attr('action'), null, $form.serializeObject())
-
- if (query.length) {
- options.html5history ?
- ReactRouter.HistoryLocation.push(path) :
- ReactRouter.RefreshLocation.push(path);
- }
- else $('#Query').trigger('blur');
- });
-
- });
- </script>
- """
- response = mock.Mock(content=html)
- results = swisscows.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 3)
- self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
- self.assertEqual(results[0]['content'], 'This should be the content.')
- self.assertEqual(results[1]['title'], 'Datei:This should1.svg')
- self.assertEqual(results[1]['url'], 'http://de.wikipedia.org/wiki/Datei:This should1.svg')
- self.assertEqual(results[1]['img_src'], 'http://ts2.mm.This/should1.png')
- self.assertEqual(results[1]['template'], 'images.html')
- self.assertEqual(results[2]['title'], 'Datei:This should.svg')
- self.assertEqual(results[2]['url'], 'http://de.wikipedia.org/wiki/Datei:This should.svg')
- self.assertEqual(results[2]['img_src'], 'http://ts2.mm.This/should.png')
- self.assertEqual(results[2]['template'], 'images.html')
diff --git a/searx/tests/engines/test_twitter.py b/searx/tests/engines/test_twitter.py
deleted file mode 100644
index b444b48ee..000000000
--- a/searx/tests/engines/test_twitter.py
+++ /dev/null
@@ -1,502 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import twitter
-from searx.testing import SearxTestCase
-
-
-class TestTwitterEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
- params = twitter.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('twitter.com', params['url'])
- self.assertIn('cookies', params)
- self.assertIn('lang', params['cookies'])
- self.assertIn('fr', params['cookies']['lang'])
-
- dicto['language'] = 'all'
- params = twitter.request(query, dicto)
- self.assertIn('cookies', params)
- self.assertIn('lang', params['cookies'])
- self.assertIn('en', params['cookies']['lang'])
-
- def test_response(self):
- self.assertRaises(AttributeError, twitter.response, None)
- self.assertRaises(AttributeError, twitter.response, [])
- self.assertRaises(AttributeError, twitter.response, '')
- self.assertRaises(AttributeError, twitter.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(twitter.response(response), [])
-
- html = """
- <li class="js-stream-item stream-item stream-item expanding-stream-item" data-item-id="563005573290287105"
- id="stream-item-tweet-563005573290287105" data-item-type="tweet">
- <div class="tweet original-tweet js-stream-tweet js-actionable-tweet js-profile-popup-actionable
- js-original-tweet has-cards has-native-media" data-tweet-id="563005573290287105" data-disclosure-type=""
- data-item-id="563005573290287105" data-screen-name="Jalopnik" data-name="Jalopnik"
- data-user-id="3060631" data-has-native-media="true" data-has-cards="true" data-card-type="photo"
- data-expanded-footer="&lt;div class=&quot;js-tweet-details-fixer
- tweet-details-fixer&quot;&gt;&#10;&#10;&#10;
- &lt;div class=&quot;cards-media-container js-media-container&quot;&gt;&lt;div
- data-card-url=&quot;//twitter.com/Jalopnik/status/563005573290287105/photo/1&quot; data-card-type=&quot;
- photo&quot; class=&quot;cards-base cards-multimedia&quot; data-element-context=&quot;platform_photo_card
- &quot;&gt;&#10;&#10;&#10; &lt;a class=&quot;media media-thumbnail twitter-timeline-link is-preview
- &quot; data-url=&quot;https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg:large&quot;
- data-resolved-url-large=&quot;https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg:large&quot;
- href=&quot;//twitter.com/Jalopnik/status/563005573290287105/photo/1&quot;&gt;&#10;
- &lt;div class=&quot;&quot;&gt;&#10; &lt;img src=&quot;
- https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg&quot;
- alt=&quot;Embedded image permalink&quot; width=&quot;636&quot; height=&quot;309&quot;&gt;&#10;
- &lt;/div&gt;&#10;&#10; &lt;/a&gt;&#10;&#10; &lt;div class=&quot;cards-content&quot;&gt;&#10;
- &lt;div class=&quot;byline&quot;&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10;
- &#10;&lt;/div&gt;&#10;&#10;&#10;&#10;&#10;&lt;/div&gt;&#10;&#10;&#10;&#10; &lt;div
- class=&quot;js-machine-translated-tweet-container&quot;&gt;&lt;/div&gt;&#10; &lt;div
- class=&quot;js-tweet-stats-container tweet-stats-container &quot;&gt;&#10; &lt;/div&gt;&#10;&#10;
- &lt;div class=&quot;client-and-actions&quot;&gt;&#10; &lt;span class=&quot;metadata&quot;&gt;&#10;
- &lt;span&gt;5:06 PM - 4 Feb 2015&lt;/span&gt;&#10;&#10; &amp;middot; &lt;a
- class=&quot;permalink-link js-permalink js-nav&quot; href=&quot;/Jalopnik/status/563005573290287105
- &quot;tabindex=&quot;-1&quot;&gt;Details&lt;/a&gt;&#10; &#10;&#10; &#10; &#10;
- &#10;&#10; &lt;/span&gt;&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;/div&gt;&#10;" data-you-follow="false"
- data-you-block="false">
- <div class="context">
- </div>
- <div class="content">
- <div class="stream-item-header">
- <a class="account-group js-account-group js-action-profile js-user-profile-link js-nav"
- href="/Jalopnik" data-user-id="3060631">
- <img class="avatar js-action-profile-avatar"
- src="https://pbs.twimg.com/profile_images/2976430168/5cd4a59_bigger.jpeg" alt="">
- <strong class="fullname js-action-profile-name show-popup-with-id" data-aria-label-part>
- Jalopnik
- </strong>
- <span>&rlm;</span>
- <span class="username js-action-profile-name" data-aria-label-part>
- <s>@</s><b>TitleName</b>
- </span>
- </a>
- <small class="time">
- <a href="/this.is.the.url"
- class="tweet-timestamp js-permalink js-nav js-tooltip" title="5:06 PM - 4 Feb 2015" >
- <span class="u-hiddenVisually" data-aria-label-part="last">17 minutes ago</span>
- </a>
- </small>
- </div>
- <p class="js-tweet-text tweet-text" lang="en" data-aria-label-part="0">
- This is the content étude à€
- <a href="http://t.co/nRWsqQAwBL" rel="nofollow" dir="ltr"
- data-expanded-url="http://jalo.ps/ReMENu4" class="twitter-timeline-link"
- target="_blank" title="http://jalo.ps/ReMENu4" >
- <span class="tco-ellipsis">
- </span>
- <span class="invisible">http://</span><span class="js-display-url">link.in.tweet</span>
- <span class="invisible"></span>
- <span class="tco-ellipsis">
- <span class="invisible">&nbsp;</span>
- </span>
- </a>
- <a href="http://t.co/rbFsfeE0l3" class="twitter-timeline-link u-hidden"
- data-pre-embedded="true" dir="ltr">
- pic.twitter.com/rbFsfeE0l3
- </a>
- </p>
- <div class="expanded-content js-tweet-details-dropdown">
- </div>
- <div class="stream-item-footer">
- <a class="details with-icn js-details" href="/Jalopnik/status/563005573290287105">
- <span class="Icon Icon--photo">
- </span>
- <b>
- <span class="expand-stream-item js-view-details">
- View photo
- </span>
- <span class="collapse-stream-item js-hide-details">
- Hide photo
- </span>
- </b>
- </a>
- <span class="ProfileTweet-action--reply u-hiddenVisually">
- <span class="ProfileTweet-actionCount" aria-hidden="true" data-tweet-stat-count="0">
- <span class="ProfileTweet-actionCountForAria" >0 replies</span>
- </span>
- </span>
- <span class="ProfileTweet-action--retweet u-hiddenVisually">
- <span class="ProfileTweet-actionCount" data-tweet-stat-count="8">
- <span class="ProfileTweet-actionCountForAria" data-aria-label-part>8 retweets</span>
- </span>
- </span>
- <span class="ProfileTweet-action--favorite u-hiddenVisually">
- <span class="ProfileTweet-actionCount" data-tweet-stat-count="14">
- <span class="ProfileTweet-actionCountForAria" data-aria-label-part>14 favorites</span>
- </span>
- </span>
- <div role="group" aria-label="Tweet actions" class="ProfileTweet-actionList u-cf js-actions">
- <div class="ProfileTweet-action ProfileTweet-action--reply">
- <button class="ProfileTweet-actionButton u-textUserColorHover js-actionButton
- js-actionReply" data-modal="ProfileTweet-reply" type="button" title="Reply">
- <span class="Icon Icon--reply">
- </span>
- <span class="u-hiddenVisually">Reply</span>
- <span class="ProfileTweet-actionCount u-textUserColorHover
- ProfileTweet-actionCount--isZero">
- <span class="ProfileTweet-actionCountForPresentation" aria-hidden="true">
- </span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--retweet js-toggleState js-toggleRt">
- <button class="ProfileTweet-actionButton js-actionButton js-actionRetweet js-tooltip"
- title="Retweet" data-modal="ProfileTweet-retweet" type="button">
- <span class="Icon Icon--retweet">
- </span>
- <span class="u-hiddenVisually">Retweet</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">8</span>
- </span>
- </button>
- <button class="ProfileTweet-actionButtonUndo js-actionButton js-actionRetweet"
- data-modal="ProfileTweet-retweet" title="Undo retweet" type="button">
- <span class="Icon Icon--retweet">
- </span>
- <span class="u-hiddenVisually">Retweeted</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">8</span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--favorite js-toggleState">
- <button class="ProfileTweet-actionButton js-actionButton js-actionFavorite js-tooltip"
- title="Favorite" type="button">
- <span class="Icon Icon--favorite">
- </span>
- <span class="u-hiddenVisually">Favorite</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">14</span>
- </span>
- </button>
- <button class="ProfileTweet-actionButtonUndo u-linkClean js-actionButton
- js-actionFavorite" title="Undo favorite" type="button">
- <span class="Icon Icon--favorite">
- </span>
- <span class="u-hiddenVisually">Favorited</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">
- 14
- </span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--more js-more-ProfileTweet-actions">
- <div class="dropdown">
- <button class="ProfileTweet-actionButton u-textUserColorHover dropdown-toggle
- js-tooltip js-dropdown-toggle" type="button" title="More">
- <span class="Icon Icon--dots">
- </span>
- <span class="u-hiddenVisually">More</span>
- </button>
- <div class="dropdown-menu">
- <div class="dropdown-caret">
- <div class="caret-outer">
- </div>
- <div class="caret-inner">
- </div>
- </div>
- <ul>
- <li class="share-via-dm js-actionShareViaDM" data-nav="share_tweet_dm">
- <button type="button" class="dropdown-link">
- Share via Direct Message
- </button>
- </li>
- <li class="embed-link js-actionEmbedTweet" data-nav="embed_tweet">
- <button type="button" class="dropdown-link">
- Embed Tweet
- </button>
- </li>
- <li class="mute-user-item pretty-link">
- <button type="button" class="dropdown-link">
- Mute
- </button>
- </li>
- <li class="unmute-user-item pretty-link">
- <button type="button" class="dropdown-link">
- Unmute
- </button>
- </li>
- <li class="block-or-report-link js-actionBlockOrReport"
- data-nav="block_or_report">
- <button type="button" class="dropdown-link">
- Block or report
- </button>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- """
- response = mock.Mock(text=html)
- results = twitter.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], '@TitleName')
- self.assertEqual(results[0]['url'], 'https://twitter.com/this.is.the.url')
- self.assertIn(u'This is the content', results[0]['content'])
- # self.assertIn(u'This is the content étude à€', results[0]['content'])
-
- html = """
- <li class="js-stream-item stream-item stream-item expanding-stream-item" data-item-id="563005573290287105"
- id="stream-item-tweet-563005573290287105" data-item-type="tweet">
- <div class="tweet original-tweet js-stream-tweet js-actionable-tweet js-profile-popup-actionable
- js-original-tweet has-cards has-native-media" data-tweet-id="563005573290287105" data-disclosure-type=""
- data-item-id="563005573290287105" data-screen-name="Jalopnik" data-name="Jalopnik"
- data-user-id="3060631" data-has-native-media="true" data-has-cards="true" data-card-type="photo"
- data-expanded-footer="&lt;div class=&quot;js-tweet-details-fixer
- tweet-details-fixer&quot;&gt;&#10;&#10;&#10;
- &lt;div class=&quot;cards-media-container js-media-container&quot;&gt;&lt;div
- data-card-url=&quot;//twitter.com/Jalopnik/status/563005573290287105/photo/1&quot; data-card-type=&quot;
- photo&quot; class=&quot;cards-base cards-multimedia&quot; data-element-context=&quot;platform_photo_card
- &quot;&gt;&#10;&#10;&#10; &lt;a class=&quot;media media-thumbnail twitter-timeline-link is-preview
- &quot; data-url=&quot;https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg:large&quot;
- data-resolved-url-large=&quot;https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg:large&quot;
- href=&quot;//twitter.com/Jalopnik/status/563005573290287105/photo/1&quot;&gt;&#10;
- &lt;div class=&quot;&quot;&gt;&#10; &lt;img src=&quot;
- https://pbs.twimg.com/media/B9Aylf5IMAAuziP.jpg&quot;
- alt=&quot;Embedded image permalink&quot; width=&quot;636&quot; height=&quot;309&quot;&gt;&#10;
- &lt;/div&gt;&#10;&#10; &lt;/a&gt;&#10;&#10; &lt;div class=&quot;cards-content&quot;&gt;&#10;
- &lt;div class=&quot;byline&quot;&gt;&#10; &#10; &lt;/div&gt;&#10; &#10; &lt;/div&gt;&#10;
- &#10;&lt;/div&gt;&#10;&#10;&#10;&#10;&#10;&lt;/div&gt;&#10;&#10;&#10;&#10; &lt;div
- class=&quot;js-machine-translated-tweet-container&quot;&gt;&lt;/div&gt;&#10; &lt;div
- class=&quot;js-tweet-stats-container tweet-stats-container &quot;&gt;&#10; &lt;/div&gt;&#10;&#10;
- &lt;div class=&quot;client-and-actions&quot;&gt;&#10; &lt;span class=&quot;metadata&quot;&gt;&#10;
- &lt;span&gt;5:06 PM - 4 Feb 2015&lt;/span&gt;&#10;&#10; &amp;middot; &lt;a
- class=&quot;permalink-link js-permalink js-nav&quot; href=&quot;/Jalopnik/status/563005573290287105
- &quot;tabindex=&quot;-1&quot;&gt;Details&lt;/a&gt;&#10; &#10;&#10; &#10; &#10;
- &#10;&#10; &lt;/span&gt;&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;/div&gt;&#10;" data-you-follow="false"
- data-you-block="false">
- <div class="context">
- </div>
- <div class="content">
- <div class="stream-item-header">
- <a class="account-group js-account-group js-action-profile js-user-profile-link js-nav"
- href="/Jalopnik" data-user-id="3060631">
- <img class="avatar js-action-profile-avatar"
- src="https://pbs.twimg.com/profile_images/2976430168/5cd4a59_bigger.jpeg" alt="">
- <strong class="fullname js-action-profile-name show-popup-with-id" data-aria-label-part>
- Jalopnik
- </strong>
- <span>&rlm;</span>
- <span class="username js-action-profile-name" data-aria-label-part>
- <s>@</s><b>TitleName</b>
- </span>
- </a>
- <small class="time">
- <a href="/this.is.the.url"
- class="tweet-timestamp js-permalink js-nav js-tooltip" title="5:06 PM - 4 Feb 2015" >
- <span class="_timestamp js-short-timestamp js-relative-timestamp" data-time="1423065963"
- data-time-ms="1423065963000" data-long-form="true" aria-hidden="true">
- 17m
- </span>
- <span class="u-hiddenVisually" data-aria-label-part="last">17 minutes ago</span>
- </a>
- </small>
- </div>
- <p class="js-tweet-text tweet-text" lang="en" data-aria-label-part="0">
- This is the content étude à€
- <a href="http://t.co/nRWsqQAwBL" rel="nofollow" dir="ltr"
- data-expanded-url="http://jalo.ps/ReMENu4" class="twitter-timeline-link"
- target="_blank" title="http://jalo.ps/ReMENu4" >
- <span class="tco-ellipsis">
- </span>
- <span class="invisible">http://</span><span class="js-display-url">link.in.tweet</span>
- <span class="invisible"></span>
- <span class="tco-ellipsis">
- <span class="invisible">&nbsp;</span>
- </span>
- </a>
- <a href="http://t.co/rbFsfeE0l3" class="twitter-timeline-link u-hidden"
- data-pre-embedded="true" dir="ltr">
- pic.twitter.com/rbFsfeE0l3
- </a>
- </p>
- <div class="expanded-content js-tweet-details-dropdown">
- </div>
- <div class="stream-item-footer">
- <a class="details with-icn js-details" href="/Jalopnik/status/563005573290287105">
- <span class="Icon Icon--photo">
- </span>
- <b>
- <span class="expand-stream-item js-view-details">
- View photo
- </span>
- <span class="collapse-stream-item js-hide-details">
- Hide photo
- </span>
- </b>
- </a>
- <span class="ProfileTweet-action--reply u-hiddenVisually">
- <span class="ProfileTweet-actionCount" aria-hidden="true" data-tweet-stat-count="0">
- <span class="ProfileTweet-actionCountForAria" >0 replies</span>
- </span>
- </span>
- <span class="ProfileTweet-action--retweet u-hiddenVisually">
- <span class="ProfileTweet-actionCount" data-tweet-stat-count="8">
- <span class="ProfileTweet-actionCountForAria" data-aria-label-part>8 retweets</span>
- </span>
- </span>
- <span class="ProfileTweet-action--favorite u-hiddenVisually">
- <span class="ProfileTweet-actionCount" data-tweet-stat-count="14">
- <span class="ProfileTweet-actionCountForAria" data-aria-label-part>14 favorites</span>
- </span>
- </span>
- <div role="group" aria-label="Tweet actions" class="ProfileTweet-actionList u-cf js-actions">
- <div class="ProfileTweet-action ProfileTweet-action--reply">
- <button class="ProfileTweet-actionButton u-textUserColorHover js-actionButton
- js-actionReply" data-modal="ProfileTweet-reply" type="button" title="Reply">
- <span class="Icon Icon--reply">
- </span>
- <span class="u-hiddenVisually">Reply</span>
- <span class="ProfileTweet-actionCount u-textUserColorHover
- ProfileTweet-actionCount--isZero">
- <span class="ProfileTweet-actionCountForPresentation" aria-hidden="true">
- </span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--retweet js-toggleState js-toggleRt">
- <button class="ProfileTweet-actionButton js-actionButton js-actionRetweet js-tooltip"
- title="Retweet" data-modal="ProfileTweet-retweet" type="button">
- <span class="Icon Icon--retweet">
- </span>
- <span class="u-hiddenVisually">Retweet</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">8</span>
- </span>
- </button>
- <button class="ProfileTweet-actionButtonUndo js-actionButton js-actionRetweet"
- data-modal="ProfileTweet-retweet" title="Undo retweet" type="button">
- <span class="Icon Icon--retweet">
- </span>
- <span class="u-hiddenVisually">Retweeted</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">8</span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--favorite js-toggleState">
- <button class="ProfileTweet-actionButton js-actionButton js-actionFavorite js-tooltip"
- title="Favorite" type="button">
- <span class="Icon Icon--favorite">
- </span>
- <span class="u-hiddenVisually">Favorite</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">14</span>
- </span>
- </button>
- <button class="ProfileTweet-actionButtonUndo u-linkClean js-actionButton
- js-actionFavorite" title="Undo favorite" type="button">
- <span class="Icon Icon--favorite">
- </span>
- <span class="u-hiddenVisually">Favorited</span>
- <span class="ProfileTweet-actionCount">
- <span class="ProfileTweet-actionCountForPresentation">
- 14
- </span>
- </span>
- </button>
- </div>
- <div class="ProfileTweet-action ProfileTweet-action--more js-more-ProfileTweet-actions">
- <div class="dropdown">
- <button class="ProfileTweet-actionButton u-textUserColorHover dropdown-toggle
- js-tooltip js-dropdown-toggle" type="button" title="More">
- <span class="Icon Icon--dots">
- </span>
- <span class="u-hiddenVisually">More</span>
- </button>
- <div class="dropdown-menu">
- <div class="dropdown-caret">
- <div class="caret-outer">
- </div>
- <div class="caret-inner">
- </div>
- </div>
- <ul>
- <li class="share-via-dm js-actionShareViaDM" data-nav="share_tweet_dm">
- <button type="button" class="dropdown-link">
- Share via Direct Message
- </button>
- </li>
- <li class="embed-link js-actionEmbedTweet" data-nav="embed_tweet">
- <button type="button" class="dropdown-link">
- Embed Tweet
- </button>
- </li>
- <li class="mute-user-item pretty-link">
- <button type="button" class="dropdown-link">
- Mute
- </button>
- </li>
- <li class="unmute-user-item pretty-link">
- <button type="button" class="dropdown-link">
- Unmute
- </button>
- </li>
- <li class="block-or-report-link js-actionBlockOrReport"
- data-nav="block_or_report">
- <button type="button" class="dropdown-link">
- Block or report
- </button>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- """
- response = mock.Mock(text=html)
- results = twitter.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], '@TitleName')
- self.assertEqual(results[0]['url'], 'https://twitter.com/this.is.the.url')
- self.assertIn(u'This is the content', results[0]['content'])
-
- html = """
- <li class="b_algo" u="0|5109|4755453613245655|UAGjXgIrPH5yh-o5oNHRx_3Zta87f_QO">
- <div Class="sa_mc">
- <div class="sb_tlst">
- <h2>
- <a href="http://this.should.be.the.link/" h="ID=SERP,5124.1">
- <strong>This</strong> should be the title</a>
- </h2>
- </div>
- <div class="sb_meta">
- <cite>
- <strong>this</strong>.meta.com</cite>
- <span class="c_tlbxTrg">
- <span class="c_tlbxH" H="BASE:CACHEDPAGEDEFAULT" K="SERP,5125.1">
- </span>
- </span>
- </div>
- <p>
- <strong>This</strong> should be the content.</p>
- </div>
- </li>
- """
- response = mock.Mock(text=html)
- results = twitter.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_vimeo.py b/searx/tests/engines/test_vimeo.py
deleted file mode 100644
index 50b1cb563..000000000
--- a/searx/tests/engines/test_vimeo.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import vimeo
-from searx.testing import SearxTestCase
-
-
-class TestVimeoEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = vimeo.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('vimeo.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, vimeo.response, None)
- self.assertRaises(AttributeError, vimeo.response, [])
- self.assertRaises(AttributeError, vimeo.response, '')
- self.assertRaises(AttributeError, vimeo.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(vimeo.response(response), [])
-
- html = """
- <div id="browse_content" class="results_grid" data-search-id="696d5f8366914ec4ffec33cf7652de384976d4f4">
- <ul class="js-browse_list clearfix browse browse_videos browse_videos_thumbnails kane"
- data-stream="c2VhcmNoOjo6ZGVzYzp7InF1ZXJ5IjoidGVzdCJ9">
- <li data-position="7" data-result-id="clip_79600943">
- <div class="clip_thumbnail">
- <a href="/videoid" class="js-result_url">
- <div class="thumbnail_wrapper">
- <img src="http://image.url.webp" class="js-clip_thumbnail_image">
- <div class="overlay overlay_clip_meta">
- <div class="meta_data_footer">
- <span class="clip_upload_date">
- <time datetime="2013-11-17T08:49:09-05:00"
- title="dimanche 17 novembre 2013 08:49">Il y a 1 an</time>
- </span>
- <span class="clip_likes">
- <img src="https://f.vimeocdn.com/images_v6/svg/heart-icon.svg">2 215
- </span>
- <span class="clip_comments">
- <img src="https://f.vimeocdn.com/images_v6/svg/comment-icon.svg">75
- </span>
- <span class="overlay meta_data_footer clip_duration">01:12</span>
- </div>
- </div>
- </div>
- <span class="title">This is the title</span>
- </a>
- </div>
- <div class="clip_thumbnail_attribution">
- <a href="/fedorshmidt">
- <img src="https://i.vimeocdn.com/portrait/6628061_100x100.jpg" class="avatar">
- <span class="display_name">Fedor Shmidt</span>
- </a>
- <span class="plays">2,1M lectures</span>
- </div>
- </li>
- </ul>
- </div>
- """
- response = mock.Mock(text=html)
- results = vimeo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://vimeo.com/videoid')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp')
- self.assertIn('/videoid', results[0]['embedded'])
-
- html = """
- <ol class="js-browse_list clearfix browse browse_videos browse_videos_thumbnails kane"
- data-stream="c2VhcmNoOjo6ZGVzYzp7InF1ZXJ5IjoidGVzdCJ9">
- <li id="clip_100785455" data-start-page="/search/page:1/sort:relevant/" data-position="1">
- <a href="/videoid" title="Futurama 3d (test shot)">
- <img src="http://image.url.webp"
- srcset="http://i.vimeocdn.com/video/482375085_590x332.webp 2x" alt=""
- class="thumbnail thumbnail_lg_wide">
- <div class="data">
- <p class="title">
- This is the title
- </p>
- <p class="meta">
- <time datetime="2014-07-15T04:16:27-04:00"
- title="mardi 15 juillet 2014 04:16">Il y a 6 mois</time>
- </p>
- </div>
- </a>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = vimeo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_www1x.py b/searx/tests/engines/test_www1x.py
deleted file mode 100644
index 9df8de6bf..000000000
--- a/searx/tests/engines/test_www1x.py
+++ /dev/null
@@ -1,57 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import www1x
-from searx.testing import SearxTestCase
-
-
-class TestWww1xEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- params = www1x.request(query, defaultdict(dict))
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('1x.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, www1x.response, None)
- self.assertRaises(AttributeError, www1x.response, [])
- self.assertRaises(AttributeError, www1x.response, '')
- self.assertRaises(AttributeError, www1x.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(www1x.response(response), [])
- html = """
- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE characters
- [
- <!ELEMENT characters (character*) >
- <!ELEMENT character (#PCDATA ) >
-
- <!ENTITY iexcl "&#161;" >
- <!ENTITY cent "&#162;" >
- <!ENTITY pound "&#163;" >
- ]
- ><root><searchresult><![CDATA[<table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td style="min-width: 220px;" valign="top">
- <div style="font-size: 30px; margin: 0px 0px 20px 0px;">Photos</div>
- <div>
- <a href="/photo/123456" class="dynamiclink">
-<img border="0" class="searchresult" src="/images/user/testimage-123456.jpg" style="width: 125px; height: 120px;">
- </a>
- <a title="sjoerd lammers street photography" href="/member/sjoerdlammers" class="dynamiclink">
-<img border="0" class="searchresult" src="/images/profile/60c48b394c677d2fa4d9e7d263aabf44-square.jpg">
- </a>
- </div>
- </td>
- </table>
- ]]></searchresult></root>
- """
- response = mock.Mock(text=html)
- results = www1x.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['url'], 'https://1x.com/photo/123456')
- self.assertEqual(results[0]['thumbnail_src'], 'https://1x.com/images/user/testimage-123456.jpg')
- self.assertEqual(results[0]['content'], '')
- self.assertEqual(results[0]['template'], 'images.html')
diff --git a/searx/tests/engines/test_www500px.py b/searx/tests/engines/test_www500px.py
deleted file mode 100644
index 8df15b945..000000000
--- a/searx/tests/engines/test_www500px.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import www500px
-from searx.testing import SearxTestCase
-
-
-class TestWww500pxImagesEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- params = www500px.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertTrue('500px.com' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, www500px.response, None)
- self.assertRaises(AttributeError, www500px.response, [])
- self.assertRaises(AttributeError, www500px.response, '')
- self.assertRaises(AttributeError, www500px.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(www500px.response(response), [])
-
- html = """
- <div class="photo">
- <a href="/this.should.be.the.url" data-ga-category="Photo Thumbnail" data-ga-action="Title">
- <img src="https://image.url/3.jpg?v=0" />
- </a>
- <div class="details">
- <div class="inside">
- <div class="title">
- <a href="/photo/64312705/branch-out-by-oliver-turpin?feature=">
- This is the title
- </a>
- </div>
- <div class="info">
- <a href="/ChronicleUK" data-ga-action="Image" data-ga-category="Photo Thumbnail">
- This is the content
- </a>
- </div>
- <div class="rating">44.8</div>
- </div>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = www500px.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://500px.com/this.should.be.the.url')
- self.assertEqual(results[0]['content'], 'This is the content')
- self.assertEqual(results[0]['thumbnail_src'], 'https://image.url/3.jpg?v=0')
- self.assertEqual(results[0]['img_src'], 'https://image.url/2048.jpg')
-
- html = """
- <a href="/this.should.be.the.url" data-ga-category="Photo Thumbnail" data-ga-action="Title">
- <img src="https://image.url/3.jpg?v=0" />
- </a>
- <div class="details">
- <div class="inside">
- <div class="title">
- <a href="/photo/64312705/branch-out-by-oliver-turpin?feature=">
- This is the title
- </a>
- </div>
- <div class="info">
- <a href="/ChronicleUK" data-ga-action="Image" data-ga-category="Photo Thumbnail">
- Oliver Turpin
- </a>
- </div>
- <div class="rating">44.8</div>
- </div>
- </div>
- """
- response = mock.Mock(text=html)
- results = www500px.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_yacy.py b/searx/tests/engines/test_yacy.py
deleted file mode 100644
index f49532cf4..000000000
--- a/searx/tests/engines/test_yacy.py
+++ /dev/null
@@ -1,96 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import yacy
-from searx.testing import SearxTestCase
-
-
-class TestYacyEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = yacy.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('localhost', params['url'])
- self.assertIn('fr', params['url'])
-
- dicto['language'] = 'all'
- params = yacy.request(query, dicto)
- self.assertIn('url', params)
- self.assertNotIn('lr=lang_', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, yacy.response, None)
- self.assertRaises(AttributeError, yacy.response, [])
- self.assertRaises(AttributeError, yacy.response, '')
- self.assertRaises(AttributeError, yacy.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(yacy.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(yacy.response(response), [])
-
- json = """
- {
- "channels": [
- {
- "title": "YaCy P2P-Search for test",
- "description": "Search for test",
- "link": "http://search.yacy.de:7001/yacysearch.html?query=test&amp;resource=global&amp;contentdom=0",
- "image": {
- "url": "http://search.yacy.de:7001/env/grafics/yacy.png",
- "title": "Search for test",
- "link": "http://search.yacy.de:7001/yacysearch.html?query=test&amp;resource=global&amp;contentdom=0"
- },
- "totalResults": "249",
- "startIndex": "0",
- "itemsPerPage": "5",
- "searchTerms": "test",
- "items": [
- {
- "title": "This is the title",
- "link": "http://this.is.the.url",
- "code": "",
- "description": "This should be the content",
- "pubDate": "Sat, 08 Jun 2013 02:00:00 +0200",
- "size": "44213",
- "sizename": "43 kbyte",
- "guid": "lzh_1T_5FP-A",
- "faviconCode": "XTS4uQ_5FP-A",
- "host": "www.gamestar.de",
- "path": "/spiele/city-of-heroes-freedom/47019.html",
- "file": "47019.html",
- "urlhash": "lzh_1T_5FP-A",
- "ranking": "0.20106804"
- },
- {
- "title": "This is the title2",
- "icon": "/ViewImage.png?maxwidth=96&amp;maxheight=96&amp;code=7EbAbW6BpPOA",
- "image": "http://image.url/image.png",
- "cache": "/ViewImage.png?quadratic=&amp;url=http://golem.ivwbox.de/cgi-bin/ivw/CP/G_INET?d=14071378",
- "url": "http://this.is.the.url",
- "urlhash": "7EbAbW6BpPOA",
- "host": "www.golem.de",
- "width": "-1",
- "height": "-1"
- }
- ]
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = yacy.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 2)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url')
- self.assertEqual(results[0]['content'], 'This should be the content')
- self.assertEqual(results[1]['img_src'], 'http://image.url/image.png')
- self.assertEqual(results[1]['content'], '')
- self.assertEqual(results[1]['url'], 'http://this.is.the.url')
- self.assertEqual(results[1]['title'], 'This is the title2')
diff --git a/searx/tests/engines/test_yahoo.py b/searx/tests/engines/test_yahoo.py
deleted file mode 100644
index 11ef9db22..000000000
--- a/searx/tests/engines/test_yahoo.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import yahoo
-from searx.testing import SearxTestCase
-
-
-class TestYahooEngine(SearxTestCase):
-
- def test_parse_url(self):
- test_url = 'http://r.search.yahoo.com/_ylt=A0LEb9JUSKcAEGRXNyoA;_ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb' +\
- '2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10/RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=' +\
- 'dtcJsfP4mEeBOjnVfUQ-'
- url = yahoo.parse_url(test_url)
- self.assertEqual('https://this.is.the.url/', url)
-
- test_url = 'http://r.search.yahoo.com/_ylt=A0LElb9JUSKcAEGRXNyoA;_ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb' +\
- '2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10/RU=https%3a%2f%2fthis.is.the.url%2f/RS=' +\
- 'dtcJsfP4mEeBOjnVfUQ-'
- url = yahoo.parse_url(test_url)
- self.assertEqual('https://this.is.the.url/', url)
-
- test_url = 'https://this.is.the.url/'
- url = yahoo.parse_url(test_url)
- self.assertEqual('https://this.is.the.url/', url)
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = yahoo.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('search.yahoo.com', params['url'])
- self.assertIn('fr', params['url'])
- self.assertIn('cookies', params)
- self.assertIn('sB', params['cookies'])
- self.assertIn('fr', params['cookies']['sB'])
-
- dicto['language'] = 'all'
- params = yahoo.request(query, dicto)
- self.assertIn('cookies', params)
- self.assertIn('sB', params['cookies'])
- self.assertIn('en', params['cookies']['sB'])
- self.assertIn('en', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, yahoo.response, None)
- self.assertRaises(AttributeError, yahoo.response, [])
- self.assertRaises(AttributeError, yahoo.response, '')
- self.assertRaises(AttributeError, yahoo.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(yahoo.response(response), [])
-
- html = """
-<ol class="reg mb-15 searchCenterMiddle">
- <li class="first">
- <div class="dd algo fst Sr">
- <div class="compTitle">
- <h3 class="title"><a class=" td-u" href="http://r.search.yahoo.com/_ylt=A0LEb9JUSKcAEGRXNyoA;
- _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10
- /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-"
- target="_blank" data-bid="54e712e13671c">
- <b><b>This is the title</b></b></a>
- </h3>
- </div>
- <div class="compText aAbs">
- <p class="lh-18"><b><b>This is the </b>content</b>
- </p>
- </div>
- </div>
- </li>
- <li>
- <div class="dd algo lst Sr">
- <div class="compTitle">
- </div>
- <div class="compText aAbs">
- <p class="lh-18">This is the second content</p>
- </div>
- </div>
- </li>
-</ol>
-<div class="dd assist fst lst AlsoTry" data-bid="54e712e138d04">
- <div class="compTitle mb-4 h-17">
- <h3 class="title">Also Try</h3> </div>
- <table class="compTable m-0 ac-1st td-u fz-ms">
- <tbody>
- <tr>
- <td class="w-50p pr-28"><a href="https://search.yahoo.com/"><B>This is the </B>suggestion<B></B></a>
- </td>
- </tr>
- </table>
-</div>
- """
- response = mock.Mock(text=html)
- results = yahoo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 2)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://this.is.the.url/')
- self.assertEqual(results[0]['content'], 'This is the content')
- self.assertEqual(results[1]['suggestion'], 'This is the suggestion')
-
- html = """
-<ol class="reg mb-15 searchCenterMiddle">
- <li class="first">
- <div class="dd algo fst Sr">
- <div class="compTitle">
- <h3 class="title"><a class=" td-u" href="http://r.search.yahoo.com/_ylt=A0LEb9JUSKcAEGRXNyoA;
- _ylu=X3oDMTEzZm1qazYwBHNlYwNzcgRwb3MDMQRjb2xvA2Jm2dGlkA1NNRTcwM18x/RV=2/RE=1423106085/RO=10
- /RU=https%3a%2f%2fthis.is.the.url%2f/RK=0/RS=dtcJsfP4mEeBOjnVfUQ-"
- target="_blank" data-bid="54e712e13671c">
- <b><b>This is the title</b></b></a>
- </h3>
- </div>
- <div class="compText aAbs">
- <p class="lh-18"><b><b>This is the </b>content</b>
- </p>
- </div>
- </div>
- </li>
-</ol>
- """
- response = mock.Mock(text=html)
- results = yahoo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title')
- self.assertEqual(results[0]['url'], 'https://this.is.the.url/')
- self.assertEqual(results[0]['content'], 'This is the content')
-
- html = """
- <li class="b_algo" u="0|5109|4755453613245655|UAGjXgIrPH5yh-o5oNHRx_3Zta87f_QO">
- </li>
- """
- response = mock.Mock(text=html)
- results = yahoo.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_yahoo_news.py b/searx/tests/engines/test_yahoo_news.py
deleted file mode 100644
index 4d7fc0a10..000000000
--- a/searx/tests/engines/test_yahoo_news.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-from datetime import datetime
-import mock
-from searx.engines import yahoo_news
-from searx.testing import SearxTestCase
-
-
-class TestYahooNewsEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
- params = yahoo_news.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('news.search.yahoo.com', params['url'])
- self.assertIn('fr', params['url'])
- self.assertIn('cookies', params)
- self.assertIn('sB', params['cookies'])
- self.assertIn('fr', params['cookies']['sB'])
-
- dicto['language'] = 'all'
- params = yahoo_news.request(query, dicto)
- self.assertIn('cookies', params)
- self.assertIn('sB', params['cookies'])
- self.assertIn('en', params['cookies']['sB'])
- self.assertIn('en', params['url'])
-
- def test_sanitize_url(self):
- url = "test.url"
- self.assertEqual(url, yahoo_news.sanitize_url(url))
-
- url = "www.yahoo.com/;_ylt=test"
- self.assertEqual("www.yahoo.com/", yahoo_news.sanitize_url(url))
-
- def test_response(self):
- self.assertRaises(AttributeError, yahoo_news.response, None)
- self.assertRaises(AttributeError, yahoo_news.response, [])
- self.assertRaises(AttributeError, yahoo_news.response, '')
- self.assertRaises(AttributeError, yahoo_news.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(yahoo_news.response(response), [])
-
- html = """
- <ol class=" reg searchCenterMiddle">
- <li class="first">
- <div class="compTitle">
- <h3>
- <a class="yschttl spt" href="http://this.is.the.url" target="_blank">
- This is
- the <b>title</b>...
- </a>
- </h3>
- </div>
- <div>
- <span class="cite">Business via Yahoo!</span>
- <span class="tri fc-2nd ml-10">May 01 10:00 AM</span>
- </div>
- <div class="compText">
- This is the content
- </div>
- </li>
- <li class="first">
- <div class="compTitle">
- <h3>
- <a class="yschttl spt" target="_blank">
- </a>
- </h3>
- </div>
- <div class="compText">
- </div>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = yahoo_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'This is the title...')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
- self.assertEqual(results[0]['content'], 'This is the content')
-
- html = """
- <ol class=" reg searchCenterMiddle">
- <li class="first">
- <div class="compTitle">
- <h3>
- <a class="yschttl spt" href="http://this.is.the.url" target="_blank">
- This is
- the <b>title</b>...
- </a>
- </h3>
- </div>
- <div>
- <span class="cite">Business via Yahoo!</span>
- <span class="tri fc-2nd ml-10">2 hours, 22 minutes ago</span>
- </div>
- <div class="compText">
- This is the content
- </div>
- </li>
- <li>
- <div class="compTitle">
- <h3>
- <a class="yschttl spt" href="http://this.is.the.url" target="_blank">
- This is
- the <b>title</b>...
- </a>
- </h3>
- </div>
- <div>
- <span class="cite">Business via Yahoo!</span>
- <span class="tri fc-2nd ml-10">22 minutes ago</span>
- </div>
- <div class="compText">
- This is the content
- </div>
- </li>
- <li>
- <div class="compTitle">
- <h3>
- <a class="yschttl spt" href="http://this.is.the.url" target="_blank">
- This is
- the <b>title</b>...
- </a>
- </h3>
- </div>
- <div>
- <span class="cite">Business via Yahoo!</span>
- <span class="tri fc-2nd ml-10">Feb 03 09:45AM 1900</span>
- </div>
- <div class="compText">
- This is the content
- </div>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = yahoo_news.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 3)
- self.assertEqual(results[0]['title'], 'This is the title...')
- self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
- self.assertEqual(results[0]['content'], 'This is the content')
- self.assertEqual(results[2]['publishedDate'].year, datetime.now().year)
diff --git a/searx/tests/engines/test_youtube_api.py b/searx/tests/engines/test_youtube_api.py
deleted file mode 100644
index 0d4d478c3..000000000
--- a/searx/tests/engines/test_youtube_api.py
+++ /dev/null
@@ -1,111 +0,0 @@
-from collections import defaultdict
-import mock
-from searx.engines import youtube_api
-from searx.testing import SearxTestCase
-
-
-class TestYoutubeAPIEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
- params = youtube_api.request(query, dicto)
- self.assertTrue('url' in params)
- self.assertTrue(query in params['url'])
- self.assertIn('googleapis.com', params['url'])
- self.assertIn('youtube', params['url'])
- self.assertIn('fr', params['url'])
-
- dicto['language'] = 'all'
- params = youtube_api.request(query, dicto)
- self.assertFalse('fr' in params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, youtube_api.response, None)
- self.assertRaises(AttributeError, youtube_api.response, [])
- self.assertRaises(AttributeError, youtube_api.response, '')
- self.assertRaises(AttributeError, youtube_api.response, '[]')
-
- response = mock.Mock(text='{}')
- self.assertEqual(youtube_api.response(response), [])
-
- response = mock.Mock(text='{"data": []}')
- self.assertEqual(youtube_api.response(response), [])
-
- json = """
- {
- "kind": "youtube#searchListResponse",
- "etag": "xmg9xJZuZD438sF4hb-VcBBREXc/YJQDcTBCDcaBvl-sRZJoXdvy1ME",
- "nextPageToken": "CAUQAA",
- "pageInfo": {
- "totalResults": 1000000,
- "resultsPerPage": 20
- },
- "items": [
- {
- "kind": "youtube#searchResult",
- "etag": "xmg9xJZuZD438sF4hb-VcBBREXc/IbLO64BMhbHIgWLwLw7MDYe7Hs4",
- "id": {
- "kind": "youtube#video",
- "videoId": "DIVZCPfAOeM"
- },
- "snippet": {
- "publishedAt": "2015-05-29T22:41:04.000Z",
- "channelId": "UCNodmx1ERIjKqvcJLtdzH5Q",
- "title": "Title",
- "description": "Description",
- "thumbnails": {
- "default": {
- "url": "https://i.ytimg.com/vi/DIVZCPfAOeM/default.jpg"
- },
- "medium": {
- "url": "https://i.ytimg.com/vi/DIVZCPfAOeM/mqdefault.jpg"
- },
- "high": {
- "url": "https://i.ytimg.com/vi/DIVZCPfAOeM/hqdefault.jpg"
- }
- },
- "channelTitle": "MinecraftUniverse",
- "liveBroadcastContent": "none"
- }
- }
- ]
- }
- """
- response = mock.Mock(text=json)
- results = youtube_api.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'https://www.youtube.com/watch?v=DIVZCPfAOeM')
- self.assertEqual(results[0]['content'], 'Description')
- self.assertEqual(results[0]['thumbnail'], 'https://i.ytimg.com/vi/DIVZCPfAOeM/hqdefault.jpg')
- self.assertTrue('DIVZCPfAOeM' in results[0]['embedded'])
-
- json = """
- {
- "kind": "youtube#searchListResponse",
- "etag": "xmg9xJZuZD438sF4hb-VcBBREXc/YJQDcTBCDcaBvl-sRZJoXdvy1ME",
- "nextPageToken": "CAUQAA",
- "pageInfo": {
- "totalResults": 1000000,
- "resultsPerPage": 20
- }
- }
- """
- response = mock.Mock(text=json)
- results = youtube_api.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
-
- json = """
- {"toto":{"entry":[]
- }
- }
- """
- response = mock.Mock(text=json)
- results = youtube_api.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/engines/test_youtube_noapi.py b/searx/tests/engines/test_youtube_noapi.py
deleted file mode 100644
index 9fa8fd20e..000000000
--- a/searx/tests/engines/test_youtube_noapi.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# -*- coding: utf-8 -*-
-from collections import defaultdict
-import mock
-from searx.engines import youtube_noapi
-from searx.testing import SearxTestCase
-
-
-class TestYoutubeNoAPIEngine(SearxTestCase):
-
- def test_request(self):
- query = 'test_query'
- dicto = defaultdict(dict)
- dicto['pageno'] = 0
- params = youtube_noapi.request(query, dicto)
- self.assertIn('url', params)
- self.assertIn(query, params['url'])
- self.assertIn('youtube.com', params['url'])
-
- def test_response(self):
- self.assertRaises(AttributeError, youtube_noapi.response, None)
- self.assertRaises(AttributeError, youtube_noapi.response, [])
- self.assertRaises(AttributeError, youtube_noapi.response, '')
- self.assertRaises(AttributeError, youtube_noapi.response, '[]')
-
- response = mock.Mock(text='<html></html>')
- self.assertEqual(youtube_noapi.response(response), [])
-
- html = """
- <ol id="item-section-063864" class="item-section">
- <li>
- <div class="yt-lockup yt-lockup-tile yt-lockup-video vve-check clearfix yt-uix-tile"
- data-context-item-id="DIVZCPfAOeM"
- data-visibility-tracking="CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JECx_-GK5uqMpcIB">
- <div class="yt-lockup-dismissable"><div class="yt-lockup-thumbnail contains-addto">
- <a aria-hidden="true" href="/watch?v=DIVZCPfAOeM" class=" yt-uix-sessionlink pf-link"
- data-sessionlink="itct=CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JFIEdGVzdA">
- <div class="yt-thumb video-thumb"><img src="//i.ytimg.com/vi/DIVZCPfAOeM/mqdefault.jpg"
- width="196" height="110"/></div><span class="video-time" aria-hidden="true">11:35</span></a>
- <span class="thumb-menu dark-overflow-action-menu video-actions">
- </span>
- </div>
- <div class="yt-lockup-content">
- <h3 class="yt-lockup-title">
- <a href="/watch?v=DIVZCPfAOeM"
- class="yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 yt-uix-sessionlink spf-link"
- data-sessionlink="itct=CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JFIEdGVzdA"
- title="Top Speed Test Kawasaki Ninja H2 (Thailand) By. MEHAY SUPERBIKE"
- aria-describedby="description-id-259079" rel="spf-prefetch" dir="ltr">
- Title
- </a>
- <span class="accessible-description" id="description-id-259079"> - Durée : 11:35.</span>
- </h3>
- <div class="yt-lockup-byline">de
- <a href="/user/mheejapan" class=" yt-uix-sessionlink spf-link g-hovercard"
- data-sessionlink="itct=CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JA" data-ytid="UCzEesu54Hjs0uRKmpy66qeA"
- data-name="">MEHAY SUPERBIKE</a></div><div class="yt-lockup-meta">
- <ul class="yt-lockup-meta-info">
- <li>il y a 20 heures</li>
- <li>8 424 vues</li>
- </ul>
- </div>
- <div class="yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2" dir="ltr">
- Description
- </div>
- <div class="yt-lockup-badges">
- <ul class="yt-badge-list ">
- <li class="yt-badge-item" >
- <span class="yt-badge">Nouveauté</span>
- </li>
- <li class="yt-badge-item" ><span class="yt-badge " >HD</span></li>
- </ul>
- </div>
- <div class="yt-lockup-action-menu yt-uix-menu-container">
- <div class="yt-uix-menu yt-uix-videoactionmenu hide-until-delayloaded"
- data-video-id="DIVZCPfAOeM" data-menu-content-id="yt-uix-videoactionmenu-menu">
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = youtube_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
- self.assertEqual(results[0]['title'], 'Title')
- self.assertEqual(results[0]['url'], 'https://www.youtube.com/watch?v=DIVZCPfAOeM')
- self.assertEqual(results[0]['content'], 'Description')
- self.assertEqual(results[0]['thumbnail'], 'https://i.ytimg.com/vi/DIVZCPfAOeM/hqdefault.jpg')
- self.assertTrue('DIVZCPfAOeM' in results[0]['embedded'])
-
- html = """
- <ol id="item-section-063864" class="item-section">
- <li>
- <div class="yt-lockup yt-lockup-tile yt-lockup-video vve-check clearfix yt-uix-tile"
- data-context-item-id="DIVZCPfAOeM"
- data-visibility-tracking="CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JECx_-GK5uqMpcIB">
- <div class="yt-lockup-dismissable"><div class="yt-lockup-thumbnail contains-addto">
- <a aria-hidden="true" href="/watch?v=DIVZCPfAOeM" class=" yt-uix-sessionlink pf-link"
- data-sessionlink="itct=CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JFIEdGVzdA">
- <div class="yt-thumb video-thumb"><img src="//i.ytimg.com/vi/DIVZCPfAOeM/mqdefault.jpg"
- width="196" height="110"/></div><span class="video-time" aria-hidden="true">11:35</span></a>
- <span class="thumb-menu dark-overflow-action-menu video-actions">
- </span>
- </div>
- <div class="yt-lockup-content">
- <h3 class="yt-lockup-title">
- <span class="accessible-description" id="description-id-259079"> - Durée : 11:35.</span>
- </h3>
- <div class="yt-lockup-byline">de
- <a href="/user/mheejapan" class=" yt-uix-sessionlink spf-link g-hovercard"
- data-sessionlink="itct=CBgQ3DAYACITCPGXnYau6sUCFZEIHAod-VQASCj0JA" data-ytid="UCzEesu54Hjs0uRKmpy66qeA"
- data-name="">MEHAY SUPERBIKE</a></div><div class="yt-lockup-meta">
- <ul class="yt-lockup-meta-info">
- <li>il y a 20 heures</li>
- <li>8 424 vues</li>
- </ul>
- </div>
- <div class="yt-lockup-badges">
- <ul class="yt-badge-list ">
- <li class="yt-badge-item" >
- <span class="yt-badge">Nouveauté</span>
- </li>
- <li class="yt-badge-item" ><span class="yt-badge " >HD</span></li>
- </ul>
- </div>
- <div class="yt-lockup-action-menu yt-uix-menu-container">
- <div class="yt-uix-menu yt-uix-videoactionmenu hide-until-delayloaded"
- data-video-id="DIVZCPfAOeM" data-menu-content-id="yt-uix-videoactionmenu-menu">
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = youtube_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
-
- html = """
- <ol id="item-section-063864" class="item-section">
- <li>
- </li>
- </ol>
- """
- response = mock.Mock(text=html)
- results = youtube_noapi.response(response)
- self.assertEqual(type(results), list)
- self.assertEqual(len(results), 0)
diff --git a/searx/tests/robot/__init__.py b/searx/tests/robot/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/searx/tests/robot/__init__.py
+++ /dev/null
diff --git a/searx/tests/robot/test_basic.robot b/searx/tests/robot/test_basic.robot
deleted file mode 100644
index 1b8e78fff..000000000
--- a/searx/tests/robot/test_basic.robot
+++ /dev/null
@@ -1,44 +0,0 @@
-*** Settings ***
-Library Selenium2Library timeout=10 implicit_wait=0.5
-Test Setup Open Browser http://localhost:11111/
-Test Teardown Close All Browsers
-
-
-*** Test Cases ***
-Front page
- Page Should Contain about
- Page Should Contain preferences
-
-About page
- Click Element link=about
- Page Should Contain Why use Searx?
- Page Should Contain Element link=search engines
-
-Preferences page
- Click Element link=preferences
- Page Should Contain Preferences
- Page Should Contain Default categories
- Page Should Contain Currently used search engines
- Page Should Contain dummy_dummy
- Page Should Contain general_dummy
-
-Switch category
- Go To http://localhost:11111/preferences
- Page Should Contain Checkbox category_general
- Page Should Contain Checkbox category_dummy
- Click Element xpath=//*[.="general"]
- Click Element xpath=//*[.="dummy"]
- Submit Form id=search_form
- Location Should Be http://localhost:11111/
- Checkbox Should Not Be Selected category_general
- Checkbox Should Be Selected category_dummy
-
-Change language
- Page Should Contain about
- Page Should Contain preferences
- Go To http://localhost:11111/preferences
- Select From List locale hu
- Submit Form id=search_form
- Location Should Be http://localhost:11111/
- Page Should Contain rólunk
- Page Should Contain beállítások
diff --git a/searx/tests/test_engines.py b/searx/tests/test_engines.py
deleted file mode 100644
index 793b77460..000000000
--- a/searx/tests/test_engines.py
+++ /dev/null
@@ -1,45 +0,0 @@
-from searx.tests.engines.test_bing import * # noqa
-from searx.tests.engines.test_bing_images import * # noqa
-from searx.tests.engines.test_bing_news import * # noqa
-from searx.tests.engines.test_blekko_images import * # noqa
-from searx.tests.engines.test_btdigg import * # noqa
-from searx.tests.engines.test_currency_convert import * # noqa
-from searx.tests.engines.test_dailymotion import * # noqa
-from searx.tests.engines.test_deezer import * # noqa
-from searx.tests.engines.test_deviantart import * # noqa
-from searx.tests.engines.test_digg import * # noqa
-from searx.tests.engines.test_duckduckgo import * # noqa
-from searx.tests.engines.test_duckduckgo_definitions import * # noqa
-from searx.tests.engines.test_dummy import * # noqa
-from searx.tests.engines.test_faroo import * # noqa
-from searx.tests.engines.test_flickr import * # noqa
-from searx.tests.engines.test_flickr_noapi import * # noqa
-from searx.tests.engines.test_gigablast import * # noqa
-from searx.tests.engines.test_github import * # noqa
-from searx.tests.engines.test_google import * # noqa
-from searx.tests.engines.test_google_images import * # noqa
-from searx.tests.engines.test_google_news import * # noqa
-from searx.tests.engines.test_kickass import * # noqa
-from searx.tests.engines.test_mediawiki import * # noqa
-from searx.tests.engines.test_mixcloud import * # noqa
-from searx.tests.engines.test_openstreetmap import * # noqa
-from searx.tests.engines.test_photon import * # noqa
-from searx.tests.engines.test_piratebay import * # noqa
-from searx.tests.engines.test_qwant import * # noqa
-from searx.tests.engines.test_searchcode_code import * # noqa
-from searx.tests.engines.test_searchcode_doc import * # noqa
-from searx.tests.engines.test_soundcloud import * # noqa
-from searx.tests.engines.test_spotify import * # noqa
-from searx.tests.engines.test_stackoverflow import * # noqa
-from searx.tests.engines.test_startpage import * # noqa
-from searx.tests.engines.test_subtitleseeker import * # noqa
-from searx.tests.engines.test_swisscows import * # noqa
-from searx.tests.engines.test_twitter import * # noqa
-from searx.tests.engines.test_vimeo import * # noqa
-from searx.tests.engines.test_www1x import * # noqa
-from searx.tests.engines.test_www500px import * # noqa
-from searx.tests.engines.test_yacy import * # noqa
-from searx.tests.engines.test_yahoo import * # noqa
-from searx.tests.engines.test_youtube_api import * # noqa
-from searx.tests.engines.test_youtube_noapi import * # noqa
-from searx.tests.engines.test_yahoo_news import * # noqa
diff --git a/searx/tests/test_plugins.py b/searx/tests/test_plugins.py
deleted file mode 100644
index 98d39ec14..000000000
--- a/searx/tests/test_plugins.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from searx.testing import SearxTestCase
-from searx import plugins
-from mock import Mock
-
-
-def get_search_mock(query, **kwargs):
- return {'search': Mock(query=query,
- result_container=Mock(answers=set()),
- **kwargs)}
-
-
-class PluginStoreTest(SearxTestCase):
-
- def test_PluginStore_init(self):
- store = plugins.PluginStore()
- self.assertTrue(isinstance(store.plugins, list) and len(store.plugins) == 0)
-
- def test_PluginStore_register(self):
- store = plugins.PluginStore()
- testplugin = plugins.Plugin()
- store.register(testplugin)
-
- self.assertTrue(len(store.plugins) == 1)
-
- def test_PluginStore_call(self):
- store = plugins.PluginStore()
- testplugin = plugins.Plugin()
- store.register(testplugin)
- setattr(testplugin, 'asdf', Mock())
- request = Mock(user_plugins=[])
- store.call('asdf', request, Mock())
-
- self.assertFalse(testplugin.asdf.called)
-
- request.user_plugins.append(testplugin)
- store.call('asdf', request, Mock())
-
- self.assertTrue(testplugin.asdf.called)
-
-
-class SelfIPTest(SearxTestCase):
-
- def test_PluginStore_init(self):
- store = plugins.PluginStore()
- store.register(plugins.self_info)
-
- self.assertTrue(len(store.plugins) == 1)
-
- # IP test
- request = Mock(user_plugins=store.plugins,
- remote_addr='127.0.0.1')
- request.headers.getlist.return_value = []
- ctx = get_search_mock(query='ip')
- store.call('post_search', request, ctx)
- self.assertTrue('127.0.0.1' in ctx['search'].result_container.answers)
-
- # User agent test
- request = Mock(user_plugins=store.plugins,
- user_agent='Mock')
- request.headers.getlist.return_value = []
-
- ctx = get_search_mock(query='user-agent')
- store.call('post_search', request, ctx)
- self.assertTrue('Mock' in ctx['search'].result_container.answers)
-
- ctx = get_search_mock(query='user-agent')
- store.call('post_search', request, ctx)
- self.assertTrue('Mock' in ctx['search'].result_container.answers)
-
- ctx = get_search_mock(query='What is my User-Agent?')
- store.call('post_search', request, ctx)
- self.assertTrue('Mock' in ctx['search'].result_container.answers)
diff --git a/searx/tests/test_results.py b/searx/tests/test_results.py
deleted file mode 100644
index 274b5b37a..000000000
--- a/searx/tests/test_results.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from searx.results import ResultContainer
-from searx.testing import SearxTestCase
-
-
-def fake_result(url='https://aa.bb/cc?dd=ee#ff',
- title='aaa',
- content='bbb',
- engine='wikipedia', **kwargs):
- result = {'url': url,
- 'title': title,
- 'content': content,
- 'engine': engine}
- result.update(kwargs)
- return result
-
-
-# TODO
-class ResultContainerTestCase(SearxTestCase):
-
- def test_empty(self):
- c = ResultContainer()
- self.assertEqual(c.get_ordered_results(), [])
-
- def test_one_result(self):
- c = ResultContainer()
- c.extend('wikipedia', [fake_result()])
- self.assertEqual(c.results_length(), 1)
-
- def test_one_suggestion(self):
- c = ResultContainer()
- c.extend('wikipedia', [fake_result(suggestion=True)])
- self.assertEqual(len(c.suggestions), 1)
- self.assertEqual(c.results_length(), 0)
-
- def test_result_merge(self):
- c = ResultContainer()
- c.extend('wikipedia', [fake_result()])
- c.extend('wikidata', [fake_result(), fake_result(url='https://example.com/')])
- self.assertEqual(c.results_length(), 2)
diff --git a/searx/tests/test_robot.py b/searx/tests/test_robot.py
deleted file mode 100644
index b48153fe4..000000000
--- a/searx/tests/test_robot.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import os
-import unittest2 as unittest
-from plone.testing import layered
-from robotsuite import RobotTestSuite
-from searx.testing import SEARXROBOTLAYER
-
-
-def test_suite():
- suite = unittest.TestSuite()
- current_dir = os.path.abspath(os.path.dirname(__file__))
- robot_dir = os.path.join(current_dir, 'robot')
- tests = [
- os.path.join('robot', f) for f in
- os.listdir(robot_dir) if f.endswith('.robot') and
- f.startswith('test_')
- ]
- for test in tests:
- suite.addTests([
- layered(RobotTestSuite(test), layer=SEARXROBOTLAYER),
- ])
- return suite
diff --git a/searx/tests/test_search.py b/searx/tests/test_search.py
deleted file mode 100644
index af5fffd8b..000000000
--- a/searx/tests/test_search.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from searx.testing import SearxTestCase
-
-
-# TODO
-class SearchTestCase(SearxTestCase):
-
- def test_(self):
- pass
diff --git a/searx/tests/test_utils.py b/searx/tests/test_utils.py
deleted file mode 100644
index 04480791d..000000000
--- a/searx/tests/test_utils.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-import mock
-from searx.testing import SearxTestCase
-from searx import utils
-
-
-class TestUtils(SearxTestCase):
-
- def test_gen_useragent(self):
- self.assertIsInstance(utils.gen_useragent(), str)
- self.assertIsNotNone(utils.gen_useragent())
- self.assertTrue(utils.gen_useragent().startswith('Mozilla'))
-
- def test_searx_useragent(self):
- self.assertIsInstance(utils.searx_useragent(), str)
- self.assertIsNotNone(utils.searx_useragent())
- self.assertTrue(utils.searx_useragent().startswith('searx'))
-
- def test_highlight_content(self):
- self.assertEqual(utils.highlight_content(0, None), None)
- self.assertEqual(utils.highlight_content(None, None), None)
- self.assertEqual(utils.highlight_content('', None), None)
- self.assertEqual(utils.highlight_content(False, None), None)
-
- contents = [
- '<html></html>'
- 'not<'
- ]
- for content in contents:
- self.assertEqual(utils.highlight_content(content, None), content)
-
- content = 'a'
- query = 'test'
- self.assertEqual(utils.highlight_content(content, query), content)
- query = 'a test'
- self.assertEqual(utils.highlight_content(content, query), content)
-
- def test_html_to_text(self):
- html = """
- <a href="/testlink" class="link_access_account">
- <span class="toto">
- <span>
- <img src="test.jpg" />
- </span>
- </span>
- <span class="titi">
- Test text
- </span>
- </a>
- """
- self.assertIsInstance(utils.html_to_text(html), unicode)
- self.assertIsNotNone(utils.html_to_text(html))
- self.assertEqual(utils.html_to_text(html), "Test text")
-
- def test_prettify_url(self):
- data = (('https://searx.me/', 'https://searx.me/'),
- (u'https://searx.me/ű', u'https://searx.me/ű'),
- ('https://searx.me/' + (100 * 'a'), 'https://searx.me/[...]aaaaaaaaaaaaaaaaa'),
- (u'https://searx.me/' + (100 * u'ű'), u'https://searx.me/[...]űűűűűűűűűűűűűűűűű'))
-
- for test_url, expected in data:
- self.assertEqual(utils.prettify_url(test_url, max_length=32), expected)
-
-
-class TestHTMLTextExtractor(SearxTestCase):
-
- def setUp(self):
- self.html_text_extractor = utils.HTMLTextExtractor()
-
- def test__init__(self):
- self.assertEqual(self.html_text_extractor.result, [])
-
- def test_handle_charref(self):
- self.html_text_extractor.handle_charref('xF')
- self.assertIn(u'\x0f', self.html_text_extractor.result)
- self.html_text_extractor.handle_charref('XF')
- self.assertIn(u'\x0f', self.html_text_extractor.result)
-
- self.html_text_extractor.handle_charref('97')
- self.assertIn(u'a', self.html_text_extractor.result)
-
- def test_handle_entityref(self):
- entity = 'test'
- self.html_text_extractor.handle_entityref(entity)
- self.assertIn(entity, self.html_text_extractor.result)
-
-
-class TestUnicodeWriter(SearxTestCase):
-
- def setUp(self):
- self.unicode_writer = utils.UnicodeWriter(mock.MagicMock())
-
- def test_write_row(self):
- row = [1, 2, 3]
- self.assertEqual(self.unicode_writer.writerow(row), None)
-
- def test_write_rows(self):
- self.unicode_writer.writerow = mock.MagicMock()
- rows = [1, 2, 3]
- self.unicode_writer.writerows(rows)
- self.assertEqual(self.unicode_writer.writerow.call_count, len(rows))
diff --git a/searx/tests/test_webapp.py b/searx/tests/test_webapp.py
deleted file mode 100644
index 071c01df3..000000000
--- a/searx/tests/test_webapp.py
+++ /dev/null
@@ -1,151 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import json
-from mock import Mock
-from urlparse import ParseResult
-from searx import webapp
-from searx.testing import SearxTestCase
-
-
-class ViewsTestCase(SearxTestCase):
-
- def setUp(self):
- webapp.app.config['TESTING'] = True # to get better error messages
- self.app = webapp.app.test_client()
- webapp.default_theme = 'default'
-
- # set some defaults
- self.test_results = [
- {
- 'content': 'first test content',
- 'title': 'First Test',
- 'url': 'http://first.test.xyz',
- 'engines': ['youtube', 'startpage'],
- 'engine': 'startpage',
- 'parsed_url': ParseResult(scheme='http', netloc='first.test.xyz', path='/', params='', query='', fragment=''), # noqa
- }, {
- 'content': 'second test content',
- 'title': 'Second Test',
- 'url': 'http://second.test.xyz',
- 'engines': ['youtube', 'startpage'],
- 'engine': 'youtube',
- 'parsed_url': ParseResult(scheme='http', netloc='second.test.xyz', path='/', params='', query='', fragment=''), # noqa
- },
- ]
-
- def search_mock(search_self, *args):
- search_self.result_container = Mock(get_ordered_results=lambda: self.test_results,
- answers=set(),
- suggestions=set(),
- infoboxes=[],
- results=self.test_results,
- results_length=lambda: len(self.test_results))
-
- webapp.Search.search = search_mock
-
- self.maxDiff = None # to see full diffs
-
- def test_index_empty(self):
- result = self.app.post('/')
- self.assertEqual(result.status_code, 200)
- self.assertIn('<div class="title"><h1>searx</h1></div>', result.data)
-
- def test_index_html(self):
- result = self.app.post('/', data={'q': 'test'})
- self.assertIn(
- '<h3 class="result_title"><img width="14" height="14" class="favicon" src="/static/themes/default/img/icons/icon_youtube.ico" alt="youtube" /><a href="http://second.test.xyz" rel="noreferrer">Second <span class="highlight">Test</span></a></h3>', # noqa
- result.data
- )
- self.assertIn(
- '<p class="content">first <span class="highlight">test</span> content<br class="last"/></p>', # noqa
- result.data
- )
-
- def test_index_json(self):
- result = self.app.post('/', data={'q': 'test', 'format': 'json'})
-
- result_dict = json.loads(result.data)
-
- self.assertEqual('test', result_dict['query'])
- self.assertEqual(
- result_dict['results'][0]['content'], 'first test content')
- self.assertEqual(
- result_dict['results'][0]['url'], 'http://first.test.xyz')
-
- def test_index_csv(self):
- result = self.app.post('/', data={'q': 'test', 'format': 'csv'})
-
- self.assertEqual(
- 'title,url,content,host,engine,score\r\n'
- 'First Test,http://first.test.xyz,first test content,first.test.xyz,startpage,\r\n' # noqa
- 'Second Test,http://second.test.xyz,second test content,second.test.xyz,youtube,\r\n', # noqa
- result.data
- )
-
- def test_index_rss(self):
- result = self.app.post('/', data={'q': 'test', 'format': 'rss'})
-
- self.assertIn(
- '<description>Search results for "test" - searx</description>',
- result.data
- )
-
- self.assertIn(
- '<opensearch:totalResults>2</opensearch:totalResults>',
- result.data
- )
-
- self.assertIn(
- '<title>First Test</title>',
- result.data
- )
-
- self.assertIn(
- '<link>http://first.test.xyz</link>',
- result.data
- )
-
- self.assertIn(
- '<description>first test content</description>',
- result.data
- )
-
- def test_about(self):
- result = self.app.get('/about')
- self.assertEqual(result.status_code, 200)
- self.assertIn('<h1>About <a href="/">searx</a></h1>', result.data)
-
- def test_preferences(self):
- result = self.app.get('/preferences')
- self.assertEqual(result.status_code, 200)
- self.assertIn(
- '<form method="post" action="/preferences" id="search_form">',
- result.data
- )
- self.assertIn(
- '<legend>Default categories</legend>',
- result.data
- )
- self.assertIn(
- '<legend>Interface language</legend>',
- result.data
- )
-
- def test_stats(self):
- result = self.app.get('/stats')
- self.assertEqual(result.status_code, 200)
- self.assertIn('<h2>Engine stats</h2>', result.data)
-
- def test_robots_txt(self):
- result = self.app.get('/robots.txt')
- self.assertEqual(result.status_code, 200)
- self.assertIn('Allow: /', result.data)
-
- def test_opensearch_xml(self):
- result = self.app.get('/opensearch.xml')
- self.assertEqual(result.status_code, 200)
- self.assertIn('<Description>a privacy-respecting, hackable metasearch engine</Description>', result.data)
-
- def test_favicon(self):
- result = self.app.get('/favicon.ico')
- self.assertEqual(result.status_code, 200)
diff --git a/searx/translations/bg/LC_MESSAGES/messages.mo b/searx/translations/bg/LC_MESSAGES/messages.mo
new file mode 100644
index 000000000..887d052bd
--- /dev/null
+++ b/searx/translations/bg/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/bg/LC_MESSAGES/messages.po b/searx/translations/bg/LC_MESSAGES/messages.po
new file mode 100644
index 000000000..b5f443001
--- /dev/null
+++ b/searx/translations/bg/LC_MESSAGES/messages.po
@@ -0,0 +1,686 @@
+# Translations template for PROJECT.
+# Copyright (C) 2016 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+#
+# Translators:
+# poke amom <van_ds_ff@mail.bg>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: searx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
+"Language-Team: Bulgarian (http://www.transifex.com/asciimoo/searx/language/bg/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.2.0\n"
+"Language: bg\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: searx/webapp.py:114
+msgid "files"
+msgstr "файлове"
+
+#: searx/webapp.py:115
+msgid "general"
+msgstr "общ"
+
+#: searx/webapp.py:116
+msgid "music"
+msgstr "музика"
+
+#: searx/webapp.py:117
+msgid "social media"
+msgstr "социална мрежа"
+
+#: searx/webapp.py:118
+msgid "images"
+msgstr "изображения"
+
+#: searx/webapp.py:119
+msgid "videos"
+msgstr "видео"
+
+#: searx/webapp.py:120
+msgid "it"
+msgstr "ай-ти"
+
+#: searx/webapp.py:121
+msgid "news"
+msgstr "новини"
+
+#: searx/webapp.py:122
+msgid "map"
+msgstr "карта"
+
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
+msgid "{minutes} minute(s) ago"
+msgstr "преди {minutes} минута(минути)"
+
+#: searx/webapp.py:417
+msgid "{hours} hour(s), {minutes} minute(s) ago"
+msgstr "преди {hours} час(ове), {minutes} минута(минути)"
+
+#: searx/engines/__init__.py:185
+msgid "Page loads (sec)"
+msgstr "Страницата зарежда (сек)"
+
+#: searx/engines/__init__.py:189
+msgid "Number of results"
+msgstr "Брой резултати"
+
+#: searx/engines/__init__.py:193
+msgid "Scores"
+msgstr ""
+
+#: searx/engines/__init__.py:197
+msgid "Scores per result"
+msgstr ""
+
+#: searx/engines/__init__.py:201
+msgid "Errors"
+msgstr "Грешки"
+
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr "Поправи HTTP връзки на HTTPS, ако е възможно"
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr "Търси при избор на категория"
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr "Търси веднага при избрана категория. Изключи за избор на няколко категории. (Необходим е JavaScript)"
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr ""
+
+#: searx/templates/courgette/index.html:9
+#: searx/templates/courgette/index.html:13
+#: searx/templates/courgette/results.html:5
+#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
+#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
+#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
+msgid "preferences"
+msgstr "предпочитания"
+
+#: searx/templates/courgette/index.html:11
+#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
+#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
+msgid "about"
+msgstr "относно"
+
+#: searx/templates/courgette/preferences.html:5
+#: searx/templates/default/preferences.html:5
+#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
+msgid "Preferences"
+msgstr "Предпочитания"
+
+#: searx/templates/courgette/preferences.html:9
+#: searx/templates/default/preferences.html:9
+#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
+msgid "Default categories"
+msgstr "Първоначални категории"
+
+#: searx/templates/courgette/preferences.html:13
+#: searx/templates/default/preferences.html:14
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
+msgid "Search language"
+msgstr "Език на търсене"
+
+#: searx/templates/courgette/preferences.html:16
+#: searx/templates/default/preferences.html:17
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
+msgid "Automatic"
+msgstr "Автоматично"
+
+#: searx/templates/courgette/preferences.html:24
+#: searx/templates/default/preferences.html:25
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
+msgid "Interface language"
+msgstr "Език"
+
+#: searx/templates/courgette/preferences.html:34
+#: searx/templates/default/preferences.html:35
+#: searx/templates/oscar/preferences.html:65
+msgid "Autocomplete"
+msgstr "Автоматично допълване"
+
+#: searx/templates/courgette/preferences.html:45
+#: searx/templates/default/preferences.html:46
+#: searx/templates/oscar/preferences.html:76
+msgid "Image proxy"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:48
+#: searx/templates/default/preferences.html:49
+#: searx/templates/oscar/preferences.html:80
+msgid "Enabled"
+msgstr "Включено"
+
+#: searx/templates/courgette/preferences.html:49
+#: searx/templates/default/preferences.html:50
+#: searx/templates/oscar/preferences.html:81
+msgid "Disabled"
+msgstr "Изключено"
+
+#: searx/templates/courgette/preferences.html:54
+#: searx/templates/default/preferences.html:55
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
+msgid "Method"
+msgstr "Метод"
+
+#: searx/templates/courgette/preferences.html:63
+#: searx/templates/default/preferences.html:64
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
+msgid "SafeSearch"
+msgstr "Безопасно търсене"
+
+#: searx/templates/courgette/preferences.html:66
+#: searx/templates/default/preferences.html:67
+#: searx/templates/oscar/preferences.html:98
+msgid "Strict"
+msgstr "Стриктно"
+
+#: searx/templates/courgette/preferences.html:67
+#: searx/templates/default/preferences.html:68
+#: searx/templates/oscar/preferences.html:99
+msgid "Moderate"
+msgstr "Умерено"
+
+#: searx/templates/courgette/preferences.html:68
+#: searx/templates/default/preferences.html:69
+#: searx/templates/oscar/preferences.html:100
+msgid "None"
+msgstr "Нищо"
+
+#: searx/templates/courgette/preferences.html:73
+#: searx/templates/default/preferences.html:74
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
+msgid "Themes"
+msgstr "Облик"
+
+#: searx/templates/courgette/preferences.html:83
+msgid "Color"
+msgstr "Цвят"
+
+#: searx/templates/courgette/preferences.html:86
+msgid "Blue (default)"
+msgstr "Синьо (първоначален)"
+
+#: searx/templates/courgette/preferences.html:87
+msgid "Violet"
+msgstr "Виолетов"
+
+#: searx/templates/courgette/preferences.html:88
+msgid "Green"
+msgstr "Зелено"
+
+#: searx/templates/courgette/preferences.html:89
+msgid "Cyan"
+msgstr "зелено-синьо"
+
+#: searx/templates/courgette/preferences.html:90
+msgid "Orange"
+msgstr "Оранжево"
+
+#: searx/templates/courgette/preferences.html:91
+msgid "Red"
+msgstr "Червено"
+
+#: searx/templates/courgette/preferences.html:96
+#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
+msgid "Currently used search engines"
+msgstr "Използвани търсачки в момента "
+
+#: searx/templates/courgette/preferences.html:100
+#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
+msgid "Engine name"
+msgstr "Име на търсачка"
+
+#: searx/templates/courgette/preferences.html:101
+#: searx/templates/default/preferences.html:89
+msgid "Category"
+msgstr "Категория"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:113
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:101
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
+msgid "Allow"
+msgstr "Позволи"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:114
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:102
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
+msgid "Block"
+msgstr "Забрани"
+
+#: searx/templates/courgette/preferences.html:122
+#: searx/templates/default/preferences.html:110
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
+msgid ""
+"These settings are stored in your cookies, this allows us not to store this "
+"data about you."
+msgstr "Тези настройки се съхраняват във вашите бисквитки. Това ни позволява да не съхраняваме тази информация за вас."
+
+#: searx/templates/courgette/preferences.html:124
+#: searx/templates/default/preferences.html:112
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
+msgid ""
+"These cookies serve your sole convenience, we don't use these cookies to "
+"track you."
+msgstr "Тези бисквитки служат за ваше удобство. Ние не ги използваме, за да Ви следим."
+
+#: searx/templates/courgette/preferences.html:127
+#: searx/templates/default/preferences.html:115
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
+msgid "save"
+msgstr "запази"
+
+#: searx/templates/courgette/preferences.html:128
+#: searx/templates/default/preferences.html:116
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr "Върни първоначалните"
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
+msgid "back"
+msgstr "назад"
+
+#: searx/templates/courgette/results.html:12
+#: searx/templates/default/results.html:13
+#: searx/templates/oscar/results.html:110
+msgid "Search URL"
+msgstr "Търси URL"
+
+#: searx/templates/courgette/results.html:16
+#: searx/templates/default/results.html:17
+#: searx/templates/oscar/results.html:115
+msgid "Download results"
+msgstr "Свали резултатите"
+
+#: searx/templates/courgette/results.html:34
+#: searx/templates/default/results.html:35
+msgid "Answers"
+msgstr "Отговори"
+
+#: searx/templates/courgette/results.html:42
+#: searx/templates/default/results.html:43
+#: searx/templates/oscar/results.html:90
+msgid "Suggestions"
+msgstr "Предложения"
+
+#: searx/templates/courgette/results.html:70
+#: searx/templates/default/results.html:81
+#: searx/templates/oscar/results.html:51 searx/templates/oscar/results.html:63
+msgid "previous page"
+msgstr "предишна страница"
+
+#: searx/templates/courgette/results.html:81
+#: searx/templates/default/results.html:92
+#: searx/templates/oscar/results.html:44 searx/templates/oscar/results.html:71
+msgid "next page"
+msgstr "следваща страница"
+
+#: searx/templates/courgette/search.html:3
+#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
+#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
+msgid "Search for..."
+msgstr "Търси за..."
+
+#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
+msgid "Engine stats"
+msgstr "Статистика на търсачката"
+
+#: searx/templates/courgette/result_templates/images.html:4
+#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
+msgid "original context"
+msgstr "оригинален контекст"
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Seeder"
+msgstr "Сийдър"
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Leecher"
+msgstr "Лийчър"
+
+#: searx/templates/courgette/result_templates/torrent.html:9
+#: searx/templates/default/result_templates/torrent.html:9
+#: searx/templates/oscar/macros.html:21
+msgid "magnet link"
+msgstr "магнитна връзка"
+
+#: searx/templates/courgette/result_templates/torrent.html:10
+#: searx/templates/default/result_templates/torrent.html:10
+#: searx/templates/oscar/macros.html:22
+msgid "torrent file"
+msgstr "торент файл"
+
+#: searx/templates/default/categories.html:8
+msgid "Click on the magnifier to perform search"
+msgstr "Кликнете лупичката, за да изпълните търсене"
+
+#: searx/templates/default/result_templates/code.html:3
+#: searx/templates/default/result_templates/default.html:3
+#: searx/templates/default/result_templates/map.html:9
+#: searx/templates/oscar/macros.html:20
+msgid "cached"
+msgstr "кеширана"
+
+#: searx/templates/oscar/base.html:78
+msgid "Powered by"
+msgstr ""
+
+#: searx/templates/oscar/base.html:78
+msgid "a privacy-respecting, hackable metasearch engine"
+msgstr ""
+
+#: searx/templates/oscar/navbar.html:9 searx/templates/oscar/navbar.html:33
+msgid "home"
+msgstr "начало"
+
+#: searx/templates/oscar/navbar.html:14 searx/templates/oscar/navbar.html:24
+msgid "Toggle navigation"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:17
+#: searx/templates/oscar/preferences.html:25
+msgid "General"
+msgstr "Общи"
+
+#: searx/templates/oscar/preferences.html:18
+#: searx/templates/oscar/preferences.html:126
+msgid "Engines"
+msgstr "Търсачки"
+
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr "Добавки"
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr "Бисквитки"
+
+#: searx/templates/oscar/preferences.html:45
+msgid "What language do you prefer for search?"
+msgstr "Кой език предпочитате за търсене?"
+
+#: searx/templates/oscar/preferences.html:56
+msgid "Change the language of the layout"
+msgstr "Промени езика на оформлението"
+
+#: searx/templates/oscar/preferences.html:66
+msgid "Find stuff as you type"
+msgstr "Намери докато пишеш"
+
+#: searx/templates/oscar/preferences.html:77
+msgid "Proxying image results through searx"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:86
+msgid ""
+"Change how forms are submited, <a "
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
+" rel=\"external\">learn more about request methods</a>"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:95
+msgid "Filter content"
+msgstr "Филтрирай съдържание"
+
+#: searx/templates/oscar/preferences.html:105
+msgid "Change searx layout"
+msgstr "Промени оформлението на searx"
+
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr "Пряк път"
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr "Средно време"
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr "Макс. време"
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr "Това е списък на бисквитки с техните стойности, които searx съхранява на вашия компютър."
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr "Име на бисквитката"
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr "Стойност"
+
+#: searx/templates/oscar/results.html:7
+msgid "Search results"
+msgstr "Резултати от търсенето"
+
+#: searx/templates/oscar/results.html:105
+msgid "Links"
+msgstr "Връзки"
+
+#: searx/templates/oscar/search.html:6
+#: searx/templates/oscar/search_full.html:11
+msgid "Start search"
+msgstr "Започни търсене"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Show search filters"
+msgstr "Покажи филтрите за търсене"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Hide search filters"
+msgstr "Скрий филтрите за търсене"
+
+#: searx/templates/oscar/stats.html:2
+msgid "stats"
+msgstr "статистики"
+
+#: searx/templates/oscar/messages/first_time.html:4
+#: searx/templates/oscar/messages/no_results.html:5
+#: searx/templates/oscar/messages/save_settings_successfull.html:5
+#: searx/templates/oscar/messages/unknow_error.html:5
+msgid "Close"
+msgstr "Затвори"
+
+#: searx/templates/oscar/messages/first_time.html:6
+#: searx/templates/oscar/messages/no_data_available.html:3
+msgid "Heads up!"
+msgstr "Внимание!"
+
+#: searx/templates/oscar/messages/first_time.html:7
+msgid "It look like you are using searx first time."
+msgstr "Изглежда използвате searx за първи път."
+
+#: searx/templates/oscar/messages/js_disabled.html:2
+msgid "Warning!"
+msgstr "Внимание!"
+
+#: searx/templates/oscar/messages/js_disabled.html:3
+msgid "Please enable JavaScript to use full functionality of this site."
+msgstr "Моля включете JavaScript, за пълна използваемост на този сайт."
+
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr "Информация!"
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr "В момента няма налични бисквитки."
+
+#: searx/templates/oscar/messages/no_data_available.html:4
+msgid "There is currently no data available. "
+msgstr "Няма налична достъпна информация."
+
+#: searx/templates/oscar/messages/no_results.html:7
+msgid "Sorry!"
+msgstr "Съжалявам!"
+
+#: searx/templates/oscar/messages/no_results.html:8
+msgid ""
+"we didn't find any results. Please use another query or search in more "
+"categories."
+msgstr "не намерихме резултати. Моля пробвайте други ключови думи или търсете в повече категории."
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:7
+msgid "Well done!"
+msgstr "Браво!"
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:8
+msgid "Settings saved successfully."
+msgstr "Настройките са успешно запазени."
+
+#: searx/templates/oscar/messages/unknow_error.html:7
+msgid "Oh snap!"
+msgstr "Да му се не види!"
+
+#: searx/templates/oscar/messages/unknow_error.html:8
+msgid "Something went wrong."
+msgstr "Нещо се обърка."
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "show media"
+msgstr "покажи медия"
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "hide media"
+msgstr "скрий медия"
+
+#: searx/templates/oscar/result_templates/images.html:23
+msgid "Get image"
+msgstr "Вземи изображение"
+
+#: searx/templates/oscar/result_templates/images.html:24
+msgid "View source"
+msgstr "Покажи източник"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "show map"
+msgstr "покажи карта"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "hide map"
+msgstr "скрий картата"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "show details"
+msgstr "покажи детайлите"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "hide details"
+msgstr "скрий детайлите"
+
+#: searx/templates/oscar/result_templates/torrent.html:7
+msgid "Filesize"
+msgstr "Размер на файла"
+
+#: searx/templates/oscar/result_templates/torrent.html:9
+msgid "Bytes"
+msgstr "Байта"
+
+#: searx/templates/oscar/result_templates/torrent.html:10
+msgid "kiB"
+msgstr "килобайт"
+
+#: searx/templates/oscar/result_templates/torrent.html:11
+msgid "MiB"
+msgstr "мегабайт"
+
+#: searx/templates/oscar/result_templates/torrent.html:12
+msgid "GiB"
+msgstr "гигабайт"
+
+#: searx/templates/oscar/result_templates/torrent.html:13
+msgid "TiB"
+msgstr "терабайт"
+
+#: searx/templates/oscar/result_templates/torrent.html:15
+msgid "Number of Files"
+msgstr "Брой на Файлове"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "show video"
+msgstr "покажи видео"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "hide video"
+msgstr "скрий видеото"
+
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr "Зареди още..."
diff --git a/searx/translations/de/LC_MESSAGES/messages.mo b/searx/translations/de/LC_MESSAGES/messages.mo
index d756167cc..7d3451265 100644
--- a/searx/translations/de/LC_MESSAGES/messages.mo
+++ b/searx/translations/de/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/de/LC_MESSAGES/messages.po b/searx/translations/de/LC_MESSAGES/messages.po
index 8158c27e2..2ba9cc51e 100644
--- a/searx/translations/de/LC_MESSAGES/messages.po
+++ b/searx/translations/de/LC_MESSAGES/messages.po
@@ -1,27 +1,28 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
-# pointhi, 2014-2015
+# Thomas Pointhuber, 2014-2015
# Max <theshirinzu@gmail.com>, 2015
# pointhi, 2014
# rike, 2014
# stf <stefan.marsiske@gmail.com>, 2014
# stf <stefan.marsiske@gmail.com>, 2014
+# Thomas Pointhuber, 2016
# rike, 2014
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 10:00+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:07+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
"Language-Team: German (http://www.transifex.com/asciimoo/searx/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -61,11 +62,15 @@ msgstr "Neuigkeiten"
msgid "map"
msgstr "Karte"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "Wissenschaft"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "vor {minutes} Minute(n)"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "vor {hours} Stunde(n), {minutes} Minute(n)"
@@ -284,7 +289,7 @@ msgstr "Kategorie"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -296,7 +301,7 @@ msgstr "Erlauben"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/el_GR/LC_MESSAGES/messages.mo b/searx/translations/el_GR/LC_MESSAGES/messages.mo
new file mode 100644
index 000000000..385bcbc84
--- /dev/null
+++ b/searx/translations/el_GR/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/el_GR/LC_MESSAGES/messages.po b/searx/translations/el_GR/LC_MESSAGES/messages.po
new file mode 100644
index 000000000..73b49e27f
--- /dev/null
+++ b/searx/translations/el_GR/LC_MESSAGES/messages.po
@@ -0,0 +1,686 @@
+# Translations template for PROJECT.
+# Copyright (C) 2016 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+#
+# Translators:
+# Dimitris T. <dimitris@stinpriza.org>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: searx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
+"Language-Team: Greek (Greece) (http://www.transifex.com/asciimoo/searx/language/el_GR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.2.0\n"
+"Language: el_GR\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: searx/webapp.py:114
+msgid "files"
+msgstr "αρχεία"
+
+#: searx/webapp.py:115
+msgid "general"
+msgstr "γενικά"
+
+#: searx/webapp.py:116
+msgid "music"
+msgstr "μουσική"
+
+#: searx/webapp.py:117
+msgid "social media"
+msgstr "κοινωνικά δίκτυα"
+
+#: searx/webapp.py:118
+msgid "images"
+msgstr "εικόνες"
+
+#: searx/webapp.py:119
+msgid "videos"
+msgstr ""
+
+#: searx/webapp.py:120
+msgid "it"
+msgstr ""
+
+#: searx/webapp.py:121
+msgid "news"
+msgstr "νέα"
+
+#: searx/webapp.py:122
+msgid "map"
+msgstr "χάρτης"
+
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
+msgid "{minutes} minute(s) ago"
+msgstr ""
+
+#: searx/webapp.py:417
+msgid "{hours} hour(s), {minutes} minute(s) ago"
+msgstr ""
+
+#: searx/engines/__init__.py:185
+msgid "Page loads (sec)"
+msgstr ""
+
+#: searx/engines/__init__.py:189
+msgid "Number of results"
+msgstr "Αριθμός αποτελεσμάτων"
+
+#: searx/engines/__init__.py:193
+msgid "Scores"
+msgstr ""
+
+#: searx/engines/__init__.py:197
+msgid "Scores per result"
+msgstr ""
+
+#: searx/engines/__init__.py:201
+msgid "Errors"
+msgstr "Λάθη"
+
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr ""
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr ""
+
+#: searx/templates/courgette/index.html:9
+#: searx/templates/courgette/index.html:13
+#: searx/templates/courgette/results.html:5
+#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
+#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
+#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
+msgid "preferences"
+msgstr "προτιμήσεις"
+
+#: searx/templates/courgette/index.html:11
+#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
+#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
+msgid "about"
+msgstr "σχετικά"
+
+#: searx/templates/courgette/preferences.html:5
+#: searx/templates/default/preferences.html:5
+#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
+msgid "Preferences"
+msgstr "Προτιμήσεις"
+
+#: searx/templates/courgette/preferences.html:9
+#: searx/templates/default/preferences.html:9
+#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
+msgid "Default categories"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:13
+#: searx/templates/default/preferences.html:14
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
+msgid "Search language"
+msgstr "Γλώσσα αναζήτησης"
+
+#: searx/templates/courgette/preferences.html:16
+#: searx/templates/default/preferences.html:17
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
+msgid "Automatic"
+msgstr "Αυτόματα"
+
+#: searx/templates/courgette/preferences.html:24
+#: searx/templates/default/preferences.html:25
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
+msgid "Interface language"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:34
+#: searx/templates/default/preferences.html:35
+#: searx/templates/oscar/preferences.html:65
+msgid "Autocomplete"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:45
+#: searx/templates/default/preferences.html:46
+#: searx/templates/oscar/preferences.html:76
+msgid "Image proxy"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:48
+#: searx/templates/default/preferences.html:49
+#: searx/templates/oscar/preferences.html:80
+msgid "Enabled"
+msgstr "Ενεργοποιημένο"
+
+#: searx/templates/courgette/preferences.html:49
+#: searx/templates/default/preferences.html:50
+#: searx/templates/oscar/preferences.html:81
+msgid "Disabled"
+msgstr "Απενεργοποιημένο"
+
+#: searx/templates/courgette/preferences.html:54
+#: searx/templates/default/preferences.html:55
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
+msgid "Method"
+msgstr "Μέθοδος"
+
+#: searx/templates/courgette/preferences.html:63
+#: searx/templates/default/preferences.html:64
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
+msgid "SafeSearch"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:66
+#: searx/templates/default/preferences.html:67
+#: searx/templates/oscar/preferences.html:98
+msgid "Strict"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:67
+#: searx/templates/default/preferences.html:68
+#: searx/templates/oscar/preferences.html:99
+msgid "Moderate"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:68
+#: searx/templates/default/preferences.html:69
+#: searx/templates/oscar/preferences.html:100
+msgid "None"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:73
+#: searx/templates/default/preferences.html:74
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
+msgid "Themes"
+msgstr "Θέματα"
+
+#: searx/templates/courgette/preferences.html:83
+msgid "Color"
+msgstr "Χρώμα"
+
+#: searx/templates/courgette/preferences.html:86
+msgid "Blue (default)"
+msgstr "Μπλε (προεπιλεγμένο)"
+
+#: searx/templates/courgette/preferences.html:87
+msgid "Violet"
+msgstr "Βιολετί"
+
+#: searx/templates/courgette/preferences.html:88
+msgid "Green"
+msgstr "Πράσινο"
+
+#: searx/templates/courgette/preferences.html:89
+msgid "Cyan"
+msgstr "Κυανό"
+
+#: searx/templates/courgette/preferences.html:90
+msgid "Orange"
+msgstr "Πορτοκαλί"
+
+#: searx/templates/courgette/preferences.html:91
+msgid "Red"
+msgstr "Κόκκινο"
+
+#: searx/templates/courgette/preferences.html:96
+#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
+msgid "Currently used search engines"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:100
+#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
+msgid "Engine name"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:101
+#: searx/templates/default/preferences.html:89
+msgid "Category"
+msgstr "Κατηγορία"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:113
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:101
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
+msgid "Allow"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:114
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:102
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
+msgid "Block"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:122
+#: searx/templates/default/preferences.html:110
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
+msgid ""
+"These settings are stored in your cookies, this allows us not to store this "
+"data about you."
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:124
+#: searx/templates/default/preferences.html:112
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
+msgid ""
+"These cookies serve your sole convenience, we don't use these cookies to "
+"track you."
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:127
+#: searx/templates/default/preferences.html:115
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
+msgid "save"
+msgstr "αποθήκευση"
+
+#: searx/templates/courgette/preferences.html:128
+#: searx/templates/default/preferences.html:116
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
+msgid "back"
+msgstr "πίσω"
+
+#: searx/templates/courgette/results.html:12
+#: searx/templates/default/results.html:13
+#: searx/templates/oscar/results.html:110
+msgid "Search URL"
+msgstr ""
+
+#: searx/templates/courgette/results.html:16
+#: searx/templates/default/results.html:17
+#: searx/templates/oscar/results.html:115
+msgid "Download results"
+msgstr ""
+
+#: searx/templates/courgette/results.html:34
+#: searx/templates/default/results.html:35
+msgid "Answers"
+msgstr "Απαντήσεις"
+
+#: searx/templates/courgette/results.html:42
+#: searx/templates/default/results.html:43
+#: searx/templates/oscar/results.html:90
+msgid "Suggestions"
+msgstr "Προτάσεις"
+
+#: searx/templates/courgette/results.html:70
+#: searx/templates/default/results.html:81
+#: searx/templates/oscar/results.html:51 searx/templates/oscar/results.html:63
+msgid "previous page"
+msgstr "προηγούμενη σελίδα"
+
+#: searx/templates/courgette/results.html:81
+#: searx/templates/default/results.html:92
+#: searx/templates/oscar/results.html:44 searx/templates/oscar/results.html:71
+msgid "next page"
+msgstr "επόμενη σελίδα"
+
+#: searx/templates/courgette/search.html:3
+#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
+#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
+msgid "Search for..."
+msgstr "Αναζήτηση για..."
+
+#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
+msgid "Engine stats"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/images.html:4
+#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
+msgid "original context"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Seeder"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Leecher"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:9
+#: searx/templates/default/result_templates/torrent.html:9
+#: searx/templates/oscar/macros.html:21
+msgid "magnet link"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:10
+#: searx/templates/default/result_templates/torrent.html:10
+#: searx/templates/oscar/macros.html:22
+msgid "torrent file"
+msgstr ""
+
+#: searx/templates/default/categories.html:8
+msgid "Click on the magnifier to perform search"
+msgstr ""
+
+#: searx/templates/default/result_templates/code.html:3
+#: searx/templates/default/result_templates/default.html:3
+#: searx/templates/default/result_templates/map.html:9
+#: searx/templates/oscar/macros.html:20
+msgid "cached"
+msgstr ""
+
+#: searx/templates/oscar/base.html:78
+msgid "Powered by"
+msgstr ""
+
+#: searx/templates/oscar/base.html:78
+msgid "a privacy-respecting, hackable metasearch engine"
+msgstr ""
+
+#: searx/templates/oscar/navbar.html:9 searx/templates/oscar/navbar.html:33
+msgid "home"
+msgstr ""
+
+#: searx/templates/oscar/navbar.html:14 searx/templates/oscar/navbar.html:24
+msgid "Toggle navigation"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:17
+#: searx/templates/oscar/preferences.html:25
+msgid "General"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:18
+#: searx/templates/oscar/preferences.html:126
+msgid "Engines"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:45
+msgid "What language do you prefer for search?"
+msgstr "Τι γλώσσα προτιμάτε για αναζήτηση;"
+
+#: searx/templates/oscar/preferences.html:56
+msgid "Change the language of the layout"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:66
+msgid "Find stuff as you type"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:77
+msgid "Proxying image results through searx"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:86
+msgid ""
+"Change how forms are submited, <a "
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
+" rel=\"external\">learn more about request methods</a>"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:95
+msgid "Filter content"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:105
+msgid "Change searx layout"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr ""
+
+#: searx/templates/oscar/results.html:7
+msgid "Search results"
+msgstr "Αποτελέσματα αναζήτησης"
+
+#: searx/templates/oscar/results.html:105
+msgid "Links"
+msgstr "Σύνδεσμοι"
+
+#: searx/templates/oscar/search.html:6
+#: searx/templates/oscar/search_full.html:11
+msgid "Start search"
+msgstr "Έναρξη αναζήτησης"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Show search filters"
+msgstr "Προβολή φίλτρων αναζήτησης"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Hide search filters"
+msgstr "Απόκρυψη φίλτρων αναζήτησης"
+
+#: searx/templates/oscar/stats.html:2
+msgid "stats"
+msgstr "στατιστικά"
+
+#: searx/templates/oscar/messages/first_time.html:4
+#: searx/templates/oscar/messages/no_results.html:5
+#: searx/templates/oscar/messages/save_settings_successfull.html:5
+#: searx/templates/oscar/messages/unknow_error.html:5
+msgid "Close"
+msgstr ""
+
+#: searx/templates/oscar/messages/first_time.html:6
+#: searx/templates/oscar/messages/no_data_available.html:3
+msgid "Heads up!"
+msgstr ""
+
+#: searx/templates/oscar/messages/first_time.html:7
+msgid "It look like you are using searx first time."
+msgstr ""
+
+#: searx/templates/oscar/messages/js_disabled.html:2
+msgid "Warning!"
+msgstr "Προειδοποίηση!"
+
+#: searx/templates/oscar/messages/js_disabled.html:3
+msgid "Please enable JavaScript to use full functionality of this site."
+msgstr ""
+
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr ""
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr ""
+
+#: searx/templates/oscar/messages/no_data_available.html:4
+msgid "There is currently no data available. "
+msgstr ""
+
+#: searx/templates/oscar/messages/no_results.html:7
+msgid "Sorry!"
+msgstr "Συγνώμη!"
+
+#: searx/templates/oscar/messages/no_results.html:8
+msgid ""
+"we didn't find any results. Please use another query or search in more "
+"categories."
+msgstr ""
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:7
+msgid "Well done!"
+msgstr ""
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:8
+msgid "Settings saved successfully."
+msgstr ""
+
+#: searx/templates/oscar/messages/unknow_error.html:7
+msgid "Oh snap!"
+msgstr ""
+
+#: searx/templates/oscar/messages/unknow_error.html:8
+msgid "Something went wrong."
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "hide media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/images.html:23
+msgid "Get image"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/images.html:24
+msgid "View source"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "show map"
+msgstr "προβολή χάρτη"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "hide map"
+msgstr "απόκρυψη χάρτη"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "show details"
+msgstr "προβολή λεπτομερειών"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "hide details"
+msgstr "απόκρυψη λεπτομερειών"
+
+#: searx/templates/oscar/result_templates/torrent.html:7
+msgid "Filesize"
+msgstr "Μέγεθος αρχείου"
+
+#: searx/templates/oscar/result_templates/torrent.html:9
+msgid "Bytes"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:10
+msgid "kiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:11
+msgid "MiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:12
+msgid "GiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:13
+msgid "TiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:15
+msgid "Number of Files"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "hide video"
+msgstr ""
+
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr ""
diff --git a/searx/translations/en/LC_MESSAGES/messages.mo b/searx/translations/en/LC_MESSAGES/messages.mo
index 0e2010a52..e852afc30 100644
--- a/searx/translations/en/LC_MESSAGES/messages.mo
+++ b/searx/translations/en/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/en/LC_MESSAGES/messages.po b/searx/translations/en/LC_MESSAGES/messages.po
index c143038da..1f7f591c8 100644
--- a/searx/translations/en/LC_MESSAGES/messages.po
+++ b/searx/translations/en/LC_MESSAGES/messages.po
@@ -1,189 +1,232 @@
# English translations for PROJECT.
-# Copyright (C) 2014 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-02-13 18:27+0100\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
"PO-Revision-Date: 2014-01-30 15:22+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language: en\n"
"Language-Team: en <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
-#: searx/webapp.py:100
+#: searx/webapp.py:114
msgid "files"
msgstr ""
-#: searx/webapp.py:101
+#: searx/webapp.py:115
msgid "general"
msgstr ""
-#: searx/webapp.py:102
+#: searx/webapp.py:116
msgid "music"
msgstr ""
-#: searx/webapp.py:103
+#: searx/webapp.py:117
msgid "social media"
msgstr ""
-#: searx/webapp.py:104
+#: searx/webapp.py:118
msgid "images"
msgstr ""
-#: searx/webapp.py:105
+#: searx/webapp.py:119
msgid "videos"
msgstr ""
-#: searx/webapp.py:106
+#: searx/webapp.py:120
msgid "it"
msgstr ""
-#: searx/webapp.py:107
+#: searx/webapp.py:121
msgid "news"
msgstr ""
-#: searx/webapp.py:108
+#: searx/webapp.py:122
msgid "map"
msgstr ""
-#: searx/webapp.py:361
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr ""
-#: searx/webapp.py:363
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr ""
-#: searx/engines/__init__.py:182
+#: searx/engines/__init__.py:185
msgid "Page loads (sec)"
msgstr ""
-#: searx/engines/__init__.py:186
+#: searx/engines/__init__.py:189
msgid "Number of results"
msgstr ""
-#: searx/engines/__init__.py:190
+#: searx/engines/__init__.py:193
msgid "Scores"
msgstr ""
-#: searx/engines/__init__.py:194
+#: searx/engines/__init__.py:197
msgid "Scores per result"
msgstr ""
-#: searx/engines/__init__.py:198
+#: searx/engines/__init__.py:201
msgid "Errors"
msgstr ""
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr ""
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr ""
+
#: searx/templates/courgette/index.html:9
#: searx/templates/courgette/index.html:13
#: searx/templates/courgette/results.html:5
#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
msgid "preferences"
msgstr ""
#: searx/templates/courgette/index.html:11
#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
msgid "about"
msgstr ""
#: searx/templates/courgette/preferences.html:5
#: searx/templates/default/preferences.html:5
#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
msgid "Preferences"
msgstr ""
#: searx/templates/courgette/preferences.html:9
#: searx/templates/default/preferences.html:9
-#: searx/templates/oscar/preferences.html:34
#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
msgid "Default categories"
msgstr ""
#: searx/templates/courgette/preferences.html:13
#: searx/templates/default/preferences.html:14
-#: searx/templates/oscar/preferences.html:42
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
msgid "Search language"
msgstr ""
#: searx/templates/courgette/preferences.html:16
#: searx/templates/default/preferences.html:17
-#: searx/templates/oscar/preferences.html:46
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
msgid "Automatic"
msgstr ""
#: searx/templates/courgette/preferences.html:24
#: searx/templates/default/preferences.html:25
-#: searx/templates/oscar/preferences.html:53
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
msgid "Interface language"
msgstr ""
#: searx/templates/courgette/preferences.html:34
#: searx/templates/default/preferences.html:35
-#: searx/templates/oscar/preferences.html:63
+#: searx/templates/oscar/preferences.html:65
msgid "Autocomplete"
msgstr ""
#: searx/templates/courgette/preferences.html:45
#: searx/templates/default/preferences.html:46
-#: searx/templates/oscar/preferences.html:74
+#: searx/templates/oscar/preferences.html:76
msgid "Image proxy"
msgstr ""
#: searx/templates/courgette/preferences.html:48
#: searx/templates/default/preferences.html:49
-#: searx/templates/oscar/preferences.html:78
+#: searx/templates/oscar/preferences.html:80
msgid "Enabled"
msgstr ""
#: searx/templates/courgette/preferences.html:49
#: searx/templates/default/preferences.html:50
-#: searx/templates/oscar/preferences.html:79
+#: searx/templates/oscar/preferences.html:81
msgid "Disabled"
msgstr ""
#: searx/templates/courgette/preferences.html:54
#: searx/templates/default/preferences.html:55
-#: searx/templates/oscar/preferences.html:83
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
msgid "Method"
msgstr ""
#: searx/templates/courgette/preferences.html:63
#: searx/templates/default/preferences.html:64
-#: searx/templates/oscar/preferences.html:92
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
msgid "SafeSearch"
msgstr ""
#: searx/templates/courgette/preferences.html:66
#: searx/templates/default/preferences.html:67
-#: searx/templates/oscar/preferences.html:96
+#: searx/templates/oscar/preferences.html:98
msgid "Strict"
msgstr ""
#: searx/templates/courgette/preferences.html:67
#: searx/templates/default/preferences.html:68
-#: searx/templates/oscar/preferences.html:97
+#: searx/templates/oscar/preferences.html:99
msgid "Moderate"
msgstr ""
#: searx/templates/courgette/preferences.html:68
#: searx/templates/default/preferences.html:69
-#: searx/templates/oscar/preferences.html:98
+#: searx/templates/oscar/preferences.html:100
msgid "None"
msgstr ""
#: searx/templates/courgette/preferences.html:73
#: searx/templates/default/preferences.html:74
-#: searx/templates/oscar/preferences.html:102
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
msgid "Themes"
msgstr ""
@@ -217,11 +260,15 @@ msgstr ""
#: searx/templates/courgette/preferences.html:96
#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
msgid "Currently used search engines"
msgstr ""
#: searx/templates/courgette/preferences.html:100
#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
msgid "Engine name"
msgstr ""
@@ -234,7 +281,11 @@ msgstr ""
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
msgid "Allow"
msgstr ""
@@ -242,13 +293,16 @@ msgstr ""
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
msgid "Block"
msgstr ""
#: searx/templates/courgette/preferences.html:122
#: searx/templates/default/preferences.html:110
-#: searx/templates/oscar/preferences.html:161
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
msgid ""
"These settings are stored in your cookies, this allows us not to store "
"this data about you."
@@ -256,7 +310,8 @@ msgstr ""
#: searx/templates/courgette/preferences.html:124
#: searx/templates/default/preferences.html:112
-#: searx/templates/oscar/preferences.html:163
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
msgid ""
"These cookies serve your sole convenience, we don't use these cookies to "
"track you."
@@ -264,13 +319,21 @@ msgstr ""
#: searx/templates/courgette/preferences.html:127
#: searx/templates/default/preferences.html:115
-#: searx/templates/oscar/preferences.html:166
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
msgid "save"
msgstr ""
#: searx/templates/courgette/preferences.html:128
#: searx/templates/default/preferences.html:116
-#: searx/templates/oscar/preferences.html:167
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
msgid "back"
msgstr ""
@@ -312,16 +375,18 @@ msgstr ""
#: searx/templates/courgette/search.html:3
#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
msgid "Search for..."
msgstr ""
#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
-#: searx/templates/oscar/stats.html:5
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
msgid "Engine stats"
msgstr ""
#: searx/templates/courgette/result_templates/images.html:4
#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
msgid "original context"
msgstr ""
@@ -360,11 +425,11 @@ msgstr ""
msgid "cached"
msgstr ""
-#: searx/templates/oscar/base.html:74
+#: searx/templates/oscar/base.html:78
msgid "Powered by"
msgstr ""
-#: searx/templates/oscar/base.html:74
+#: searx/templates/oscar/base.html:78
msgid "a privacy-respecting, hackable metasearch engine"
msgstr ""
@@ -377,46 +442,89 @@ msgid "Toggle navigation"
msgstr ""
#: searx/templates/oscar/preferences.html:17
-#: searx/templates/oscar/preferences.html:23
+#: searx/templates/oscar/preferences.html:25
msgid "General"
msgstr ""
#: searx/templates/oscar/preferences.html:18
-#: searx/templates/oscar/preferences.html:124
+#: searx/templates/oscar/preferences.html:126
msgid "Engines"
msgstr ""
-#: searx/templates/oscar/preferences.html:43
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:45
msgid "What language do you prefer for search?"
msgstr ""
-#: searx/templates/oscar/preferences.html:54
+#: searx/templates/oscar/preferences.html:56
msgid "Change the language of the layout"
msgstr ""
-#: searx/templates/oscar/preferences.html:64
+#: searx/templates/oscar/preferences.html:66
msgid "Find stuff as you type"
msgstr ""
-#: searx/templates/oscar/preferences.html:75
+#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
msgstr ""
-#: searx/templates/oscar/preferences.html:84
+#: searx/templates/oscar/preferences.html:86
msgid ""
"Change how forms are submited, <a "
"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
" rel=\"external\">learn more about request methods</a>"
msgstr ""
-#: searx/templates/oscar/preferences.html:93
+#: searx/templates/oscar/preferences.html:95
msgid "Filter content"
msgstr ""
-#: searx/templates/oscar/preferences.html:103
+#: searx/templates/oscar/preferences.html:105
msgid "Change searx layout"
msgstr ""
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr ""
+
#: searx/templates/oscar/results.html:7
msgid "Search results"
msgstr ""
@@ -466,6 +574,14 @@ msgstr ""
msgid "Please enable JavaScript to use full functionality of this site."
msgstr ""
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr ""
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr ""
+
#: searx/templates/oscar/messages/no_data_available.html:4
msgid "There is currently no data available. "
msgstr ""
@@ -564,6 +680,10 @@ msgstr ""
msgid "hide video"
msgstr ""
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr ""
+
#~ msgid "Localization"
#~ msgstr ""
diff --git a/searx/translations/eo/LC_MESSAGES/messages.mo b/searx/translations/eo/LC_MESSAGES/messages.mo
new file mode 100644
index 000000000..d9d1d5fc8
--- /dev/null
+++ b/searx/translations/eo/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/eo/LC_MESSAGES/messages.po b/searx/translations/eo/LC_MESSAGES/messages.po
new file mode 100644
index 000000000..51323c264
--- /dev/null
+++ b/searx/translations/eo/LC_MESSAGES/messages.po
@@ -0,0 +1,686 @@
+# Translations template for PROJECT.
+# Copyright (C) 2016 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+#
+# Translators:
+# juanda097 <juanda097@openmailbox.org>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: searx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
+"Language-Team: Esperanto (http://www.transifex.com/asciimoo/searx/language/eo/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.2.0\n"
+"Language: eo\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: searx/webapp.py:114
+msgid "files"
+msgstr "dosieroj"
+
+#: searx/webapp.py:115
+msgid "general"
+msgstr "ĝenerala"
+
+#: searx/webapp.py:116
+msgid "music"
+msgstr "muziko"
+
+#: searx/webapp.py:117
+msgid "social media"
+msgstr "sociaj retservoj"
+
+#: searx/webapp.py:118
+msgid "images"
+msgstr "bildoj"
+
+#: searx/webapp.py:119
+msgid "videos"
+msgstr "videoj"
+
+#: searx/webapp.py:120
+msgid "it"
+msgstr ""
+
+#: searx/webapp.py:121
+msgid "news"
+msgstr "novaĵoj"
+
+#: searx/webapp.py:122
+msgid "map"
+msgstr "mapo"
+
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
+msgid "{minutes} minute(s) ago"
+msgstr ""
+
+#: searx/webapp.py:417
+msgid "{hours} hour(s), {minutes} minute(s) ago"
+msgstr ""
+
+#: searx/engines/__init__.py:185
+msgid "Page loads (sec)"
+msgstr ""
+
+#: searx/engines/__init__.py:189
+msgid "Number of results"
+msgstr "Nombro de rezultoj"
+
+#: searx/engines/__init__.py:193
+msgid "Scores"
+msgstr "Poentaroj"
+
+#: searx/engines/__init__.py:197
+msgid "Scores per result"
+msgstr "Poentaroj por unu rezulto"
+
+#: searx/engines/__init__.py:201
+msgid "Errors"
+msgstr "Eraroj"
+
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr "Reverki HTTP ligiloj HTTP se eble"
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr ""
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr ""
+
+#: searx/templates/courgette/index.html:9
+#: searx/templates/courgette/index.html:13
+#: searx/templates/courgette/results.html:5
+#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
+#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
+#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
+msgid "preferences"
+msgstr "preferoj"
+
+#: searx/templates/courgette/index.html:11
+#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
+#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
+msgid "about"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:5
+#: searx/templates/default/preferences.html:5
+#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
+msgid "Preferences"
+msgstr "Preferoj"
+
+#: searx/templates/courgette/preferences.html:9
+#: searx/templates/default/preferences.html:9
+#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
+msgid "Default categories"
+msgstr "Nerepago kategorioj"
+
+#: searx/templates/courgette/preferences.html:13
+#: searx/templates/default/preferences.html:14
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
+msgid "Search language"
+msgstr "Serĉo lingvo"
+
+#: searx/templates/courgette/preferences.html:16
+#: searx/templates/default/preferences.html:17
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
+msgid "Automatic"
+msgstr "Aŭtomata"
+
+#: searx/templates/courgette/preferences.html:24
+#: searx/templates/default/preferences.html:25
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
+msgid "Interface language"
+msgstr "Fasado lingvo"
+
+#: searx/templates/courgette/preferences.html:34
+#: searx/templates/default/preferences.html:35
+#: searx/templates/oscar/preferences.html:65
+msgid "Autocomplete"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:45
+#: searx/templates/default/preferences.html:46
+#: searx/templates/oscar/preferences.html:76
+msgid "Image proxy"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:48
+#: searx/templates/default/preferences.html:49
+#: searx/templates/oscar/preferences.html:80
+msgid "Enabled"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:49
+#: searx/templates/default/preferences.html:50
+#: searx/templates/oscar/preferences.html:81
+msgid "Disabled"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:54
+#: searx/templates/default/preferences.html:55
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
+msgid "Method"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:63
+#: searx/templates/default/preferences.html:64
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
+msgid "SafeSearch"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:66
+#: searx/templates/default/preferences.html:67
+#: searx/templates/oscar/preferences.html:98
+msgid "Strict"
+msgstr "Strikta"
+
+#: searx/templates/courgette/preferences.html:67
+#: searx/templates/default/preferences.html:68
+#: searx/templates/oscar/preferences.html:99
+msgid "Moderate"
+msgstr "Modera"
+
+#: searx/templates/courgette/preferences.html:68
+#: searx/templates/default/preferences.html:69
+#: searx/templates/oscar/preferences.html:100
+msgid "None"
+msgstr "Neniu"
+
+#: searx/templates/courgette/preferences.html:73
+#: searx/templates/default/preferences.html:74
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
+msgid "Themes"
+msgstr "Temoj"
+
+#: searx/templates/courgette/preferences.html:83
+msgid "Color"
+msgstr "Koloro"
+
+#: searx/templates/courgette/preferences.html:86
+msgid "Blue (default)"
+msgstr "Blua (nerepago)"
+
+#: searx/templates/courgette/preferences.html:87
+msgid "Violet"
+msgstr "Viola"
+
+#: searx/templates/courgette/preferences.html:88
+msgid "Green"
+msgstr "Verda"
+
+#: searx/templates/courgette/preferences.html:89
+msgid "Cyan"
+msgstr "Cejana"
+
+#: searx/templates/courgette/preferences.html:90
+msgid "Orange"
+msgstr "Oranĝa"
+
+#: searx/templates/courgette/preferences.html:91
+msgid "Red"
+msgstr "Ruĝa"
+
+#: searx/templates/courgette/preferences.html:96
+#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
+msgid "Currently used search engines"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:100
+#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
+msgid "Engine name"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:101
+#: searx/templates/default/preferences.html:89
+msgid "Category"
+msgstr "Kategorio"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:113
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:101
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
+msgid "Allow"
+msgstr "Permesi"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:114
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:102
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
+msgid "Block"
+msgstr "Bloko"
+
+#: searx/templates/courgette/preferences.html:122
+#: searx/templates/default/preferences.html:110
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
+msgid ""
+"These settings are stored in your cookies, this allows us not to store this "
+"data about you."
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:124
+#: searx/templates/default/preferences.html:112
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
+msgid ""
+"These cookies serve your sole convenience, we don't use these cookies to "
+"track you."
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:127
+#: searx/templates/default/preferences.html:115
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
+msgid "save"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:128
+#: searx/templates/default/preferences.html:116
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
+msgid "back"
+msgstr ""
+
+#: searx/templates/courgette/results.html:12
+#: searx/templates/default/results.html:13
+#: searx/templates/oscar/results.html:110
+msgid "Search URL"
+msgstr ""
+
+#: searx/templates/courgette/results.html:16
+#: searx/templates/default/results.html:17
+#: searx/templates/oscar/results.html:115
+msgid "Download results"
+msgstr "Deŝuto rezultoj"
+
+#: searx/templates/courgette/results.html:34
+#: searx/templates/default/results.html:35
+msgid "Answers"
+msgstr "Respondoj"
+
+#: searx/templates/courgette/results.html:42
+#: searx/templates/default/results.html:43
+#: searx/templates/oscar/results.html:90
+msgid "Suggestions"
+msgstr ""
+
+#: searx/templates/courgette/results.html:70
+#: searx/templates/default/results.html:81
+#: searx/templates/oscar/results.html:51 searx/templates/oscar/results.html:63
+msgid "previous page"
+msgstr ""
+
+#: searx/templates/courgette/results.html:81
+#: searx/templates/default/results.html:92
+#: searx/templates/oscar/results.html:44 searx/templates/oscar/results.html:71
+msgid "next page"
+msgstr ""
+
+#: searx/templates/courgette/search.html:3
+#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
+#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
+msgid "Search for..."
+msgstr ""
+
+#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
+msgid "Engine stats"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/images.html:4
+#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
+msgid "original context"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Seeder"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Leecher"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:9
+#: searx/templates/default/result_templates/torrent.html:9
+#: searx/templates/oscar/macros.html:21
+msgid "magnet link"
+msgstr ""
+
+#: searx/templates/courgette/result_templates/torrent.html:10
+#: searx/templates/default/result_templates/torrent.html:10
+#: searx/templates/oscar/macros.html:22
+msgid "torrent file"
+msgstr ""
+
+#: searx/templates/default/categories.html:8
+msgid "Click on the magnifier to perform search"
+msgstr ""
+
+#: searx/templates/default/result_templates/code.html:3
+#: searx/templates/default/result_templates/default.html:3
+#: searx/templates/default/result_templates/map.html:9
+#: searx/templates/oscar/macros.html:20
+msgid "cached"
+msgstr ""
+
+#: searx/templates/oscar/base.html:78
+msgid "Powered by"
+msgstr ""
+
+#: searx/templates/oscar/base.html:78
+msgid "a privacy-respecting, hackable metasearch engine"
+msgstr ""
+
+#: searx/templates/oscar/navbar.html:9 searx/templates/oscar/navbar.html:33
+msgid "home"
+msgstr ""
+
+#: searx/templates/oscar/navbar.html:14 searx/templates/oscar/navbar.html:24
+msgid "Toggle navigation"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:17
+#: searx/templates/oscar/preferences.html:25
+msgid "General"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:18
+#: searx/templates/oscar/preferences.html:126
+msgid "Engines"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:45
+msgid "What language do you prefer for search?"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:56
+msgid "Change the language of the layout"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:66
+msgid "Find stuff as you type"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:77
+msgid "Proxying image results through searx"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:86
+msgid ""
+"Change how forms are submited, <a "
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
+" rel=\"external\">learn more about request methods</a>"
+msgstr " Ŝanĝ kiel formoj estas submetiĝita, < href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\"> Lerni pli pri peto metodoj</> "
+
+#: searx/templates/oscar/preferences.html:95
+msgid "Filter content"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:105
+msgid "Change searx layout"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr ""
+
+#: searx/templates/oscar/results.html:7
+msgid "Search results"
+msgstr "Serĉrezultoj"
+
+#: searx/templates/oscar/results.html:105
+msgid "Links"
+msgstr ""
+
+#: searx/templates/oscar/search.html:6
+#: searx/templates/oscar/search_full.html:11
+msgid "Start search"
+msgstr ""
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Show search filters"
+msgstr ""
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Hide search filters"
+msgstr ""
+
+#: searx/templates/oscar/stats.html:2
+msgid "stats"
+msgstr "statistiko"
+
+#: searx/templates/oscar/messages/first_time.html:4
+#: searx/templates/oscar/messages/no_results.html:5
+#: searx/templates/oscar/messages/save_settings_successfull.html:5
+#: searx/templates/oscar/messages/unknow_error.html:5
+msgid "Close"
+msgstr "Ferm"
+
+#: searx/templates/oscar/messages/first_time.html:6
+#: searx/templates/oscar/messages/no_data_available.html:3
+msgid "Heads up!"
+msgstr ""
+
+#: searx/templates/oscar/messages/first_time.html:7
+msgid "It look like you are using searx first time."
+msgstr ""
+
+#: searx/templates/oscar/messages/js_disabled.html:2
+msgid "Warning!"
+msgstr "Averto!"
+
+#: searx/templates/oscar/messages/js_disabled.html:3
+msgid "Please enable JavaScript to use full functionality of this site."
+msgstr "Bonvolu ebligi al Javaskripto uzi plenan funkcion de ĉi tiu ejo."
+
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr "Informoj!"
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr ""
+
+#: searx/templates/oscar/messages/no_data_available.html:4
+msgid "There is currently no data available. "
+msgstr ""
+
+#: searx/templates/oscar/messages/no_results.html:7
+msgid "Sorry!"
+msgstr "Mizera!"
+
+#: searx/templates/oscar/messages/no_results.html:8
+msgid ""
+"we didn't find any results. Please use another query or search in more "
+"categories."
+msgstr ""
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:7
+msgid "Well done!"
+msgstr "Bone farite!"
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:8
+msgid "Settings saved successfully."
+msgstr "Fiksaĵoj savis sukcese."
+
+#: searx/templates/oscar/messages/unknow_error.html:7
+msgid "Oh snap!"
+msgstr "Aj klak!"
+
+#: searx/templates/oscar/messages/unknow_error.html:8
+msgid "Something went wrong."
+msgstr "Aĵo fuŝiĝis."
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "show media"
+msgstr "montr amaskomunikiloj"
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "hide media"
+msgstr "kaŝi amaskomunikilojn"
+
+#: searx/templates/oscar/result_templates/images.html:23
+msgid "Get image"
+msgstr "Akiri bildon"
+
+#: searx/templates/oscar/result_templates/images.html:24
+msgid "View source"
+msgstr "Vido fonto"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "show map"
+msgstr "montr mapo"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "hide map"
+msgstr "kaŝi mapon"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "show details"
+msgstr "montr detaloj"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "hide details"
+msgstr "kaŝi detalojn"
+
+#: searx/templates/oscar/result_templates/torrent.html:7
+msgid "Filesize"
+msgstr "Filesize"
+
+#: searx/templates/oscar/result_templates/torrent.html:9
+msgid "Bytes"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:10
+msgid "kiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:11
+msgid "MiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:12
+msgid "GiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:13
+msgid "TiB"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/torrent.html:15
+msgid "Number of Files"
+msgstr "Nombro de Dosieroj"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "show video"
+msgstr "montr video"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "hide video"
+msgstr "kaŝi videon"
+
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr "Ŝarĝ pli..."
diff --git a/searx/translations/es/LC_MESSAGES/messages.mo b/searx/translations/es/LC_MESSAGES/messages.mo
index a18910832..1afc7256d 100644
--- a/searx/translations/es/LC_MESSAGES/messages.mo
+++ b/searx/translations/es/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/es/LC_MESSAGES/messages.po b/searx/translations/es/LC_MESSAGES/messages.po
index 63136323d..de6c0a438 100644
--- a/searx/translations/es/LC_MESSAGES/messages.po
+++ b/searx/translations/es/LC_MESSAGES/messages.po
@@ -1,24 +1,25 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
# Adam Tauber <asciimoo@gmail.com>, 2015
# Alejandro León Aznar, 2014
# Alejandro León Aznar, 2014-2015
-# Oscar Carrero <holaoscar@protonmail.ch>, 2015
+# juanda097 <juanda097@openmailbox.org>, 2016
+# Oscar Carrero <ocf@openmailbox.org>, 2015
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-09-05 20:46+0000\n"
-"Last-Translator: Oscar Carrero <holaoscar@protonmail.ch>\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-02-24 23:02+0000\n"
+"Last-Translator: juanda097 <juanda097@openmailbox.org>\n"
"Language-Team: Spanish (http://www.transifex.com/asciimoo/searx/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -58,11 +59,15 @@ msgstr "noticias"
msgid "map"
msgstr "mapa"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "ciencia"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "hace {minutes} minuto(s)"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "hace {hours} hora(s) y {minutes} minuto(s)"
@@ -281,7 +286,7 @@ msgstr "Categoría"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -293,7 +298,7 @@ msgstr "Permitir"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
@@ -475,7 +480,7 @@ msgstr "Buscar mientras escribes"
#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
-msgstr "Filtrando resultados de imágenes en searx"
+msgstr "Filtrado de resultados de imágenes en searx"
#: searx/templates/oscar/preferences.html:86
msgid ""
diff --git a/searx/translations/fr/LC_MESSAGES/messages.mo b/searx/translations/fr/LC_MESSAGES/messages.mo
index 3f518fdf8..d33c51b63 100644
--- a/searx/translations/fr/LC_MESSAGES/messages.mo
+++ b/searx/translations/fr/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/fr/LC_MESSAGES/messages.po b/searx/translations/fr/LC_MESSAGES/messages.po
index f20673da1..77ccaa28e 100644
--- a/searx/translations/fr/LC_MESSAGES/messages.po
+++ b/searx/translations/fr/LC_MESSAGES/messages.po
@@ -1,11 +1,11 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
# Benjamin Sonntag <benjamin@sonntag.fr>, 2014
# Cqoicebordel <david.barouh@wanadoo.fr>, 2014
-# Cqoicebordel <david.barouh@wanadoo.fr>, 2014-2015
+# Cqoicebordel <david.barouh@wanadoo.fr>, 2014-2016
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
# rike, 2014
# rike, 2014
@@ -13,14 +13,14 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 15:35+0000\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:31+0000\n"
"Last-Translator: Cqoicebordel <david.barouh@wanadoo.fr>\n"
"Language-Team: French (http://www.transifex.com/asciimoo/searx/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
@@ -60,11 +60,15 @@ msgstr "actus"
msgid "map"
msgstr "carte"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "science"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "il y a {minutes} minute(s)"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "il y a {hours} heure(s), {minutes} minute(s)"
@@ -283,7 +287,7 @@ msgstr "Catégorie"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -295,7 +299,7 @@ msgstr "Autoriser"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/he/LC_MESSAGES/messages.mo b/searx/translations/he/LC_MESSAGES/messages.mo
index 84502da31..4458e0f3c 100644
--- a/searx/translations/he/LC_MESSAGES/messages.mo
+++ b/searx/translations/he/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/he/LC_MESSAGES/messages.po b/searx/translations/he/LC_MESSAGES/messages.po
index 85537a54e..753d25dfa 100644
--- a/searx/translations/he/LC_MESSAGES/messages.po
+++ b/searx/translations/he/LC_MESSAGES/messages.po
@@ -1,10 +1,10 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
# GenghisKhan <genghiskhan@gmx.ca>, 2015
-# GenghisKhan <genghiskhan@gmx.ca>, 2015
+# GenghisKhan <genghiskhan@gmx.ca>, 2015-2016
# pointhi, 2014
# rike, 2014
# stf <stefan.marsiske@gmail.com>, 2014
@@ -12,14 +12,14 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 11:19+0000\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-03-01 15:21+0000\n"
"Last-Translator: GenghisKhan <genghiskhan@gmx.ca>\n"
"Language-Team: Hebrew (http://www.transifex.com/asciimoo/searx/language/he/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: he\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -59,11 +59,15 @@ msgstr "חדשות"
msgid "map"
msgstr "מפה"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "מדע"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "לפני {minutes} דקות"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "לפני {hours} שעות, {minutes} דקות"
@@ -99,7 +103,7 @@ msgstr "חפש בעת בחירת קטגוריה"
msgid ""
"Perform search immediately if a category selected. Disable to select "
"multiple categories. (JavaScript required)"
-msgstr "בצע חיפוש לאלתר כאשר קטגוריה נבחרת. נטרל כדי לבחור קטגוריות מרובות. (מצריך JavaScript)"
+msgstr "בצע חיפוש כאשר קטגוריה נבחרת. נטרל כדי לבחור קטגוריות מרובות. (מצריך JavaScript)"
#: searx/plugins/self_info.py:20
msgid ""
@@ -177,7 +181,7 @@ msgstr "השלמה אוטומטית"
#: searx/templates/default/preferences.html:46
#: searx/templates/oscar/preferences.html:76
msgid "Image proxy"
-msgstr "proxy תמונה"
+msgstr "מתווך תמונה"
#: searx/templates/courgette/preferences.html:48
#: searx/templates/default/preferences.html:49
@@ -282,7 +286,7 @@ msgstr "קטגוריה"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -294,7 +298,7 @@ msgstr "התר"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
@@ -342,13 +346,13 @@ msgstr "חזור"
#: searx/templates/default/results.html:13
#: searx/templates/oscar/results.html:110
msgid "Search URL"
-msgstr "URL חיפוש"
+msgstr "קישור חיפוש"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:17
#: searx/templates/oscar/results.html:115
msgid "Download results"
-msgstr "הורדת תוצאות"
+msgstr "הורד תוצאות"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:35
@@ -395,13 +399,13 @@ msgstr "הקשר מקורי"
#: searx/templates/default/result_templates/torrent.html:11
#: searx/templates/oscar/result_templates/torrent.html:6
msgid "Seeder"
-msgstr "זורע"
+msgstr "זורעים"
#: searx/templates/courgette/result_templates/torrent.html:7
#: searx/templates/default/result_templates/torrent.html:11
#: searx/templates/oscar/result_templates/torrent.html:6
msgid "Leecher"
-msgstr "יונק"
+msgstr "יונקים"
#: searx/templates/courgette/result_templates/torrent.html:9
#: searx/templates/default/result_templates/torrent.html:9
@@ -476,7 +480,7 @@ msgstr "מציאת דברים בזמן הקלדה"
#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
-msgstr "Proxying תוצאות תמונה מבעד searx"
+msgstr "שלוף תוצאות תמונה דרך searx"
#: searx/templates/oscar/preferences.html:86
msgid ""
@@ -573,7 +577,7 @@ msgstr "אזהרה!"
#: searx/templates/oscar/messages/js_disabled.html:3
msgid "Please enable JavaScript to use full functionality of this site."
-msgstr "אנא אפשרו JavaScript כדי לנצל תפקודיות מלאה של אתר זה."
+msgstr "עליך לאפשר JavaScript כדי לנצל תפקודיות מלאה של אתר זה."
#: searx/templates/oscar/messages/no_cookies.html:3
msgid "Information!"
diff --git a/searx/translations/hu/LC_MESSAGES/messages.mo b/searx/translations/hu/LC_MESSAGES/messages.mo
index f540b41c8..b418c486a 100644
--- a/searx/translations/hu/LC_MESSAGES/messages.mo
+++ b/searx/translations/hu/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/hu/LC_MESSAGES/messages.po b/searx/translations/hu/LC_MESSAGES/messages.po
index 33f573bf2..ba2978e42 100644
--- a/searx/translations/hu/LC_MESSAGES/messages.po
+++ b/searx/translations/hu/LC_MESSAGES/messages.po
@@ -1,22 +1,22 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
-# Adam Tauber <asciimoo@gmail.com>, 2014-2015
+# Adam Tauber <asciimoo@gmail.com>, 2014-2016
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-25 16:29+0000\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-02-06 08:36+0000\n"
"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
"Language-Team: Hungarian (http://www.transifex.com/asciimoo/searx/language/hu/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -56,11 +56,15 @@ msgstr "hírek"
msgid "map"
msgstr "térkép"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "tudomány"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes} perce"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} óra, {minutes} perce"
@@ -279,7 +283,7 @@ msgstr "Kategória"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -291,7 +295,7 @@ msgstr "Engedélyezés"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/it/LC_MESSAGES/messages.mo b/searx/translations/it/LC_MESSAGES/messages.mo
index b9dcf955b..756f41fb2 100644
--- a/searx/translations/it/LC_MESSAGES/messages.mo
+++ b/searx/translations/it/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/it/LC_MESSAGES/messages.po b/searx/translations/it/LC_MESSAGES/messages.po
index 9fd1a3094..672d1e054 100644
--- a/searx/translations/it/LC_MESSAGES/messages.po
+++ b/searx/translations/it/LC_MESSAGES/messages.po
@@ -1,22 +1,23 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
# dp <d.pitrolo@gmx.com>, 2014
# dp <d.pitrolo@gmx.com>, 2014
+# Luc <luc.absil2@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 09:45+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
"Language-Team: Italian (http://www.transifex.com/asciimoo/searx/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -56,11 +57,15 @@ msgstr "notizie"
msgid "map"
msgstr "mappe"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "di {minutes} minuti fa"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "di {ore} h e {minutes} minuti fa"
@@ -180,13 +185,13 @@ msgstr ""
#: searx/templates/default/preferences.html:49
#: searx/templates/oscar/preferences.html:80
msgid "Enabled"
-msgstr ""
+msgstr "Attivo"
#: searx/templates/courgette/preferences.html:49
#: searx/templates/default/preferences.html:50
#: searx/templates/oscar/preferences.html:81
msgid "Disabled"
-msgstr ""
+msgstr "Disabilitato"
#: searx/templates/courgette/preferences.html:54
#: searx/templates/default/preferences.html:55
@@ -201,25 +206,25 @@ msgstr "Metodo"
#: searx/templates/oscar/preferences.html:144
#: searx/templates/oscar/preferences.html:150
msgid "SafeSearch"
-msgstr ""
+msgstr "Ricerca rassicurato"
#: searx/templates/courgette/preferences.html:66
#: searx/templates/default/preferences.html:67
#: searx/templates/oscar/preferences.html:98
msgid "Strict"
-msgstr ""
+msgstr "Stretto"
#: searx/templates/courgette/preferences.html:67
#: searx/templates/default/preferences.html:68
#: searx/templates/oscar/preferences.html:99
msgid "Moderate"
-msgstr ""
+msgstr "Medio"
#: searx/templates/courgette/preferences.html:68
#: searx/templates/default/preferences.html:69
#: searx/templates/oscar/preferences.html:100
msgid "None"
-msgstr ""
+msgstr "Nessuno"
#: searx/templates/courgette/preferences.html:73
#: searx/templates/default/preferences.html:74
@@ -230,31 +235,31 @@ msgstr "Grafica"
#: searx/templates/courgette/preferences.html:83
msgid "Color"
-msgstr ""
+msgstr "Colore"
#: searx/templates/courgette/preferences.html:86
msgid "Blue (default)"
-msgstr ""
+msgstr "Azzuro (default)"
#: searx/templates/courgette/preferences.html:87
msgid "Violet"
-msgstr ""
+msgstr "Violetto"
#: searx/templates/courgette/preferences.html:88
msgid "Green"
-msgstr ""
+msgstr "Verde"
#: searx/templates/courgette/preferences.html:89
msgid "Cyan"
-msgstr ""
+msgstr "Ciano"
#: searx/templates/courgette/preferences.html:90
msgid "Orange"
-msgstr ""
+msgstr "Arancione"
#: searx/templates/courgette/preferences.html:91
msgid "Red"
-msgstr ""
+msgstr "Rosso"
#: searx/templates/courgette/preferences.html:96
#: searx/templates/default/preferences.html:84
@@ -279,7 +284,7 @@ msgstr "Categoria"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -291,7 +296,7 @@ msgstr "Autorizza"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
@@ -326,7 +331,7 @@ msgstr "salva"
#: searx/templates/default/preferences.html:116
#: searx/templates/oscar/preferences.html:242
msgid "Reset defaults"
-msgstr ""
+msgstr "Azzerare default"
#: searx/templates/courgette/preferences.html:129
#: searx/templates/default/preferences.html:117
@@ -350,7 +355,7 @@ msgstr "Scarica i risultati"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:35
msgid "Answers"
-msgstr ""
+msgstr "Riposte"
#: searx/templates/courgette/results.html:42
#: searx/templates/default/results.html:43
@@ -392,7 +397,7 @@ msgstr ""
#: searx/templates/default/result_templates/torrent.html:11
#: searx/templates/oscar/result_templates/torrent.html:6
msgid "Seeder"
-msgstr ""
+msgstr "Seminatrice"
#: searx/templates/courgette/result_templates/torrent.html:7
#: searx/templates/default/result_templates/torrent.html:11
diff --git a/searx/translations/ja/LC_MESSAGES/messages.mo b/searx/translations/ja/LC_MESSAGES/messages.mo
index 1ab4f8260..e8bb56ed5 100644
--- a/searx/translations/ja/LC_MESSAGES/messages.mo
+++ b/searx/translations/ja/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/ja/LC_MESSAGES/messages.po b/searx/translations/ja/LC_MESSAGES/messages.po
index 0b433bd72..00158358f 100644
--- a/searx/translations/ja/LC_MESSAGES/messages.po
+++ b/searx/translations/ja/LC_MESSAGES/messages.po
@@ -1,25 +1,26 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
-# pointhi, 2014-2015
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
+# Thomas Pointhuber, 2014-2015
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014,2016
# Lucas Phillips <mail@lep.pw>, 2015
# Max <theshirinzu@gmail.com>, 2015
# pointhi, 2014
+# Thomas Pointhuber, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-09-03 07:37+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-02-14 00:11+0000\n"
+"Last-Translator: Akio Nishimura <akionux@gmail.com>\n"
"Language-Team: Japanese (http://www.transifex.com/asciimoo/searx/language/ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
@@ -29,7 +30,7 @@ msgstr "ファイル"
#: searx/webapp.py:115
msgid "general"
-msgstr "一般的な"
+msgstr "一般"
#: searx/webapp.py:116
msgid "music"
@@ -37,7 +38,7 @@ msgstr "音楽"
#: searx/webapp.py:117
msgid "social media"
-msgstr "社会的ネットワーク"
+msgstr "ソーシャルメディア"
#: searx/webapp.py:118
msgid "images"
@@ -59,17 +60,21 @@ msgstr "お知らせ"
msgid "map"
msgstr "地図"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "学問"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes}分前"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours}時間と{minutes}分前"
#: searx/engines/__init__.py:185
msgid "Page loads (sec)"
-msgstr ""
+msgstr "ページ読み込み時間 (秒)"
#: searx/engines/__init__.py:189
msgid "Number of results"
@@ -77,11 +82,11 @@ msgstr "通知の数"
#: searx/engines/__init__.py:193
msgid "Scores"
-msgstr ""
+msgstr "スコア"
#: searx/engines/__init__.py:197
msgid "Scores per result"
-msgstr ""
+msgstr "検索結果当たりスコア"
#: searx/engines/__init__.py:201
msgid "Errors"
@@ -89,31 +94,31 @@ msgstr "エラー"
#: searx/plugins/https_rewrite.py:29
msgid "Rewrite HTTP links to HTTPS if possible"
-msgstr ""
+msgstr "可能ならばHTTPリンクをHTTPSリンクに書き換える"
#: searx/plugins/search_on_category_select.py:18
msgid "Search on category select"
-msgstr ""
+msgstr "カテゴリ選択したら検索を実行"
#: searx/plugins/search_on_category_select.py:19
msgid ""
"Perform search immediately if a category selected. Disable to select "
"multiple categories. (JavaScript required)"
-msgstr ""
+msgstr "カテゴリが選択されたときに検索を実行します。複数のカテゴリを選択する場合は無効にします。(JavaScriptが必要です)"
#: searx/plugins/self_info.py:20
msgid ""
"Displays your IP if the query is \"ip\" and your user agent if the query "
"contains \"user agent\"."
-msgstr ""
+msgstr "クエリが \"ip\" の場合にあなたのIPを、クエリに\"user agent\"が含まれる場合にあなたのユーザーエージェントを表示します。"
#: searx/plugins/tracker_url_remover.py:26
msgid "Tracker URL remover"
-msgstr ""
+msgstr "トラッカーURLリムーバー"
#: searx/plugins/tracker_url_remover.py:27
msgid "Remove trackers arguments from the returned URL"
-msgstr ""
+msgstr "返されたURLからトラッカー引数を消去します。"
#: searx/templates/courgette/index.html:9
#: searx/templates/courgette/index.html:13
@@ -130,7 +135,7 @@ msgstr "設定"
#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
#: searx/templates/pix-art/index.html:7
msgid "about"
-msgstr "に関する"
+msgstr "このサイトについて"
#: searx/templates/courgette/preferences.html:5
#: searx/templates/default/preferences.html:5
@@ -144,7 +149,7 @@ msgstr "設定"
#: searx/templates/oscar/preferences.html:36
#: searx/templates/oscar/preferences.html:38
msgid "Default categories"
-msgstr ""
+msgstr "デフォルトのカテゴリ"
#: searx/templates/courgette/preferences.html:13
#: searx/templates/default/preferences.html:14
@@ -158,32 +163,32 @@ msgstr "検索の言語"
#: searx/templates/oscar/preferences.html:48
#: searx/templates/pix-art/preferences.html:12
msgid "Automatic"
-msgstr ""
+msgstr "自動"
#: searx/templates/courgette/preferences.html:24
#: searx/templates/default/preferences.html:25
#: searx/templates/oscar/preferences.html:55
#: searx/templates/pix-art/preferences.html:20
msgid "Interface language"
-msgstr "界面の言語"
+msgstr "インターフェースの言語"
#: searx/templates/courgette/preferences.html:34
#: searx/templates/default/preferences.html:35
#: searx/templates/oscar/preferences.html:65
msgid "Autocomplete"
-msgstr ""
+msgstr "オートコンプリート"
#: searx/templates/courgette/preferences.html:45
#: searx/templates/default/preferences.html:46
#: searx/templates/oscar/preferences.html:76
msgid "Image proxy"
-msgstr ""
+msgstr "画像プロキシ"
#: searx/templates/courgette/preferences.html:48
#: searx/templates/default/preferences.html:49
#: searx/templates/oscar/preferences.html:80
msgid "Enabled"
-msgstr "活性化する"
+msgstr "有効にする"
#: searx/templates/courgette/preferences.html:49
#: searx/templates/default/preferences.html:50
@@ -196,7 +201,7 @@ msgstr "使用不可能にする"
#: searx/templates/oscar/preferences.html:85
#: searx/templates/pix-art/preferences.html:30
msgid "Method"
-msgstr ""
+msgstr "方法"
#: searx/templates/courgette/preferences.html:63
#: searx/templates/default/preferences.html:64
@@ -210,13 +215,13 @@ msgstr "安全な検索"
#: searx/templates/default/preferences.html:67
#: searx/templates/oscar/preferences.html:98
msgid "Strict"
-msgstr "たくさん。"
+msgstr "厳しく"
#: searx/templates/courgette/preferences.html:67
#: searx/templates/default/preferences.html:68
#: searx/templates/oscar/preferences.html:99
msgid "Moderate"
-msgstr "少し"
+msgstr "ゆるく"
#: searx/templates/courgette/preferences.html:68
#: searx/templates/default/preferences.html:69
@@ -229,7 +234,7 @@ msgstr "なし"
#: searx/templates/oscar/preferences.html:104
#: searx/templates/pix-art/preferences.html:39
msgid "Themes"
-msgstr "図様"
+msgstr "テーマ"
#: searx/templates/courgette/preferences.html:83
msgid "Color"
@@ -237,33 +242,33 @@ msgstr "色"
#: searx/templates/courgette/preferences.html:86
msgid "Blue (default)"
-msgstr "青色 (初期設定)"
+msgstr "青 (初期設定)"
#: searx/templates/courgette/preferences.html:87
msgid "Violet"
-msgstr "菫色"
+msgstr "紫"
#: searx/templates/courgette/preferences.html:88
msgid "Green"
-msgstr "緑色"
+msgstr "緑"
#: searx/templates/courgette/preferences.html:89
msgid "Cyan"
-msgstr "シアン色"
+msgstr "シアン"
#: searx/templates/courgette/preferences.html:90
msgid "Orange"
-msgstr "朽葉色"
+msgstr "オレンジ"
#: searx/templates/courgette/preferences.html:91
msgid "Red"
-msgstr "赤色"
+msgstr "赤"
#: searx/templates/courgette/preferences.html:96
#: searx/templates/default/preferences.html:84
#: searx/templates/pix-art/preferences.html:49
msgid "Currently used search engines"
-msgstr ""
+msgstr "現在使用中の検索エンジン"
#: searx/templates/courgette/preferences.html:100
#: searx/templates/default/preferences.html:88
@@ -271,7 +276,7 @@ msgstr ""
#: searx/templates/oscar/preferences.html:152
#: searx/templates/pix-art/preferences.html:53
msgid "Engine name"
-msgstr ""
+msgstr "検索エンジン名"
#: searx/templates/courgette/preferences.html:101
#: searx/templates/default/preferences.html:89
@@ -282,7 +287,7 @@ msgstr "カテゴリー"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -294,11 +299,11 @@ msgstr "許可する"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
-msgstr "封鎖する"
+msgstr "禁止する"
#: searx/templates/courgette/preferences.html:122
#: searx/templates/default/preferences.html:110
@@ -307,7 +312,7 @@ msgstr "封鎖する"
msgid ""
"These settings are stored in your cookies, this allows us not to store this "
"data about you."
-msgstr ""
+msgstr "これらの設定はあなたのクッキーに保存されますが、これはサーバーがあなたの情報の保存するわけではありません。"
#: searx/templates/courgette/preferences.html:124
#: searx/templates/default/preferences.html:112
@@ -316,7 +321,7 @@ msgstr ""
msgid ""
"These cookies serve your sole convenience, we don't use these cookies to "
"track you."
-msgstr ""
+msgstr "クッキーはあなたが便利に使えるようにするために使うのであって、サーバーはあなたを追跡するためにクッキーを使うことはありません。"
#: searx/templates/courgette/preferences.html:127
#: searx/templates/default/preferences.html:115
@@ -329,31 +334,31 @@ msgstr "保存"
#: searx/templates/default/preferences.html:116
#: searx/templates/oscar/preferences.html:242
msgid "Reset defaults"
-msgstr ""
+msgstr "デフォルト設定に戻す"
#: searx/templates/courgette/preferences.html:129
#: searx/templates/default/preferences.html:117
#: searx/templates/oscar/preferences.html:241
#: searx/templates/pix-art/preferences.html:79
msgid "back"
-msgstr "バック"
+msgstr "戻る"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:13
#: searx/templates/oscar/results.html:110
msgid "Search URL"
-msgstr ""
+msgstr "URLを検索する"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:17
#: searx/templates/oscar/results.html:115
msgid "Download results"
-msgstr "ダウンロードの結果"
+msgstr "ダウンロードするファイル形式"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:35
msgid "Answers"
-msgstr ""
+msgstr "回答"
#: searx/templates/courgette/results.html:42
#: searx/templates/default/results.html:43
@@ -383,13 +388,13 @@ msgstr "検索する..."
#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
msgid "Engine stats"
-msgstr ""
+msgstr "検索エンジンの状態"
#: searx/templates/courgette/result_templates/images.html:4
#: searx/templates/default/result_templates/images.html:4
#: searx/templates/pix-art/result_templates/images.html:4
msgid "original context"
-msgstr ""
+msgstr "元の文脈"
#: searx/templates/courgette/result_templates/torrent.html:7
#: searx/templates/default/result_templates/torrent.html:11
@@ -407,7 +412,7 @@ msgstr "リーチャー"
#: searx/templates/default/result_templates/torrent.html:9
#: searx/templates/oscar/macros.html:21
msgid "magnet link"
-msgstr ""
+msgstr "マグネットリンク"
#: searx/templates/courgette/result_templates/torrent.html:10
#: searx/templates/default/result_templates/torrent.html:10
@@ -417,22 +422,22 @@ msgstr "トレントファイル"
#: searx/templates/default/categories.html:8
msgid "Click on the magnifier to perform search"
-msgstr ""
+msgstr "検索を実行するには虫めがねをクリックしてください"
#: searx/templates/default/result_templates/code.html:3
#: searx/templates/default/result_templates/default.html:3
#: searx/templates/default/result_templates/map.html:9
#: searx/templates/oscar/macros.html:20
msgid "cached"
-msgstr ""
+msgstr "キャッシュ"
#: searx/templates/oscar/base.html:78
msgid "Powered by"
-msgstr ""
+msgstr "提供:"
#: searx/templates/oscar/base.html:78
msgid "a privacy-respecting, hackable metasearch engine"
-msgstr ""
+msgstr "プライバシー保護を重視した、ハッカブルなメタサーチエンジン"
#: searx/templates/oscar/navbar.html:9 searx/templates/oscar/navbar.html:33
msgid "home"
@@ -440,91 +445,91 @@ msgstr "スタートページ"
#: searx/templates/oscar/navbar.html:14 searx/templates/oscar/navbar.html:24
msgid "Toggle navigation"
-msgstr ""
+msgstr "ナビゲーションをトグルする"
#: searx/templates/oscar/preferences.html:17
#: searx/templates/oscar/preferences.html:25
msgid "General"
-msgstr ""
+msgstr "一般設定"
#: searx/templates/oscar/preferences.html:18
#: searx/templates/oscar/preferences.html:126
msgid "Engines"
-msgstr ""
+msgstr "検索エンジン"
#: searx/templates/oscar/preferences.html:19
#: searx/templates/oscar/preferences.html:187
msgid "Plugins"
-msgstr ""
+msgstr "プラグイン"
#: searx/templates/oscar/preferences.html:20
#: searx/templates/oscar/preferences.html:210
msgid "Cookies"
-msgstr ""
+msgstr "クッキー"
#: searx/templates/oscar/preferences.html:45
msgid "What language do you prefer for search?"
-msgstr ""
+msgstr "検索に使う言語はどれが良いですか?"
#: searx/templates/oscar/preferences.html:56
msgid "Change the language of the layout"
-msgstr ""
+msgstr "表示する言語を変更できます"
#: searx/templates/oscar/preferences.html:66
msgid "Find stuff as you type"
-msgstr ""
+msgstr "入力補助に使う検索エンジン"
#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
-msgstr ""
+msgstr "画像検索結果をsearxでプロキシする"
#: searx/templates/oscar/preferences.html:86
msgid ""
"Change how forms are submited, <a "
"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
" rel=\"external\">learn more about request methods</a>"
-msgstr ""
+msgstr "フォームがどの方法で送信されるかを変更できます。<a href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">リクエストメソッドについて詳しく知るにはここをクリック</a>。"
#: searx/templates/oscar/preferences.html:95
msgid "Filter content"
-msgstr ""
+msgstr "コンテンツをフィルタリングする"
#: searx/templates/oscar/preferences.html:105
msgid "Change searx layout"
-msgstr "レイアウトのsearxの変更"
+msgstr "searxのレイアウトの変更"
#: searx/templates/oscar/preferences.html:143
#: searx/templates/oscar/preferences.html:151
msgid "Shortcut"
-msgstr ""
+msgstr "ショートカット"
#: searx/templates/oscar/preferences.html:145
#: searx/templates/oscar/preferences.html:149
msgid "Avg. time"
-msgstr ""
+msgstr "平均時間"
#: searx/templates/oscar/preferences.html:146
#: searx/templates/oscar/preferences.html:148
msgid "Max time"
-msgstr ""
+msgstr "最大時間"
#: searx/templates/oscar/preferences.html:213
msgid ""
"This is the list of cookies and their values searx is storing on your "
"computer."
-msgstr ""
+msgstr "これはクッキーのリストで、これらの値はあなたのコンピュータに保存されています。"
#: searx/templates/oscar/preferences.html:214
msgid "With that list, you can assess searx transparency."
-msgstr ""
+msgstr "このリストによって、あなたはsearxの透明性を評価できます。"
#: searx/templates/oscar/preferences.html:219
msgid "Cookie name"
-msgstr ""
+msgstr "クッキー名"
#: searx/templates/oscar/preferences.html:220
msgid "Value"
-msgstr ""
+msgstr "値"
#: searx/templates/oscar/results.html:7
msgid "Search results"
@@ -537,19 +542,19 @@ msgstr "リンク"
#: searx/templates/oscar/search.html:6
#: searx/templates/oscar/search_full.html:11
msgid "Start search"
-msgstr ""
+msgstr "検索を開始"
#: searx/templates/oscar/search_full.html:15
msgid "Show search filters"
-msgstr ""
+msgstr "サーチフィルタを表示"
#: searx/templates/oscar/search_full.html:15
msgid "Hide search filters"
-msgstr ""
+msgstr "サーチフィルタを隠す"
#: searx/templates/oscar/stats.html:2
msgid "stats"
-msgstr ""
+msgstr "統計"
#: searx/templates/oscar/messages/first_time.html:4
#: searx/templates/oscar/messages/no_results.html:5
@@ -561,11 +566,11 @@ msgstr "閉じる"
#: searx/templates/oscar/messages/first_time.html:6
#: searx/templates/oscar/messages/no_data_available.html:3
msgid "Heads up!"
-msgstr ""
+msgstr "お知らせ"
#: searx/templates/oscar/messages/first_time.html:7
msgid "It look like you are using searx first time."
-msgstr ""
+msgstr "searxを使うのは初めてようですね。"
#: searx/templates/oscar/messages/js_disabled.html:2
msgid "Warning!"
@@ -573,29 +578,29 @@ msgstr "意見"
#: searx/templates/oscar/messages/js_disabled.html:3
msgid "Please enable JavaScript to use full functionality of this site."
-msgstr ""
+msgstr "このサイトの機能を全て使うためにはJavaScriptを有効にしてください。"
#: searx/templates/oscar/messages/no_cookies.html:3
msgid "Information!"
-msgstr "異見"
+msgstr "お知らせ"
#: searx/templates/oscar/messages/no_cookies.html:4
msgid "currently, there are no cookies defined."
-msgstr ""
+msgstr "現在、クッキーは定義されていません。"
#: searx/templates/oscar/messages/no_data_available.html:4
msgid "There is currently no data available. "
-msgstr ""
+msgstr "現在データがありません。"
#: searx/templates/oscar/messages/no_results.html:7
msgid "Sorry!"
-msgstr "申し訳ありません"
+msgstr "申し訳ありません!"
#: searx/templates/oscar/messages/no_results.html:8
msgid ""
"we didn't find any results. Please use another query or search in more "
"categories."
-msgstr ""
+msgstr "検索結果はありませんでした。別カテゴリで、他のクエリまたは検索を試してください。"
#: searx/templates/oscar/messages/save_settings_successfull.html:7
msgid "Well done!"
@@ -603,7 +608,7 @@ msgstr "あっぱれ。"
#: searx/templates/oscar/messages/save_settings_successfull.html:8
msgid "Settings saved successfully."
-msgstr ""
+msgstr "設定の保存に成功しました。"
#: searx/templates/oscar/messages/unknow_error.html:7
msgid "Oh snap!"
@@ -611,39 +616,39 @@ msgstr "ちぇっ"
#: searx/templates/oscar/messages/unknow_error.html:8
msgid "Something went wrong."
-msgstr ""
+msgstr "なにか問題が起こっているようです。"
#: searx/templates/oscar/result_templates/default.html:7
msgid "show media"
-msgstr ""
+msgstr "メディアを表示する"
#: searx/templates/oscar/result_templates/default.html:7
msgid "hide media"
-msgstr ""
+msgstr "メディアを隠す"
#: searx/templates/oscar/result_templates/images.html:23
msgid "Get image"
-msgstr ""
+msgstr "画像を取得する"
#: searx/templates/oscar/result_templates/images.html:24
msgid "View source"
-msgstr ""
+msgstr "ソースを閲覧する"
#: searx/templates/oscar/result_templates/map.html:7
msgid "show map"
-msgstr ""
+msgstr "地図を表示する"
#: searx/templates/oscar/result_templates/map.html:7
msgid "hide map"
-msgstr ""
+msgstr "地図を隠す"
#: searx/templates/oscar/result_templates/map.html:11
msgid "show details"
-msgstr ""
+msgstr "詳細を表示する"
#: searx/templates/oscar/result_templates/map.html:11
msgid "hide details"
-msgstr ""
+msgstr "詳細を隠す"
#: searx/templates/oscar/result_templates/torrent.html:7
msgid "Filesize"
@@ -651,23 +656,23 @@ msgstr "ファイル・サイズ"
#: searx/templates/oscar/result_templates/torrent.html:9
msgid "Bytes"
-msgstr ""
+msgstr "バイト"
#: searx/templates/oscar/result_templates/torrent.html:10
msgid "kiB"
-msgstr ""
+msgstr "キロバイト"
#: searx/templates/oscar/result_templates/torrent.html:11
msgid "MiB"
-msgstr ""
+msgstr "メガバイト"
#: searx/templates/oscar/result_templates/torrent.html:12
msgid "GiB"
-msgstr ""
+msgstr "ギガバイト"
#: searx/templates/oscar/result_templates/torrent.html:13
msgid "TiB"
-msgstr ""
+msgstr "テラバイト"
#: searx/templates/oscar/result_templates/torrent.html:15
msgid "Number of Files"
@@ -675,12 +680,12 @@ msgstr "ファイル数"
#: searx/templates/oscar/result_templates/videos.html:7
msgid "show video"
-msgstr ""
+msgstr "動画を表示する"
#: searx/templates/oscar/result_templates/videos.html:7
msgid "hide video"
-msgstr ""
+msgstr "動画を隠す"
#: searx/templates/pix-art/results.html:28
msgid "Load more..."
-msgstr ""
+msgstr "もっと見る…"
diff --git a/searx/translations/nl/LC_MESSAGES/messages.mo b/searx/translations/nl/LC_MESSAGES/messages.mo
index ea2052f97..bd55e44fd 100644
--- a/searx/translations/nl/LC_MESSAGES/messages.mo
+++ b/searx/translations/nl/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/nl/LC_MESSAGES/messages.po b/searx/translations/nl/LC_MESSAGES/messages.po
index 1871d7e77..b04ede24b 100644
--- a/searx/translations/nl/LC_MESSAGES/messages.po
+++ b/searx/translations/nl/LC_MESSAGES/messages.po
@@ -1,22 +1,22 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
# André Koot <meneer@tken.net>, 2014-2015
-# Nathan Follens, 2015
+# Nathan Follens, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 14:41+0000\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-31 11:35+0000\n"
"Last-Translator: Nathan Follens\n"
"Language-Team: Dutch (http://www.transifex.com/asciimoo/searx/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -56,11 +56,15 @@ msgstr "nieuws"
msgid "map"
msgstr "kaart"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "wetenschap"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes} min geleden"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} uur, {minutes} min geleden"
@@ -279,7 +283,7 @@ msgstr "Categorie"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -291,7 +295,7 @@ msgstr "Toestaan"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/pt/LC_MESSAGES/messages.mo b/searx/translations/pt/LC_MESSAGES/messages.mo
index 34430905f..acf83eb6f 100644
--- a/searx/translations/pt/LC_MESSAGES/messages.mo
+++ b/searx/translations/pt/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/pt/LC_MESSAGES/messages.po b/searx/translations/pt/LC_MESSAGES/messages.po
index 7c58ebcb7..2899a65e0 100644
--- a/searx/translations/pt/LC_MESSAGES/messages.po
+++ b/searx/translations/pt/LC_MESSAGES/messages.po
@@ -1,189 +1,232 @@
# Portuguese translations for PROJECT.
-# Copyright (C) 2014 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-02-13 18:27+0100\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
"PO-Revision-Date: 2014-01-30 15:22+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language: pt\n"
"Language-Team: en <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
-#: searx/webapp.py:100
+#: searx/webapp.py:114
msgid "files"
msgstr "arquivos"
-#: searx/webapp.py:101
+#: searx/webapp.py:115
msgid "general"
msgstr "geral"
-#: searx/webapp.py:102
+#: searx/webapp.py:116
msgid "music"
msgstr "música"
-#: searx/webapp.py:103
+#: searx/webapp.py:117
msgid "social media"
msgstr "mídias sociais"
-#: searx/webapp.py:104
+#: searx/webapp.py:118
msgid "images"
msgstr "imagens"
-#: searx/webapp.py:105
+#: searx/webapp.py:119
msgid "videos"
msgstr "vídeos"
-#: searx/webapp.py:106
+#: searx/webapp.py:120
msgid "it"
msgstr "informática"
-#: searx/webapp.py:107
+#: searx/webapp.py:121
msgid "news"
msgstr "notícias"
-#: searx/webapp.py:108
+#: searx/webapp.py:122
msgid "map"
msgstr "mapa"
-#: searx/webapp.py:361
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "Há {minutes} minutos"
-#: searx/webapp.py:363
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "Há {hours} e {minutes} minutos"
-#: searx/engines/__init__.py:182
+#: searx/engines/__init__.py:185
msgid "Page loads (sec)"
msgstr "Tempo de carregamento (seg)"
-#: searx/engines/__init__.py:186
+#: searx/engines/__init__.py:189
msgid "Number of results"
msgstr "Número de resultados"
-#: searx/engines/__init__.py:190
+#: searx/engines/__init__.py:193
msgid "Scores"
msgstr "Pontuações"
-#: searx/engines/__init__.py:194
+#: searx/engines/__init__.py:197
msgid "Scores per result"
msgstr "Pontuações por resultado"
-#: searx/engines/__init__.py:198
+#: searx/engines/__init__.py:201
msgid "Errors"
msgstr "Erros"
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr ""
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr ""
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr ""
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr ""
+
#: searx/templates/courgette/index.html:9
#: searx/templates/courgette/index.html:13
#: searx/templates/courgette/results.html:5
#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
msgid "preferences"
msgstr "preferências"
#: searx/templates/courgette/index.html:11
#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
msgid "about"
msgstr "sobre"
#: searx/templates/courgette/preferences.html:5
#: searx/templates/default/preferences.html:5
#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
msgid "Preferences"
msgstr "Preferências"
#: searx/templates/courgette/preferences.html:9
#: searx/templates/default/preferences.html:9
-#: searx/templates/oscar/preferences.html:34
#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
msgid "Default categories"
msgstr "Categorias padrão"
#: searx/templates/courgette/preferences.html:13
#: searx/templates/default/preferences.html:14
-#: searx/templates/oscar/preferences.html:42
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
msgid "Search language"
msgstr "Língua de pesquisa"
#: searx/templates/courgette/preferences.html:16
#: searx/templates/default/preferences.html:17
-#: searx/templates/oscar/preferences.html:46
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
msgid "Automatic"
msgstr "Automático"
#: searx/templates/courgette/preferences.html:24
#: searx/templates/default/preferences.html:25
-#: searx/templates/oscar/preferences.html:53
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
msgid "Interface language"
msgstr "Linguagem da interface"
#: searx/templates/courgette/preferences.html:34
#: searx/templates/default/preferences.html:35
-#: searx/templates/oscar/preferences.html:63
+#: searx/templates/oscar/preferences.html:65
msgid "Autocomplete"
msgstr "Autocompletar"
#: searx/templates/courgette/preferences.html:45
#: searx/templates/default/preferences.html:46
-#: searx/templates/oscar/preferences.html:74
+#: searx/templates/oscar/preferences.html:76
msgid "Image proxy"
msgstr "Proxy de imagens"
#: searx/templates/courgette/preferences.html:48
#: searx/templates/default/preferences.html:49
-#: searx/templates/oscar/preferences.html:78
+#: searx/templates/oscar/preferences.html:80
msgid "Enabled"
msgstr "Ativado"
#: searx/templates/courgette/preferences.html:49
#: searx/templates/default/preferences.html:50
-#: searx/templates/oscar/preferences.html:79
+#: searx/templates/oscar/preferences.html:81
msgid "Disabled"
msgstr "Desativado"
#: searx/templates/courgette/preferences.html:54
#: searx/templates/default/preferences.html:55
-#: searx/templates/oscar/preferences.html:83
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
msgid "Method"
msgstr "Método"
#: searx/templates/courgette/preferences.html:63
#: searx/templates/default/preferences.html:64
-#: searx/templates/oscar/preferences.html:92
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
msgid "SafeSearch"
msgstr "Pesquisa segura"
#: searx/templates/courgette/preferences.html:66
#: searx/templates/default/preferences.html:67
-#: searx/templates/oscar/preferences.html:96
+#: searx/templates/oscar/preferences.html:98
msgid "Strict"
msgstr "Estrito"
#: searx/templates/courgette/preferences.html:67
#: searx/templates/default/preferences.html:68
-#: searx/templates/oscar/preferences.html:97
+#: searx/templates/oscar/preferences.html:99
msgid "Moderate"
msgstr "Moderado"
#: searx/templates/courgette/preferences.html:68
#: searx/templates/default/preferences.html:69
-#: searx/templates/oscar/preferences.html:98
+#: searx/templates/oscar/preferences.html:100
msgid "None"
msgstr "Nenhum"
#: searx/templates/courgette/preferences.html:73
#: searx/templates/default/preferences.html:74
-#: searx/templates/oscar/preferences.html:102
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
msgid "Themes"
msgstr "Temas"
@@ -217,11 +260,15 @@ msgstr "Vermelho"
#: searx/templates/courgette/preferences.html:96
#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
msgid "Currently used search engines"
msgstr "Motores de busca sendo usados atualmente"
#: searx/templates/courgette/preferences.html:100
#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
msgid "Engine name"
msgstr "Nome do motor"
@@ -234,7 +281,11 @@ msgstr "Categoria"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
msgid "Allow"
msgstr "Permitir"
@@ -242,35 +293,51 @@ msgstr "Permitir"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
msgid "Block"
msgstr "Bloquear"
#: searx/templates/courgette/preferences.html:122
#: searx/templates/default/preferences.html:110
-#: searx/templates/oscar/preferences.html:161
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
msgid ""
"These settings are stored in your cookies, this allows us not to store "
"this data about you."
-msgstr "Essas configurações são armazenadas em seus cookies, isto nos permite não armazenar dados sobre você."
+msgstr ""
+"Essas configurações são armazenadas em seus cookies, isto nos permite não"
+" armazenar dados sobre você."
#: searx/templates/courgette/preferences.html:124
#: searx/templates/default/preferences.html:112
-#: searx/templates/oscar/preferences.html:163
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
msgid ""
"These cookies serve your sole convenience, we don't use these cookies to "
"track you."
-msgstr "Esses cookies servem unicamente para sua conveniência, nós não usamos eles para te rastrear."
+msgstr ""
+"Esses cookies servem unicamente para sua conveniência, nós não usamos "
+"eles para te rastrear."
#: searx/templates/courgette/preferences.html:127
#: searx/templates/default/preferences.html:115
-#: searx/templates/oscar/preferences.html:166
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
msgid "save"
msgstr "salvar"
#: searx/templates/courgette/preferences.html:128
#: searx/templates/default/preferences.html:116
-#: searx/templates/oscar/preferences.html:167
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr ""
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
msgid "back"
msgstr "voltar"
@@ -312,16 +379,18 @@ msgstr "próxima página"
#: searx/templates/courgette/search.html:3
#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
msgid "Search for..."
msgstr "Pesquisar por..."
#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
-#: searx/templates/oscar/stats.html:5
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
msgid "Engine stats"
msgstr "Estatísticas do motor de busca"
#: searx/templates/courgette/result_templates/images.html:4
#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
msgid "original context"
msgstr "contexto original"
@@ -360,11 +429,11 @@ msgstr "Clique na lupa para realizar a busca"
msgid "cached"
msgstr "em cache"
-#: searx/templates/oscar/base.html:74
+#: searx/templates/oscar/base.html:78
msgid "Powered by"
msgstr "Criado por"
-#: searx/templates/oscar/base.html:74
+#: searx/templates/oscar/base.html:78
msgid "a privacy-respecting, hackable metasearch engine"
msgstr "Um metapesquisador hackeável que respeita a privacidade"
@@ -377,46 +446,92 @@ msgid "Toggle navigation"
msgstr "Mudar navegação"
#: searx/templates/oscar/preferences.html:17
-#: searx/templates/oscar/preferences.html:23
+#: searx/templates/oscar/preferences.html:25
msgid "General"
msgstr "Geral"
#: searx/templates/oscar/preferences.html:18
-#: searx/templates/oscar/preferences.html:124
+#: searx/templates/oscar/preferences.html:126
msgid "Engines"
msgstr "Motores de busca"
-#: searx/templates/oscar/preferences.html:43
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:45
msgid "What language do you prefer for search?"
msgstr "Que linguagem você prefere para a busca?"
-#: searx/templates/oscar/preferences.html:54
+#: searx/templates/oscar/preferences.html:56
msgid "Change the language of the layout"
msgstr "Mudar a linguagem da interface"
-#: searx/templates/oscar/preferences.html:64
+#: searx/templates/oscar/preferences.html:66
msgid "Find stuff as you type"
msgstr "Achar coisas enquanto você digita"
-#: searx/templates/oscar/preferences.html:75
+#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
msgstr "Filtrar resultados de imagens no searx"
-#: searx/templates/oscar/preferences.html:84
+#: searx/templates/oscar/preferences.html:86
msgid ""
"Change how forms are submited, <a "
"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
" rel=\"external\">learn more about request methods</a>"
-msgstr "Muda o modo como formulários são enviados <a href=\"https://pt.wikipedia.org/wiki/Hypertext_Transfer_Protocol#M.C3.A9todosn\" rel=\"external\">mais informações sobre os modos de pedido</a>"
+msgstr ""
+"Muda o modo como formulários são enviados <a "
+"href=\"https://pt.wikipedia.org/wiki/Hypertext_Transfer_Protocol#M.C3.A9todosn\""
+" rel=\"external\">mais informações sobre os modos de pedido</a>"
-#: searx/templates/oscar/preferences.html:93
+#: searx/templates/oscar/preferences.html:95
msgid "Filter content"
msgstr "Filtrar conteúdo"
-#: searx/templates/oscar/preferences.html:103
+#: searx/templates/oscar/preferences.html:105
msgid "Change searx layout"
msgstr "Mudar a interface do searx"
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr ""
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr ""
+
#: searx/templates/oscar/results.html:7
msgid "Search results"
msgstr "Pesquisar"
@@ -464,7 +579,17 @@ msgstr "Atenção!"
#: searx/templates/oscar/messages/js_disabled.html:3
msgid "Please enable JavaScript to use full functionality of this site."
-msgstr "Ative o Javascript para poder usar toda a funcionalidade deste site, por favor."
+msgstr ""
+"Ative o Javascript para poder usar toda a funcionalidade deste site, por "
+"favor."
+
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr ""
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr ""
#: searx/templates/oscar/messages/no_data_available.html:4
msgid "There is currently no data available. "
@@ -478,7 +603,9 @@ msgstr "Desculpe!"
msgid ""
"we didn't find any results. Please use another query or search in more "
"categories."
-msgstr "Nós não achamos nenhum resultado. Reformule sua busca ou procure em outras categorias, por favor."
+msgstr ""
+"Nós não achamos nenhum resultado. Reformule sua busca ou procure em "
+"outras categorias, por favor."
#: searx/templates/oscar/messages/save_settings_successfull.html:7
msgid "Well done!"
@@ -564,6 +691,10 @@ msgstr "mostrar vídeo"
msgid "hide video"
msgstr "esconder vídeo"
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr ""
+
#~ msgid "Localization"
#~ msgstr "Localização"
@@ -572,3 +703,4 @@ msgstr "esconder vídeo"
#~ msgid "No"
#~ msgstr "Não"
+
diff --git a/searx/translations/pt_BR/LC_MESSAGES/messages.mo b/searx/translations/pt_BR/LC_MESSAGES/messages.mo
new file mode 100644
index 000000000..325b8f267
--- /dev/null
+++ b/searx/translations/pt_BR/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/pt_BR/LC_MESSAGES/messages.po b/searx/translations/pt_BR/LC_MESSAGES/messages.po
new file mode 100644
index 000000000..8580ff528
--- /dev/null
+++ b/searx/translations/pt_BR/LC_MESSAGES/messages.po
@@ -0,0 +1,686 @@
+# Translations template for PROJECT.
+# Copyright (C) 2016 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+#
+# Translators:
+# Neton Brício <fervelinux@gmail.com>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: searx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/asciimoo/searx/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.2.0\n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: searx/webapp.py:114
+msgid "files"
+msgstr "Arquivos"
+
+#: searx/webapp.py:115
+msgid "general"
+msgstr "geral"
+
+#: searx/webapp.py:116
+msgid "music"
+msgstr "áudio"
+
+#: searx/webapp.py:117
+msgid "social media"
+msgstr "rede social"
+
+#: searx/webapp.py:118
+msgid "images"
+msgstr "imagens"
+
+#: searx/webapp.py:119
+msgid "videos"
+msgstr "vídeos"
+
+#: searx/webapp.py:120
+msgid "it"
+msgstr "códigos"
+
+#: searx/webapp.py:121
+msgid "news"
+msgstr "notícias"
+
+#: searx/webapp.py:122
+msgid "map"
+msgstr "mapas"
+
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
+msgid "{minutes} minute(s) ago"
+msgstr "{minutos} minuto(s) atrás"
+
+#: searx/webapp.py:417
+msgid "{hours} hour(s), {minutes} minute(s) ago"
+msgstr "{horas} hora(s), {minutos} minuto(s) atrás"
+
+#: searx/engines/__init__.py:185
+msgid "Page loads (sec)"
+msgstr "Carregamento da página (sec)"
+
+#: searx/engines/__init__.py:189
+msgid "Number of results"
+msgstr "Número de resultados"
+
+#: searx/engines/__init__.py:193
+msgid "Scores"
+msgstr "Pontuações"
+
+#: searx/engines/__init__.py:197
+msgid "Scores per result"
+msgstr "Pontuações por resultado"
+
+#: searx/engines/__init__.py:201
+msgid "Errors"
+msgstr "Erros"
+
+#: searx/plugins/https_rewrite.py:29
+msgid "Rewrite HTTP links to HTTPS if possible"
+msgstr "Redirecionar conexões HTTP para HTTPS, se possível"
+
+#: searx/plugins/search_on_category_select.py:18
+msgid "Search on category select"
+msgstr "Pesquisar na categoria selecionada"
+
+#: searx/plugins/search_on_category_select.py:19
+msgid ""
+"Perform search immediately if a category selected. Disable to select "
+"multiple categories. (JavaScript required)"
+msgstr "Executar a busca imediatamente se a categoria está selecionada. Desativar para selecionar várias categorias. (Necessário JavaScript)"
+
+#: searx/plugins/self_info.py:20
+msgid ""
+"Displays your IP if the query is \"ip\" and your user agent if the query "
+"contains \"user agent\"."
+msgstr "Exibe o seu IP se a consulta é \"ip\" e seu agente de usuário, se a consulta contém \"user agent\"."
+
+#: searx/plugins/tracker_url_remover.py:26
+msgid "Tracker URL remover"
+msgstr "Remover Tracker da url"
+
+#: searx/plugins/tracker_url_remover.py:27
+msgid "Remove trackers arguments from the returned URL"
+msgstr "Remover argumentos de url retornáveis"
+
+#: searx/templates/courgette/index.html:9
+#: searx/templates/courgette/index.html:13
+#: searx/templates/courgette/results.html:5
+#: searx/templates/default/index.html:8 searx/templates/default/index.html:12
+#: searx/templates/oscar/navbar.html:7 searx/templates/oscar/navbar.html:35
+#: searx/templates/oscar/preferences.html:3
+#: searx/templates/pix-art/index.html:8
+msgid "preferences"
+msgstr "configurações"
+
+#: searx/templates/courgette/index.html:11
+#: searx/templates/default/index.html:10 searx/templates/oscar/about.html:3
+#: searx/templates/oscar/navbar.html:8 searx/templates/oscar/navbar.html:34
+#: searx/templates/pix-art/index.html:7
+msgid "about"
+msgstr "sobre"
+
+#: searx/templates/courgette/preferences.html:5
+#: searx/templates/default/preferences.html:5
+#: searx/templates/oscar/preferences.html:12
+#: searx/templates/pix-art/preferences.html:5
+msgid "Preferences"
+msgstr "Configurações"
+
+#: searx/templates/courgette/preferences.html:9
+#: searx/templates/default/preferences.html:9
+#: searx/templates/oscar/preferences.html:36
+#: searx/templates/oscar/preferences.html:38
+msgid "Default categories"
+msgstr "Categoria padrão"
+
+#: searx/templates/courgette/preferences.html:13
+#: searx/templates/default/preferences.html:14
+#: searx/templates/oscar/preferences.html:44
+#: searx/templates/pix-art/preferences.html:9
+msgid "Search language"
+msgstr "Idioma de busca"
+
+#: searx/templates/courgette/preferences.html:16
+#: searx/templates/default/preferences.html:17
+#: searx/templates/oscar/preferences.html:48
+#: searx/templates/pix-art/preferences.html:12
+msgid "Automatic"
+msgstr "Automático"
+
+#: searx/templates/courgette/preferences.html:24
+#: searx/templates/default/preferences.html:25
+#: searx/templates/oscar/preferences.html:55
+#: searx/templates/pix-art/preferences.html:20
+msgid "Interface language"
+msgstr "Idioma da interface "
+
+#: searx/templates/courgette/preferences.html:34
+#: searx/templates/default/preferences.html:35
+#: searx/templates/oscar/preferences.html:65
+msgid "Autocomplete"
+msgstr "Autocompletar"
+
+#: searx/templates/courgette/preferences.html:45
+#: searx/templates/default/preferences.html:46
+#: searx/templates/oscar/preferences.html:76
+msgid "Image proxy"
+msgstr "Imagem proxy"
+
+#: searx/templates/courgette/preferences.html:48
+#: searx/templates/default/preferences.html:49
+#: searx/templates/oscar/preferences.html:80
+msgid "Enabled"
+msgstr "Habilitado "
+
+#: searx/templates/courgette/preferences.html:49
+#: searx/templates/default/preferences.html:50
+#: searx/templates/oscar/preferences.html:81
+msgid "Disabled"
+msgstr "Desabilitado"
+
+#: searx/templates/courgette/preferences.html:54
+#: searx/templates/default/preferences.html:55
+#: searx/templates/oscar/preferences.html:85
+#: searx/templates/pix-art/preferences.html:30
+msgid "Method"
+msgstr "Método"
+
+#: searx/templates/courgette/preferences.html:63
+#: searx/templates/default/preferences.html:64
+#: searx/templates/oscar/preferences.html:94
+#: searx/templates/oscar/preferences.html:144
+#: searx/templates/oscar/preferences.html:150
+msgid "SafeSearch"
+msgstr "Busca Segura"
+
+#: searx/templates/courgette/preferences.html:66
+#: searx/templates/default/preferences.html:67
+#: searx/templates/oscar/preferences.html:98
+msgid "Strict"
+msgstr "Forte"
+
+#: searx/templates/courgette/preferences.html:67
+#: searx/templates/default/preferences.html:68
+#: searx/templates/oscar/preferences.html:99
+msgid "Moderate"
+msgstr "Moderado"
+
+#: searx/templates/courgette/preferences.html:68
+#: searx/templates/default/preferences.html:69
+#: searx/templates/oscar/preferences.html:100
+msgid "None"
+msgstr "Nenhum"
+
+#: searx/templates/courgette/preferences.html:73
+#: searx/templates/default/preferences.html:74
+#: searx/templates/oscar/preferences.html:104
+#: searx/templates/pix-art/preferences.html:39
+msgid "Themes"
+msgstr "Temas"
+
+#: searx/templates/courgette/preferences.html:83
+msgid "Color"
+msgstr "Cor"
+
+#: searx/templates/courgette/preferences.html:86
+msgid "Blue (default)"
+msgstr "Azul (padrão)"
+
+#: searx/templates/courgette/preferences.html:87
+msgid "Violet"
+msgstr "Violeta"
+
+#: searx/templates/courgette/preferences.html:88
+msgid "Green"
+msgstr "Verde"
+
+#: searx/templates/courgette/preferences.html:89
+msgid "Cyan"
+msgstr "Ciano"
+
+#: searx/templates/courgette/preferences.html:90
+msgid "Orange"
+msgstr "Laranja"
+
+#: searx/templates/courgette/preferences.html:91
+msgid "Red"
+msgstr "Vermelho"
+
+#: searx/templates/courgette/preferences.html:96
+#: searx/templates/default/preferences.html:84
+#: searx/templates/pix-art/preferences.html:49
+msgid "Currently used search engines"
+msgstr "Serviço de busca usado atualmente"
+
+#: searx/templates/courgette/preferences.html:100
+#: searx/templates/default/preferences.html:88
+#: searx/templates/oscar/preferences.html:142
+#: searx/templates/oscar/preferences.html:152
+#: searx/templates/pix-art/preferences.html:53
+msgid "Engine name"
+msgstr "Nome do serviço"
+
+#: searx/templates/courgette/preferences.html:101
+#: searx/templates/default/preferences.html:89
+msgid "Category"
+msgstr "Categoria"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:113
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:101
+#: searx/templates/oscar/macros.html:71
+#: searx/templates/oscar/preferences.html:141
+#: searx/templates/oscar/preferences.html:153
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:64
+msgid "Allow"
+msgstr "Ativo"
+
+#: searx/templates/courgette/preferences.html:102
+#: searx/templates/courgette/preferences.html:114
+#: searx/templates/default/preferences.html:90
+#: searx/templates/default/preferences.html:102
+#: searx/templates/oscar/macros.html:70
+#: searx/templates/pix-art/preferences.html:54
+#: searx/templates/pix-art/preferences.html:65
+msgid "Block"
+msgstr "Bloqueado"
+
+#: searx/templates/courgette/preferences.html:122
+#: searx/templates/default/preferences.html:110
+#: searx/templates/oscar/preferences.html:235
+#: searx/templates/pix-art/preferences.html:73
+msgid ""
+"These settings are stored in your cookies, this allows us not to store this "
+"data about you."
+msgstr "Essas configurações são armazenadas em seus cookies, nos não armazenamos nenhum dado a seu respeito."
+
+#: searx/templates/courgette/preferences.html:124
+#: searx/templates/default/preferences.html:112
+#: searx/templates/oscar/preferences.html:237
+#: searx/templates/pix-art/preferences.html:75
+msgid ""
+"These cookies serve your sole convenience, we don't use these cookies to "
+"track you."
+msgstr "Estes cookies servem ao seu único propósito, nós não usamos esses cookies para rastreá-lo."
+
+#: searx/templates/courgette/preferences.html:127
+#: searx/templates/default/preferences.html:115
+#: searx/templates/oscar/preferences.html:240
+#: searx/templates/pix-art/preferences.html:78
+msgid "save"
+msgstr "salvar"
+
+#: searx/templates/courgette/preferences.html:128
+#: searx/templates/default/preferences.html:116
+#: searx/templates/oscar/preferences.html:242
+msgid "Reset defaults"
+msgstr "Redefinir configurações"
+
+#: searx/templates/courgette/preferences.html:129
+#: searx/templates/default/preferences.html:117
+#: searx/templates/oscar/preferences.html:241
+#: searx/templates/pix-art/preferences.html:79
+msgid "back"
+msgstr "voltar"
+
+#: searx/templates/courgette/results.html:12
+#: searx/templates/default/results.html:13
+#: searx/templates/oscar/results.html:110
+msgid "Search URL"
+msgstr "Buscar URL"
+
+#: searx/templates/courgette/results.html:16
+#: searx/templates/default/results.html:17
+#: searx/templates/oscar/results.html:115
+msgid "Download results"
+msgstr "Resultados para download"
+
+#: searx/templates/courgette/results.html:34
+#: searx/templates/default/results.html:35
+msgid "Answers"
+msgstr "Perguntas"
+
+#: searx/templates/courgette/results.html:42
+#: searx/templates/default/results.html:43
+#: searx/templates/oscar/results.html:90
+msgid "Suggestions"
+msgstr "Sugestões"
+
+#: searx/templates/courgette/results.html:70
+#: searx/templates/default/results.html:81
+#: searx/templates/oscar/results.html:51 searx/templates/oscar/results.html:63
+msgid "previous page"
+msgstr "Página anterior"
+
+#: searx/templates/courgette/results.html:81
+#: searx/templates/default/results.html:92
+#: searx/templates/oscar/results.html:44 searx/templates/oscar/results.html:71
+msgid "next page"
+msgstr "Próxima página"
+
+#: searx/templates/courgette/search.html:3
+#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
+#: searx/templates/oscar/search_full.html:9
+#: searx/templates/pix-art/search.html:3
+msgid "Search for..."
+msgstr "Buscar por..."
+
+#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
+#: searx/templates/oscar/stats.html:5 searx/templates/pix-art/stats.html:4
+msgid "Engine stats"
+msgstr "Estatísticas de busca"
+
+#: searx/templates/courgette/result_templates/images.html:4
+#: searx/templates/default/result_templates/images.html:4
+#: searx/templates/pix-art/result_templates/images.html:4
+msgid "original context"
+msgstr "Contexto original"
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Seeder"
+msgstr "Semeador"
+
+#: searx/templates/courgette/result_templates/torrent.html:7
+#: searx/templates/default/result_templates/torrent.html:11
+#: searx/templates/oscar/result_templates/torrent.html:6
+msgid "Leecher"
+msgstr "Leecher"
+
+#: searx/templates/courgette/result_templates/torrent.html:9
+#: searx/templates/default/result_templates/torrent.html:9
+#: searx/templates/oscar/macros.html:21
+msgid "magnet link"
+msgstr "Link magnético"
+
+#: searx/templates/courgette/result_templates/torrent.html:10
+#: searx/templates/default/result_templates/torrent.html:10
+#: searx/templates/oscar/macros.html:22
+msgid "torrent file"
+msgstr "Arquivo torrent"
+
+#: searx/templates/default/categories.html:8
+msgid "Click on the magnifier to perform search"
+msgstr "Clique na lupa para executar a busca"
+
+#: searx/templates/default/result_templates/code.html:3
+#: searx/templates/default/result_templates/default.html:3
+#: searx/templates/default/result_templates/map.html:9
+#: searx/templates/oscar/macros.html:20
+msgid "cached"
+msgstr "em cache"
+
+#: searx/templates/oscar/base.html:78
+msgid "Powered by"
+msgstr "Distribuído por"
+
+#: searx/templates/oscar/base.html:78
+msgid "a privacy-respecting, hackable metasearch engine"
+msgstr "um mecanismo de metabusca que respeita a sua privacidade"
+
+#: searx/templates/oscar/navbar.html:9 searx/templates/oscar/navbar.html:33
+msgid "home"
+msgstr "Início"
+
+#: searx/templates/oscar/navbar.html:14 searx/templates/oscar/navbar.html:24
+msgid "Toggle navigation"
+msgstr "Alternar navegação"
+
+#: searx/templates/oscar/preferences.html:17
+#: searx/templates/oscar/preferences.html:25
+msgid "General"
+msgstr "Geral"
+
+#: searx/templates/oscar/preferences.html:18
+#: searx/templates/oscar/preferences.html:126
+msgid "Engines"
+msgstr "Buscadores"
+
+#: searx/templates/oscar/preferences.html:19
+#: searx/templates/oscar/preferences.html:187
+msgid "Plugins"
+msgstr "Complementos"
+
+#: searx/templates/oscar/preferences.html:20
+#: searx/templates/oscar/preferences.html:210
+msgid "Cookies"
+msgstr "Cookies"
+
+#: searx/templates/oscar/preferences.html:45
+msgid "What language do you prefer for search?"
+msgstr "Qual idioma padrão para pesquisar?"
+
+#: searx/templates/oscar/preferences.html:56
+msgid "Change the language of the layout"
+msgstr "Alterar o idioma da interface"
+
+#: searx/templates/oscar/preferences.html:66
+msgid "Find stuff as you type"
+msgstr "Exibir sugestões enquanto você digita"
+
+#: searx/templates/oscar/preferences.html:77
+msgid "Proxying image results through searx"
+msgstr "Usar proxy para resultado de imagens exibidas através do searx"
+
+#: searx/templates/oscar/preferences.html:86
+msgid ""
+"Change how forms are submited, <a "
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
+" rel=\"external\">learn more about request methods</a>"
+msgstr "Alterar o modo como os formulários são submetidos<a href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">ganhar desempenho sobre métodos de solicitação</a>"
+
+#: searx/templates/oscar/preferences.html:95
+msgid "Filter content"
+msgstr "Filtrar conteúdo"
+
+#: searx/templates/oscar/preferences.html:105
+msgid "Change searx layout"
+msgstr "Alterar interface do searx"
+
+#: searx/templates/oscar/preferences.html:143
+#: searx/templates/oscar/preferences.html:151
+msgid "Shortcut"
+msgstr "Atalhos"
+
+#: searx/templates/oscar/preferences.html:145
+#: searx/templates/oscar/preferences.html:149
+msgid "Avg. time"
+msgstr "Avg.tempo"
+
+#: searx/templates/oscar/preferences.html:146
+#: searx/templates/oscar/preferences.html:148
+msgid "Max time"
+msgstr "Tempo máximo"
+
+#: searx/templates/oscar/preferences.html:213
+msgid ""
+"This is the list of cookies and their values searx is storing on your "
+"computer."
+msgstr "Esta é a lista de cookies que searx está armazenando em seu computador."
+
+#: searx/templates/oscar/preferences.html:214
+msgid "With that list, you can assess searx transparency."
+msgstr "Com essa lista, você pode avaliar a transparência do searx."
+
+#: searx/templates/oscar/preferences.html:219
+msgid "Cookie name"
+msgstr "Nome do cookie"
+
+#: searx/templates/oscar/preferences.html:220
+msgid "Value"
+msgstr "Valor"
+
+#: searx/templates/oscar/results.html:7
+msgid "Search results"
+msgstr "Procurar resultados"
+
+#: searx/templates/oscar/results.html:105
+msgid "Links"
+msgstr "Links"
+
+#: searx/templates/oscar/search.html:6
+#: searx/templates/oscar/search_full.html:11
+msgid "Start search"
+msgstr "Iniciar busca"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Show search filters"
+msgstr "Mostrar filtros de busca"
+
+#: searx/templates/oscar/search_full.html:15
+msgid "Hide search filters"
+msgstr "Ocultar filtros de busca"
+
+#: searx/templates/oscar/stats.html:2
+msgid "stats"
+msgstr "estatísticas"
+
+#: searx/templates/oscar/messages/first_time.html:4
+#: searx/templates/oscar/messages/no_results.html:5
+#: searx/templates/oscar/messages/save_settings_successfull.html:5
+#: searx/templates/oscar/messages/unknow_error.html:5
+msgid "Close"
+msgstr "Fechar"
+
+#: searx/templates/oscar/messages/first_time.html:6
+#: searx/templates/oscar/messages/no_data_available.html:3
+msgid "Heads up!"
+msgstr "Atenção!"
+
+#: searx/templates/oscar/messages/first_time.html:7
+msgid "It look like you are using searx first time."
+msgstr "Parece que você está usando searx primeira vez."
+
+#: searx/templates/oscar/messages/js_disabled.html:2
+msgid "Warning!"
+msgstr "Aviso!"
+
+#: searx/templates/oscar/messages/js_disabled.html:3
+msgid "Please enable JavaScript to use full functionality of this site."
+msgstr "Você deve ativar o JavaScript para usar todas as funcionalidades deste site."
+
+#: searx/templates/oscar/messages/no_cookies.html:3
+msgid "Information!"
+msgstr "Informação"
+
+#: searx/templates/oscar/messages/no_cookies.html:4
+msgid "currently, there are no cookies defined."
+msgstr "Atualmente, não há cookies definidos"
+
+#: searx/templates/oscar/messages/no_data_available.html:4
+msgid "There is currently no data available. "
+msgstr "Atualmente, não há dados disponíveis."
+
+#: searx/templates/oscar/messages/no_results.html:7
+msgid "Sorry!"
+msgstr "Desculpe!"
+
+#: searx/templates/oscar/messages/no_results.html:8
+msgid ""
+"we didn't find any results. Please use another query or search in more "
+"categories."
+msgstr "Não encontramos nenhum resultado. Utilize outra consulta ou pesquisa em mais categorias."
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:7
+msgid "Well done!"
+msgstr "Muito bem!"
+
+#: searx/templates/oscar/messages/save_settings_successfull.html:8
+msgid "Settings saved successfully."
+msgstr "Configurações salvas com sucesso"
+
+#: searx/templates/oscar/messages/unknow_error.html:7
+msgid "Oh snap!"
+msgstr "Oh não!"
+
+#: searx/templates/oscar/messages/unknow_error.html:8
+msgid "Something went wrong."
+msgstr "Algo deu errado."
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "show media"
+msgstr "exibir mídia"
+
+#: searx/templates/oscar/result_templates/default.html:7
+msgid "hide media"
+msgstr "ocultar mídia"
+
+#: searx/templates/oscar/result_templates/images.html:23
+msgid "Get image"
+msgstr "Obter imagem"
+
+#: searx/templates/oscar/result_templates/images.html:24
+msgid "View source"
+msgstr "Ver código-fonte"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "show map"
+msgstr "exibir mapas"
+
+#: searx/templates/oscar/result_templates/map.html:7
+msgid "hide map"
+msgstr "ocultar mapas"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "show details"
+msgstr "Exibir detalhes"
+
+#: searx/templates/oscar/result_templates/map.html:11
+msgid "hide details"
+msgstr "ocultar detalhes"
+
+#: searx/templates/oscar/result_templates/torrent.html:7
+msgid "Filesize"
+msgstr "Tamanho do arquivo"
+
+#: searx/templates/oscar/result_templates/torrent.html:9
+msgid "Bytes"
+msgstr "Bytes"
+
+#: searx/templates/oscar/result_templates/torrent.html:10
+msgid "kiB"
+msgstr "kiB"
+
+#: searx/templates/oscar/result_templates/torrent.html:11
+msgid "MiB"
+msgstr "MiB"
+
+#: searx/templates/oscar/result_templates/torrent.html:12
+msgid "GiB"
+msgstr "GiB"
+
+#: searx/templates/oscar/result_templates/torrent.html:13
+msgid "TiB"
+msgstr "TiB"
+
+#: searx/templates/oscar/result_templates/torrent.html:15
+msgid "Number of Files"
+msgstr "Número de Arquivos"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "show video"
+msgstr "exibir vídeo"
+
+#: searx/templates/oscar/result_templates/videos.html:7
+msgid "hide video"
+msgstr "ocultar vídeo"
+
+#: searx/templates/pix-art/results.html:28
+msgid "Load more..."
+msgstr "Mostrar mais ..."
diff --git a/searx/translations/ro/LC_MESSAGES/messages.mo b/searx/translations/ro/LC_MESSAGES/messages.mo
index 13731ff92..25cbf25a8 100644
--- a/searx/translations/ro/LC_MESSAGES/messages.mo
+++ b/searx/translations/ro/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/ro/LC_MESSAGES/messages.po b/searx/translations/ro/LC_MESSAGES/messages.po
index 58041d5bd..9abe0fb9f 100644
--- a/searx/translations/ro/LC_MESSAGES/messages.po
+++ b/searx/translations/ro/LC_MESSAGES/messages.po
@@ -1,5 +1,5 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
@@ -8,14 +8,14 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 09:45+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
"Language-Team: Romanian (http://www.transifex.com/asciimoo/searx/language/ro/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: ro\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
@@ -55,11 +55,15 @@ msgstr "știri"
msgid "map"
msgstr "hartă"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes} minut(e) în urmă"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} oră(e), {minutes} minut(e) în urmă"
@@ -278,7 +282,7 @@ msgstr "Categorie"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -290,7 +294,7 @@ msgstr "Permite"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/ru/LC_MESSAGES/messages.mo b/searx/translations/ru/LC_MESSAGES/messages.mo
index ebaa142ac..b3777d074 100644
--- a/searx/translations/ru/LC_MESSAGES/messages.mo
+++ b/searx/translations/ru/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/ru/LC_MESSAGES/messages.po b/searx/translations/ru/LC_MESSAGES/messages.po
index f9f36674b..2319625d5 100644
--- a/searx/translations/ru/LC_MESSAGES/messages.po
+++ b/searx/translations/ru/LC_MESSAGES/messages.po
@@ -1,5 +1,5 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
@@ -9,14 +9,14 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 09:45+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
"Language-Team: Russian (http://www.transifex.com/asciimoo/searx/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
@@ -56,11 +56,15 @@ msgstr "новости"
msgid "map"
msgstr "карты"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes} минут назад"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} час, {minutes} минут назад"
@@ -279,7 +283,7 @@ msgstr "Категория"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -291,7 +295,7 @@ msgstr "Разрешить"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/tr/LC_MESSAGES/messages.mo b/searx/translations/tr/LC_MESSAGES/messages.mo
index deacd6c8d..7b785fa9a 100644
--- a/searx/translations/tr/LC_MESSAGES/messages.mo
+++ b/searx/translations/tr/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/tr/LC_MESSAGES/messages.po b/searx/translations/tr/LC_MESSAGES/messages.po
index 62678c095..eb9fe8fa4 100644
--- a/searx/translations/tr/LC_MESSAGES/messages.po
+++ b/searx/translations/tr/LC_MESSAGES/messages.po
@@ -1,5 +1,5 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
@@ -9,14 +9,14 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-24 09:45+0000\n"
-"Last-Translator: pointhi\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 15:06+0000\n"
+"Last-Translator: Thomas Pointhuber\n"
"Language-Team: Turkish (http://www.transifex.com/asciimoo/searx/language/tr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: tr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
@@ -56,11 +56,15 @@ msgstr "haberler"
msgid "map"
msgstr "harita"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr ""
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes} dakika() önce"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} saat(), {minutes} dakika() önce"
@@ -279,7 +283,7 @@ msgstr "Türü"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -291,7 +295,7 @@ msgstr "İzin ver"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
diff --git a/searx/translations/zh_CN/LC_MESSAGES/messages.mo b/searx/translations/zh_CN/LC_MESSAGES/messages.mo
index 64101a5a6..0cd5edd96 100644
--- a/searx/translations/zh_CN/LC_MESSAGES/messages.mo
+++ b/searx/translations/zh_CN/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/searx/translations/zh_CN/LC_MESSAGES/messages.po b/searx/translations/zh_CN/LC_MESSAGES/messages.po
index 666b781da..c7903563c 100644
--- a/searx/translations/zh_CN/LC_MESSAGES/messages.po
+++ b/searx/translations/zh_CN/LC_MESSAGES/messages.po
@@ -1,21 +1,22 @@
# Translations template for PROJECT.
-# Copyright (C) 2015 ORGANIZATION
+# Copyright (C) 2016 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
#
# Translators:
-# 文科, 2015
+# wenke, 2015
+# wenke, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2015-08-24 11:44+0200\n"
-"PO-Revision-Date: 2015-08-29 07:35+0000\n"
-"Last-Translator: 文科\n"
+"POT-Creation-Date: 2016-01-21 16:05+0100\n"
+"PO-Revision-Date: 2016-01-21 16:25+0000\n"
+"Last-Translator: wenke\n"
"Language-Team: Chinese (China) (http://www.transifex.com/asciimoo/searx/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 1.3\n"
+"Generated-By: Babel 2.2.0\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
@@ -55,11 +56,15 @@ msgstr "新闻"
msgid "map"
msgstr "地图"
-#: searx/webapp.py:414
+#: searx/webapp.py:123
+msgid "science"
+msgstr "学术"
+
+#: searx/webapp.py:415
msgid "{minutes} minute(s) ago"
msgstr "{minutes}分钟之前"
-#: searx/webapp.py:416
+#: searx/webapp.py:417
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours}小时{minutes}分钟之前"
@@ -167,7 +172,7 @@ msgstr "界面语言"
#: searx/templates/default/preferences.html:35
#: searx/templates/oscar/preferences.html:65
msgid "Autocomplete"
-msgstr "自动完成"
+msgstr "自动补全"
#: searx/templates/courgette/preferences.html:45
#: searx/templates/default/preferences.html:46
@@ -267,7 +272,7 @@ msgstr "目前使用的搜索引擎"
#: searx/templates/oscar/preferences.html:152
#: searx/templates/pix-art/preferences.html:53
msgid "Engine name"
-msgstr "搜索引擎名字"
+msgstr "搜索引擎名称"
#: searx/templates/courgette/preferences.html:101
#: searx/templates/default/preferences.html:89
@@ -278,7 +283,7 @@ msgstr "类别"
#: searx/templates/courgette/preferences.html:113
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:101
-#: searx/templates/oscar/macros.html:67
+#: searx/templates/oscar/macros.html:71
#: searx/templates/oscar/preferences.html:141
#: searx/templates/oscar/preferences.html:153
#: searx/templates/pix-art/preferences.html:54
@@ -290,11 +295,11 @@ msgstr "允许"
#: searx/templates/courgette/preferences.html:114
#: searx/templates/default/preferences.html:90
#: searx/templates/default/preferences.html:102
-#: searx/templates/oscar/macros.html:66
+#: searx/templates/oscar/macros.html:70
#: searx/templates/pix-art/preferences.html:54
#: searx/templates/pix-art/preferences.html:65
msgid "Block"
-msgstr "屏蔽"
+msgstr "阻止"
#: searx/templates/courgette/preferences.html:122
#: searx/templates/default/preferences.html:110
@@ -332,7 +337,7 @@ msgstr "恢复默认"
#: searx/templates/oscar/preferences.html:241
#: searx/templates/pix-art/preferences.html:79
msgid "back"
-msgstr "后"
+msgstr "返回"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:13
@@ -391,13 +396,13 @@ msgstr "原始上下文"
#: searx/templates/default/result_templates/torrent.html:11
#: searx/templates/oscar/result_templates/torrent.html:6
msgid "Seeder"
-msgstr ""
+msgstr "Seeder"
#: searx/templates/courgette/result_templates/torrent.html:7
#: searx/templates/default/result_templates/torrent.html:11
#: searx/templates/oscar/result_templates/torrent.html:6
msgid "Leecher"
-msgstr ""
+msgstr "Leecher"
#: searx/templates/courgette/result_templates/torrent.html:9
#: searx/templates/default/result_templates/torrent.html:9
@@ -468,7 +473,7 @@ msgstr "改变界面语言"
#: searx/templates/oscar/preferences.html:66
msgid "Find stuff as you type"
-msgstr "找到你的搜索的东西"
+msgstr "自动补全搜索字词"
#: searx/templates/oscar/preferences.html:77
msgid "Proxying image results through searx"
@@ -479,7 +484,7 @@ msgid ""
"Change how forms are submited, <a "
"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
" rel=\"external\">learn more about request methods</a>"
-msgstr "更改请求方法,<a href=\"http://zh.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">关于请求方法了解更多</a>"
+msgstr "更改请求方法,<a href=\"http://zh.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">了解更多请求方法相关</a>"
#: searx/templates/oscar/preferences.html:95
msgid "Filter content"
diff --git a/searx/webapp.py b/searx/webapp.py
index 794b7ea8c..665eeef24 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -119,7 +119,8 @@ _category_names = (gettext('files'),
gettext('videos'),
gettext('it'),
gettext('news'),
- gettext('map'))
+ gettext('map'),
+ gettext('science'))
outgoing_proxies = settings['outgoing'].get('proxies', None)
@@ -327,6 +328,8 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['cookies'] = request.cookies
+ kwargs['instance_name'] = settings['general']['instance_name']
+
kwargs['scripts'] = set()
for plugin in request.user_plugins:
for script in plugin.js_dependencies:
@@ -746,7 +749,8 @@ def opensearch():
ret = render('opensearch.xml',
opensearch_method=method,
- host=get_base_url())
+ host=get_base_url(),
+ urljoin=urljoin)
resp = Response(response=ret,
status=200,