summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--searx/__init__.py12
-rw-r--r--searx/autocomplete.py79
-rw-r--r--searx/engines/__init__.py11
-rw-r--r--searx/engines/dailymotion.py15
-rw-r--r--searx/engines/deezer.py61
-rw-r--r--searx/engines/digg.py3
-rw-r--r--searx/engines/flickr-noapi.py2
-rw-r--r--searx/engines/kickass.py31
-rw-r--r--searx/engines/soundcloud.py14
-rw-r--r--searx/engines/startpage.py5
-rw-r--r--searx/engines/vimeo.py26
-rw-r--r--searx/engines/wikidata.py22
-rw-r--r--searx/engines/youtube.py13
-rw-r--r--searx/https_rewrite.py7
-rw-r--r--searx/query.py2
-rw-r--r--searx/search.py10
-rw-r--r--searx/settings.yml4
-rw-r--r--searx/static/themes/oscar/js/searx.min.js4
-rw-r--r--searx/static/themes/oscar/js/searx_src/element_modifiers.js12
-rw-r--r--searx/templates/default/result_templates/map.html2
-rw-r--r--searx/templates/default/result_templates/torrent.html2
-rw-r--r--searx/templates/oscar/base.html1
-rw-r--r--searx/templates/oscar/result_templates/default.html10
-rw-r--r--searx/templates/oscar/result_templates/torrent.html17
-rw-r--r--searx/templates/oscar/result_templates/videos.html10
-rw-r--r--searx/templates/oscar/results.html1
-rw-r--r--searx/translations/de/LC_MESSAGES/messages.mobin5402 -> 5554 bytes
-rw-r--r--searx/translations/de/LC_MESSAGES/messages.po34
-rw-r--r--searx/translations/en/LC_MESSAGES/messages.mobin5000 -> 5152 bytes
-rw-r--r--searx/translations/en/LC_MESSAGES/messages.po34
-rw-r--r--searx/translations/es/LC_MESSAGES/messages.mobin5207 -> 5283 bytes
-rw-r--r--searx/translations/es/LC_MESSAGES/messages.po40
-rw-r--r--searx/translations/fr/LC_MESSAGES/messages.mobin5496 -> 5675 bytes
-rw-r--r--searx/translations/fr/LC_MESSAGES/messages.po34
-rw-r--r--searx/translations/hu/LC_MESSAGES/messages.mobin5168 -> 5320 bytes
-rw-r--r--searx/translations/hu/LC_MESSAGES/messages.po34
-rw-r--r--searx/translations/it/LC_MESSAGES/messages.mobin5172 -> 5253 bytes
-rw-r--r--searx/translations/it/LC_MESSAGES/messages.po40
-rw-r--r--searx/translations/ja/LC_MESSAGES/messages.mobin5115 -> 5180 bytes
-rw-r--r--searx/translations/ja/LC_MESSAGES/messages.po40
-rw-r--r--searx/translations/nl/LC_MESSAGES/messages.mobin5198 -> 5350 bytes
-rw-r--r--searx/translations/nl/LC_MESSAGES/messages.po34
-rw-r--r--searx/translations/tr/LC_MESSAGES/messages.mobin5415 -> 5567 bytes
-rw-r--r--searx/translations/tr/LC_MESSAGES/messages.po79
-rw-r--r--searx/utils.py33
-rw-r--r--searx/webapp.py18
-rwxr-xr-xutils/update-translations.sh2
47 files changed, 615 insertions, 183 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index 46685817a..110f46af8 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -15,9 +15,9 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
+import logging
from os import environ
from os.path import realpath, dirname, join, abspath
-from searx.https_rewrite import load_https_rules
try:
from yaml import load
except:
@@ -45,7 +45,17 @@ else:
with open(settings_path) as settings_yaml:
settings = load(settings_yaml)
+if settings.get('server', {}).get('debug'):
+ logging.basicConfig(level=logging.DEBUG)
+else:
+ logging.basicConfig(level=logging.WARNING)
+
+logger = logging.getLogger('searx')
+
# load https rules only if https rewrite is enabled
if settings.get('server', {}).get('https_rewrite'):
# loade https rules
+ from searx.https_rewrite import load_https_rules
load_https_rules(https_rewrite_path)
+
+logger.info('Initialisation done')
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index 545bd69e7..7ebebf1de 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -20,6 +20,85 @@ from lxml import etree
from requests import get
from json import loads
from urllib import urlencode
+from searx.languages import language_codes
+from searx.engines import (
+ categories, engines, engine_shortcuts
+)
+
+
+def searx_bang(full_query):
+ '''check if the searchQuery contain a bang, and create fitting autocompleter results'''
+ # check if there is a query which can be parsed
+ if len(full_query.getSearchQuery()) == 0:
+ return []
+
+ results = []
+
+ # check if current query stats with !bang
+ if full_query.getSearchQuery()[0] == '!':
+ if len(full_query.getSearchQuery()) == 1:
+ # show some example queries
+ # TODO, check if engine is not avaliable
+ results.append("!images")
+ results.append("!wikipedia")
+ results.append("!osm")
+ else:
+ engine_query = full_query.getSearchQuery()[1:]
+
+ # check if query starts with categorie name
+ for categorie in categories:
+ if categorie.startswith(engine_query):
+ results.append('!{categorie}'.format(categorie=categorie))
+
+ # check if query starts with engine name
+ for engine in engines:
+ if engine.startswith(engine_query.replace('_', ' ')):
+ results.append('!{engine}'.format(engine=engine.replace(' ', '_')))
+
+ # check if query starts with engine shortcut
+ for engine_shortcut in engine_shortcuts:
+ if engine_shortcut.startswith(engine_query):
+ results.append('!{engine_shortcut}'.format(engine_shortcut=engine_shortcut))
+
+ # check if current query stats with :bang
+ elif full_query.getSearchQuery()[0] == ':':
+ if len(full_query.getSearchQuery()) == 1:
+ # show some example queries
+ results.append(":en")
+ results.append(":en_us")
+ results.append(":english")
+ results.append(":united_kingdom")
+ else:
+ engine_query = full_query.getSearchQuery()[1:]
+
+ for lc in language_codes:
+ lang_id, lang_name, country = map(str.lower, lc)
+
+ # check if query starts with language-id
+ if lang_id.startswith(engine_query):
+ if len(engine_query) <= 2:
+ results.append(':{lang_id}'.format(lang_id=lang_id.split('_')[0]))
+ else:
+ results.append(':{lang_id}'.format(lang_id=lang_id))
+
+ # check if query starts with language name
+ if lang_name.startswith(engine_query):
+ results.append(':{lang_name}'.format(lang_name=lang_name))
+
+ # check if query starts with country
+ if country.startswith(engine_query.replace('_', ' ')):
+ results.append(':{country}'.format(country=country.replace(' ', '_')))
+
+ # remove duplicates
+ result_set = set(results)
+
+ # remove results which are already contained in the query
+ for query_part in full_query.query_parts:
+ if query_part in result_set:
+ result_set.remove(query_part)
+
+ # convert result_set back to list
+ return list(result_set)
def dbpedia(query):
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 9bc5cdfd4..643b107a5 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -22,6 +22,10 @@ from imp import load_source
from flask.ext.babel import gettext
from operator import itemgetter
from searx import settings
+from searx import logger
+
+
+logger = logger.getChild('engines')
engine_dir = dirname(realpath(__file__))
@@ -81,7 +85,7 @@ def load_engine(engine_data):
if engine_attr.startswith('_'):
continue
if getattr(engine, engine_attr) is None:
- print('[E] Engine config error: Missing attribute "{0}.{1}"'
+ logger.error('Missing engine config attribute: "{0}.{1}"'
.format(engine.name, engine_attr))
sys.exit(1)
@@ -100,9 +104,8 @@ def load_engine(engine_data):
categories['general'].append(engine)
if engine.shortcut:
- # TODO check duplications
if engine.shortcut in engine_shortcuts:
- print('[E] Engine config error: ambigious shortcut: {0}'
+ logger.error('Engine config error: ambigious shortcut: {0}'
.format(engine.shortcut))
sys.exit(1)
engine_shortcuts[engine.shortcut] = engine.name
@@ -199,7 +202,7 @@ def get_engines_stats():
if 'engines' not in settings or not settings['engines']:
- print '[E] Error no engines found. Edit your settings.yml'
+ logger.error('No engines found. Edit your settings.yml')
exit(2)
for engine_data in settings['engines']:
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py
index a5bffa866..03b1dbb8b 100644
--- a/searx/engines/dailymotion.py
+++ b/searx/engines/dailymotion.py
@@ -6,12 +6,14 @@
# @using-api yes
# @results JSON
# @stable yes
-# @parse url, title, thumbnail
+# @parse url, title, thumbnail, publishedDate, embedded
#
# @todo set content-parameter with correct data
from urllib import urlencode
from json import loads
+from cgi import escape
+from datetime import datetime
# engine dependent config
categories = ['videos']
@@ -20,7 +22,9 @@ language_support = True
# search-url
# see http://www.dailymotion.com/doc/api/obj-video.html
-search_url = 'https://api.dailymotion.com/videos?fields=title,description,duration,url,thumbnail_360_url&sort=relevance&limit=5&page={pageno}&{query}' # noqa
+search_url = 'https://api.dailymotion.com/videos?fields=created_time,title,description,duration,url,thumbnail_360_url,id&sort=relevance&limit=5&page={pageno}&{query}' # noqa
+embedded_url = '<iframe frameborder="0" width="540" height="304" ' +\
+ 'data-src="//www.dailymotion.com/embed/video/{videoid}" allowfullscreen></iframe>'
# do search-request
@@ -51,14 +55,17 @@ def response(resp):
for res in search_res['list']:
title = res['title']
url = res['url']
- #content = res['description']
- content = ''
+ content = escape(res['description'])
thumbnail = res['thumbnail_360_url']
+ publishedDate = datetime.fromtimestamp(res['created_time'], None)
+ embedded = embedded_url.format(videoid=res['id'])
results.append({'template': 'videos.html',
'url': url,
'title': title,
'content': content,
+ 'publishedDate': publishedDate,
+ 'embedded': embedded,
'thumbnail': thumbnail})
# return results
diff --git a/searx/engines/deezer.py b/searx/engines/deezer.py
new file mode 100644
index 000000000..433ceffa1
--- /dev/null
+++ b/searx/engines/deezer.py
@@ -0,0 +1,61 @@
+## Deezer (Music)
+#
+# @website https://deezer.com
+# @provide-api yes (http://developers.deezer.com/api/)
+#
+# @using-api yes
+# @results JSON
+# @stable yes
+# @parse url, title, content, embedded
+
+from json import loads
+from urllib import urlencode
+
+# engine dependent config
+categories = ['music']
+paging = True
+
+# search-url
+url = 'http://api.deezer.com/'
+search_url = url + 'search?{query}&index={offset}'
+
+embedded_url = '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' +\
+ 'data-src="http://www.deezer.com/plugins/player?type=tracks&id={audioid}" ' +\
+ 'width="540" height="80"></iframe>'
+
+
+# do search-request
+def request(query, params):
+ offset = (params['pageno'] - 1) * 25
+
+ params['url'] = search_url.format(query=urlencode({'q': query}),
+ offset=offset)
+
+ return params
+
+
+# get response from search-request
+def response(resp):
+ results = []
+
+ search_res = loads(resp.text)
+
+ # parse results
+ for result in search_res.get('data', []):
+ if result['type'] == 'track':
+ title = result['title']
+ url = result['link']
+ content = result['artist']['name'] +\
+ " &bull; " +\
+ result['album']['title'] +\
+ " &bull; " + result['title']
+ embedded = embedded_url.format(audioid=result['id'])
+
+ # append result
+ results.append({'url': url,
+ 'title': title,
+ 'embedded': embedded,
+ 'content': content})
+
+ # return results
+ return results
diff --git a/searx/engines/digg.py b/searx/engines/digg.py
index 241234fdb..8c457d6b9 100644
--- a/searx/engines/digg.py
+++ b/searx/engines/digg.py
@@ -44,6 +44,9 @@ def response(resp):
search_result = loads(resp.text)
+ if search_result['html'] == '':
+ return results
+
dom = html.fromstring(search_result['html'])
# parse results
diff --git a/searx/engines/flickr-noapi.py b/searx/engines/flickr-noapi.py
index aa2fa5d3b..89dd2ee5f 100644
--- a/searx/engines/flickr-noapi.py
+++ b/searx/engines/flickr-noapi.py
@@ -73,7 +73,7 @@ def response(resp):
url = build_flickr_url(photo['owner']['id'], photo['id'])
- title = photo['title']
+ title = photo.get('title', '')
content = '<span class="photo-author">' +\
photo['owner']['username'] +\
diff --git a/searx/engines/kickass.py b/searx/engines/kickass.py
index 16e9d6de6..a4d270673 100644
--- a/searx/engines/kickass.py
+++ b/searx/engines/kickass.py
@@ -24,6 +24,7 @@ search_url = url + 'search/{search_term}/{pageno}/'
# specific xpath variables
magnet_xpath = './/a[@title="Torrent magnet link"]'
+torrent_xpath = './/a[@title="Download torrent file"]'
content_xpath = './/span[@class="font11px lightgrey block"]'
@@ -60,6 +61,9 @@ def response(resp):
method="text"))
seed = result.xpath('.//td[contains(@class, "green")]/text()')[0]
leech = result.xpath('.//td[contains(@class, "red")]/text()')[0]
+ filesize = result.xpath('.//td[contains(@class, "nobr")]/text()')[0]
+ filesize_multiplier = result.xpath('.//td[contains(@class, "nobr")]//span/text()')[0]
+ files = result.xpath('.//td[contains(@class, "center")][2]/text()')[0]
# convert seed to int if possible
if seed.isdigit():
@@ -73,15 +77,42 @@ def response(resp):
else:
leech = 0
+ # convert filesize to byte if possible
+ try:
+ filesize = float(filesize)
+
+ # convert filesize to byte
+ if filesize_multiplier == 'TB':
+ filesize = int(filesize * 1024 * 1024 * 1024 * 1024)
+ elif filesize_multiplier == 'GB':
+ filesize = int(filesize * 1024 * 1024 * 1024)
+ elif filesize_multiplier == 'MB':
+ filesize = int(filesize * 1024 * 1024)
+ elif filesize_multiplier == 'kb':
+ filesize = int(filesize * 1024)
+ except:
+ filesize = None
+
+ # convert files to int if possible
+ if files.isdigit():
+ files = int(files)
+ else:
+ files = None
+
magnetlink = result.xpath(magnet_xpath)[0].attrib['href']
+ torrentfile = result.xpath(torrent_xpath)[0].attrib['href']
+
# append result
results.append({'url': href,
'title': title,
'content': content,
'seed': seed,
'leech': leech,
+ 'filesize': filesize,
+ 'files': files,
'magnetlink': magnetlink,
+ 'torrentfile': torrentfile,
'template': 'torrent.html'})
# return results sorted by seeder
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index 164a569a3..44374af6f 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -6,10 +6,11 @@
# @using-api yes
# @results JSON
# @stable yes
-# @parse url, title, content
+# @parse url, title, content, publishedDate, embedded
from json import loads
-from urllib import urlencode
+from urllib import urlencode, quote_plus
+from dateutil import parser
# engine dependent config
categories = ['music']
@@ -27,6 +28,10 @@ search_url = url + 'search?{query}'\
'&linked_partitioning=1'\
'&client_id={client_id}' # noqa
+embedded_url = '<iframe width="100%" height="166" ' +\
+ 'scrolling="no" frameborder="no" ' +\
+ 'data-src="https://w.soundcloud.com/player/?url={uri}"></iframe>'
+
# do search-request
def request(query, params):
@@ -50,10 +55,15 @@ def response(resp):
if result['kind'] in ('track', 'playlist'):
title = result['title']
content = result['description']
+ publishedDate = parser.parse(result['last_modified'])
+ uri = quote_plus(result['uri'])
+ embedded = embedded_url.format(uri=uri)
# append result
results.append({'url': result['permalink_url'],
'title': title,
+ 'publishedDate': publishedDate,
+ 'embedded': embedded,
'content': content})
# return results
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index 16da728cd..70b193952 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -66,7 +66,10 @@ def response(resp):
continue
link = links[0]
url = link.attrib.get('href')
- title = escape(link.text_content())
+ try:
+ title = escape(link.text_content())
+ except UnicodeDecodeError:
+ continue
# block google-ad url's
if re.match("^http(s|)://www.google.[a-z]+/aclk.*$", url):
diff --git a/searx/engines/vimeo.py b/searx/engines/vimeo.py
index c66c4148a..39033c591 100644
--- a/searx/engines/vimeo.py
+++ b/searx/engines/vimeo.py
@@ -1,4 +1,4 @@
-## Vimeo (Videos)
+# Vimeo (Videos)
#
# @website https://vimeo.com/
# @provide-api yes (http://developer.vimeo.com/api),
@@ -7,14 +7,14 @@
# @using-api no (TODO, rewrite to api)
# @results HTML (using search portal)
# @stable no (HTML can change)
-# @parse url, title, publishedDate, thumbnail
+# @parse url, title, publishedDate, thumbnail, embedded
#
# @todo rewrite to api
# @todo set content-parameter with correct data
from urllib import urlencode
-from HTMLParser import HTMLParser
from lxml import html
+from HTMLParser import HTMLParser
from searx.engines.xpath import extract_text
from dateutil import parser
@@ -23,26 +23,26 @@ categories = ['videos']
paging = True
# search-url
-base_url = 'https://vimeo.com'
+base_url = 'http://vimeo.com'
search_url = base_url + '/search/page:{pageno}?{query}'
# specific xpath variables
+results_xpath = '//div[@id="browse_content"]/ol/li'
url_xpath = './a/@href'
+title_xpath = './a/div[@class="data"]/p[@class="title"]'
content_xpath = './a/img/@src'
-title_xpath = './a/div[@class="data"]/p[@class="title"]/text()'
-results_xpath = '//div[@id="browse_content"]/ol/li'
publishedDate_xpath = './/p[@class="meta"]//attribute::datetime'
+embedded_url = '<iframe data-src="//player.vimeo.com/video{videoid}" ' +\
+ 'width="540" height="304" frameborder="0" ' +\
+ 'webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'
+
# do search-request
def request(query, params):
params['url'] = search_url.format(pageno=params['pageno'],
query=urlencode({'q': query}))
- # TODO required?
- params['cookies']['__utma'] =\
- '00000000.000#0000000.0000000000.0000000000.0000000000.0'
-
return params
@@ -51,16 +51,17 @@ def response(resp):
results = []
dom = html.fromstring(resp.text)
-
p = HTMLParser()
# parse results
for result in dom.xpath(results_xpath):
- url = base_url + result.xpath(url_xpath)[0]
+ videoid = result.xpath(url_xpath)[0]
+ url = base_url + videoid
title = p.unescape(extract_text(result.xpath(title_xpath)))
thumbnail = extract_text(result.xpath(content_xpath)[0])
publishedDate = parser.parse(extract_text(
result.xpath(publishedDate_xpath)[0]))
+ embedded = embedded_url.format(videoid=videoid)
# append result
results.append({'url': url,
@@ -68,6 +69,7 @@ def response(resp):
'content': '',
'template': 'videos.html',
'publishedDate': publishedDate,
+ 'embedded': embedded,
'thumbnail': thumbnail})
# return results
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index df976ae35..da3152ac8 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -1,8 +1,7 @@
import json
from requests import get
from urllib import urlencode
-import locale
-import dateutil.parser
+from searx.utils import format_date_by_locale
result_count = 1
wikidata_host = 'https://www.wikidata.org'
@@ -38,27 +37,18 @@ def response(resp):
if language == 'all':
language = 'en'
- try:
- locale.setlocale(locale.LC_ALL, str(resp.search_params['language']))
- except:
- try:
- locale.setlocale(locale.LC_ALL, 'en_US')
- except:
- pass
- pass
-
url = url_detail.format(query=urlencode({'ids': '|'.join(wikidata_ids),
'languages': language + '|en'}))
htmlresponse = get(url)
jsonresponse = json.loads(htmlresponse.content)
for wikidata_id in wikidata_ids:
- results = results + getDetail(jsonresponse, wikidata_id, language)
+ results = results + getDetail(jsonresponse, wikidata_id, language, resp.search_params['language'])
return results
-def getDetail(jsonresponse, wikidata_id, language):
+def getDetail(jsonresponse, wikidata_id, language, locale):
results = []
urls = []
attributes = []
@@ -176,12 +166,12 @@ def getDetail(jsonresponse, wikidata_id, language):
date_of_birth = get_time(claims, 'P569', None)
if date_of_birth is not None:
- date_of_birth = dateutil.parser.parse(date_of_birth[8:]).strftime(locale.nl_langinfo(locale.D_FMT))
+ date_of_birth = format_date_by_locale(date_of_birth[8:], locale)
attributes.append({'label': 'Date of birth', 'value': date_of_birth})
date_of_death = get_time(claims, 'P570', None)
if date_of_death is not None:
- date_of_death = dateutil.parser.parse(date_of_death[8:]).strftime(locale.nl_langinfo(locale.D_FMT))
+ date_of_death = format_date_by_locale(date_of_death[8:], locale)
attributes.append({'label': 'Date of death', 'value': date_of_death})
if len(attributes) == 0 and len(urls) == 2 and len(description) == 0:
@@ -235,7 +225,7 @@ def get_string(claims, propertyName, defaultValue=None):
if len(result) == 0:
return defaultValue
else:
- #TODO handle multiple urls
+ # TODO handle multiple urls
return result[0]
diff --git a/searx/engines/youtube.py b/searx/engines/youtube.py
index 973e799f8..59f07c574 100644
--- a/searx/engines/youtube.py
+++ b/searx/engines/youtube.py
@@ -6,7 +6,7 @@
# @using-api yes
# @results JSON
# @stable yes
-# @parse url, title, content, publishedDate, thumbnail
+# @parse url, title, content, publishedDate, thumbnail, embedded
from json import loads
from urllib import urlencode
@@ -19,7 +19,11 @@ language_support = True
# search-url
base_url = 'https://gdata.youtube.com/feeds/api/videos'
-search_url = base_url + '?alt=json&{query}&start-index={index}&max-results=5' # noqa
+search_url = base_url + '?alt=json&{query}&start-index={index}&max-results=5'
+
+embedded_url = '<iframe width="540" height="304" ' +\
+ 'data-src="//www.youtube-nocookie.com/embed/{videoid}" ' +\
+ 'frameborder="0" allowfullscreen></iframe>'
# do search-request
@@ -60,6 +64,8 @@ def response(resp):
if url.endswith('&'):
url = url[:-1]
+ videoid = url[32:]
+
title = result['title']['$t']
content = ''
thumbnail = ''
@@ -72,12 +78,15 @@ def response(resp):
content = result['content']['$t']
+ embedded = embedded_url.format(videoid=videoid)
+
# append result
results.append({'url': url,
'title': title,
'content': content,
'template': 'videos.html',
'publishedDate': publishedDate,
+ 'embedded': embedded,
'thumbnail': thumbnail})
# return results
diff --git a/searx/https_rewrite.py b/searx/https_rewrite.py
index d873b406d..71aec1c9b 100644
--- a/searx/https_rewrite.py
+++ b/searx/https_rewrite.py
@@ -20,8 +20,11 @@ from urlparse import urlparse
from lxml import etree
from os import listdir
from os.path import isfile, isdir, join
+from searx import logger
+logger = logger.getChild("https_rewrite")
+
# https://gitweb.torproject.org/\
# pde/https-everywhere.git/tree/4.0:/src/chrome/content/rules
@@ -131,7 +134,7 @@ def load_single_https_ruleset(filepath):
def load_https_rules(rules_path):
# check if directory exists
if not isdir(rules_path):
- print("[E] directory not found: '" + rules_path + "'")
+ logger.error("directory not found: '" + rules_path + "'")
return
# search all xml files which are stored in the https rule directory
@@ -151,7 +154,7 @@ def load_https_rules(rules_path):
# append ruleset
https_rules.append(ruleset)
- print(' * {n} https-rules loaded'.format(n=len(https_rules)))
+ logger.info('{n} rules loaded'.format(n=len(https_rules)))
def https_url_rewrite(result):
diff --git a/searx/query.py b/searx/query.py
index a10a886ff..e491284f0 100644
--- a/searx/query.py
+++ b/searx/query.py
@@ -78,7 +78,7 @@ class Query(object):
if lang == lang_id\
or lang_id.startswith(lang)\
or lang == lang_name\
- or lang == country:
+ or lang.replace('_', ' ') == country:
parse_next = True
self.languages.append(lang)
break
diff --git a/searx/search.py b/searx/search.py
index 1c8b22f93..427da3bab 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -29,21 +29,23 @@ from searx.engines import (
from searx.languages import language_codes
from searx.utils import gen_useragent
from searx.query import Query
+from searx import logger
+logger = logger.getChild('search')
+
number_of_searches = 0
def search_request_wrapper(fn, url, engine_name, **kwargs):
try:
return fn(url, **kwargs)
- except Exception, e:
+ except:
# increase errors stats
engines[engine_name].stats['errors'] += 1
# print engine name and specific error message
- print('[E] Error with engine "{0}":\n\t{1}'.format(
- engine_name, str(e)))
+ logger.exception('engine crash: {0}'.format(engine_name))
return
@@ -66,7 +68,7 @@ def threaded_requests(requests):
remaining_time = max(0.0, timeout_limit - (time() - search_start))
th.join(remaining_time)
if th.isAlive():
- print('engine timeout: {0}'.format(th._engine_name))
+ logger.warning('engine timeout: {0}'.format(th._engine_name))
# get default reqest parameter
diff --git a/searx/settings.yml b/searx/settings.yml
index e30c52256..70c56fccd 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -35,6 +35,10 @@ engines:
engine : currency_convert
categories : general
shortcut : cc
+
+ - name : deezer
+ engine : deezer
+ shortcut : dz
- name : deviantart
engine : deviantart
diff --git a/searx/static/themes/oscar/js/searx.min.js b/searx/static/themes/oscar/js/searx.min.js
index 34a44f51b..d0640f110 100644
--- a/searx/static/themes/oscar/js/searx.min.js
+++ b/searx/static/themes/oscar/js/searx.min.js
@@ -1,2 +1,2 @@
-/*! oscar/searx.min.js | 19-12-2014 | https://github.com/asciimoo/searx */
-requirejs.config({baseUrl:"./static/themes/oscar/js",paths:{app:"../app"}}),searx.autocompleter&&(searx.searchResults=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:"/autocompleter?q=%QUERY"}),searx.searchResults.initialize()),$(document).ready(function(){searx.autocompleter&&$("#q").typeahead(null,{name:"search-results",displayKey:function(a){return a},source:searx.searchResults.ttAdapter()})}),$(document).ready(function(){$("#q.autofocus").focus(),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var a=$(this).data("btn-text-collapsed"),b=$(this).data("btn-text-not-collapsed");""!==a&&""!==b&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(a,b):$(this).html().replace(b,a),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var a="btn-"+$(this).data("btn-class"),b=$(this).data("btn-label-default"),c=$(this).data("btn-label-toggled");""!==c&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(b,c):$(this).html().replace(c,b),$(this).html(new_html)),$(this).toggleClass(a),$(this).toggleClass("btn-default")}),$(".btn-sm").dblclick(function(){var a="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(a),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(a),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))})}),$(document).ready(function(){$(".searx_overpass_request").on("click",function(a){var b="https://overpass-api.de/api/interpreter?data=",c=b+"[out:json][timeout:25];(",d=");out meta;",e=$(this).data("osm-id"),f=$(this).data("osm-type"),g=$(this).data("result-table"),h="#"+$(this).data("result-table-loadicon"),i=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(e&&f&&g){g="#"+g;var j=null;switch(f){case"node":j=c+"node("+e+");"+d;break;case"way":j=c+"way("+e+");"+d;break;case"relation":j=c+"relation("+e+");"+d}if(j){$.ajax(j).done(function(a){if(a&&a.elements&&a.elements[0]){var b=a.elements[0],c=$(g).html();for(var d in b.tags)if(null===b.tags.name||-1==i.indexOf(d)){switch(c+="<tr><td>"+d+"</td><td>",d){case"phone":case"fax":c+='<a href="tel:'+b.tags[d].replace(/ /g,"")+'">'+b.tags[d]+"</a>";break;case"email":c+='<a href="mailto:'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"website":case"url":c+='<a href="'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikidata":c+='<a href="https://www.wikidata.org/wiki/'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikipedia":if(-1!=b.tags[d].indexOf(":")){c+='<a href="https://'+b.tags[d].substring(0,b.tags[d].indexOf(":"))+".wikipedia.org/wiki/"+b.tags[d].substring(b.tags[d].indexOf(":")+1)+'">'+b.tags[d]+"</a>";break}default:c+=b.tags[d]}c+="</td></tr>"}$(g).html(c),$(g).removeClass("hidden"),$(h).addClass("hidden")}}).fail(function(){$(h).html($(h).html()+'<p class="text-muted">could not load data!</p>')})}}$(this).off(a)}),$(".searx_init_map").on("click",function(a){var b=$(this).data("leaflet-target"),c=$(this).data("map-lon"),d=$(this).data("map-lat"),e=$(this).data("map-zoom"),f=$(this).data("map-boundingbox"),g=$(this).data("map-geojson");require(["leaflet-0.7.3.min"],function(){f&&(southWest=L.latLng(f[0],f[2]),northEast=L.latLng(f[1],f[3]),map_bounds=L.latLngBounds(southWest,northEast)),L.Icon.Default.imagePath="./static/oscar/img/map";{var a=L.map(b),h="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",i='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',j=new L.TileLayer(h,{minZoom:1,maxZoom:19,attribution:i}),k="http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg",l='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',m=new L.TileLayer(k,{minZoom:1,maxZoom:18,subdomains:"1234",attribution:l}),n="http://otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",o='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png"> | Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency';new L.TileLayer(n,{minZoom:1,maxZoom:11,subdomains:"1234",attribution:o})}map_bounds?setTimeout(function(){a.fitBounds(map_bounds,{maxZoom:17})},0):c&&d&&(e?a.setView(new L.LatLng(d,c),e):a.setView(new L.LatLng(d,c),8)),a.addLayer(m);var p={"OSM Mapnik":j,MapQuest:m};L.control.layers(p).addTo(a),g&&L.geoJson(g).addTo(a)}),$(this).off(a)})});
+/*! oscar/searx.min.js | 05-01-2015 | https://github.com/asciimoo/searx */
+requirejs.config({baseUrl:"./static/themes/oscar/js",paths:{app:"../app"}}),searx.autocompleter&&(searx.searchResults=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:"/autocompleter?q=%QUERY"}),searx.searchResults.initialize()),$(document).ready(function(){searx.autocompleter&&$("#q").typeahead(null,{name:"search-results",displayKey:function(a){return a},source:searx.searchResults.ttAdapter()})}),$(document).ready(function(){$("#q.autofocus").focus(),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var a=$(this).data("btn-text-collapsed"),b=$(this).data("btn-text-not-collapsed");""!==a&&""!==b&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(a,b):$(this).html().replace(b,a),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var a="btn-"+$(this).data("btn-class"),b=$(this).data("btn-label-default"),c=$(this).data("btn-label-toggled");""!==c&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(b,c):$(this).html().replace(c,b),$(this).html(new_html)),$(this).toggleClass(a),$(this).toggleClass("btn-default")}),$(".media-loader").click(function(){var a=$(this).data("target"),b=$(a+" > iframe"),c=b.attr("src");(void 0===c||c===!1)&&b.attr("src",b.data("src"))}),$(".btn-sm").dblclick(function(){var a="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(a),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(a),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))})}),$(document).ready(function(){$(".searx_overpass_request").on("click",function(a){var b="https://overpass-api.de/api/interpreter?data=",c=b+"[out:json][timeout:25];(",d=");out meta;",e=$(this).data("osm-id"),f=$(this).data("osm-type"),g=$(this).data("result-table"),h="#"+$(this).data("result-table-loadicon"),i=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(e&&f&&g){g="#"+g;var j=null;switch(f){case"node":j=c+"node("+e+");"+d;break;case"way":j=c+"way("+e+");"+d;break;case"relation":j=c+"relation("+e+");"+d}if(j){$.ajax(j).done(function(a){if(a&&a.elements&&a.elements[0]){var b=a.elements[0],c=$(g).html();for(var d in b.tags)if(null===b.tags.name||-1==i.indexOf(d)){switch(c+="<tr><td>"+d+"</td><td>",d){case"phone":case"fax":c+='<a href="tel:'+b.tags[d].replace(/ /g,"")+'">'+b.tags[d]+"</a>";break;case"email":c+='<a href="mailto:'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"website":case"url":c+='<a href="'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikidata":c+='<a href="https://www.wikidata.org/wiki/'+b.tags[d]+'">'+b.tags[d]+"</a>";break;case"wikipedia":if(-1!=b.tags[d].indexOf(":")){c+='<a href="https://'+b.tags[d].substring(0,b.tags[d].indexOf(":"))+".wikipedia.org/wiki/"+b.tags[d].substring(b.tags[d].indexOf(":")+1)+'">'+b.tags[d]+"</a>";break}default:c+=b.tags[d]}c+="</td></tr>"}$(g).html(c),$(g).removeClass("hidden"),$(h).addClass("hidden")}}).fail(function(){$(h).html($(h).html()+'<p class="text-muted">could not load data!</p>')})}}$(this).off(a)}),$(".searx_init_map").on("click",function(a){var b=$(this).data("leaflet-target"),c=$(this).data("map-lon"),d=$(this).data("map-lat"),e=$(this).data("map-zoom"),f=$(this).data("map-boundingbox"),g=$(this).data("map-geojson");require(["leaflet-0.7.3.min"],function(){f&&(southWest=L.latLng(f[0],f[2]),northEast=L.latLng(f[1],f[3]),map_bounds=L.latLngBounds(southWest,northEast)),L.Icon.Default.imagePath="./static/themes/oscar/img/map";{var a=L.map(b),h="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",i='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',j=new L.TileLayer(h,{minZoom:1,maxZoom:19,attribution:i}),k="http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg",l='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',m=new L.TileLayer(k,{minZoom:1,maxZoom:18,subdomains:"1234",attribution:l}),n="http://otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg",o='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors | Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png"> | Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency';new L.TileLayer(n,{minZoom:1,maxZoom:11,subdomains:"1234",attribution:o})}map_bounds?setTimeout(function(){a.fitBounds(map_bounds,{maxZoom:17})},0):c&&d&&(e?a.setView(new L.LatLng(d,c),e):a.setView(new L.LatLng(d,c),8)),a.addLayer(m);var p={"OSM Mapnik":j,MapQuest:m};L.control.layers(p).addTo(a),g&&L.geoJson(g).addTo(a)}),$(this).off(a)})}); \ No newline at end of file
diff --git a/searx/static/themes/oscar/js/searx_src/element_modifiers.js b/searx/static/themes/oscar/js/searx_src/element_modifiers.js
index dd45b77e0..8e4280548 100644
--- a/searx/static/themes/oscar/js/searx_src/element_modifiers.js
+++ b/searx/static/themes/oscar/js/searx_src/element_modifiers.js
@@ -63,6 +63,18 @@ $(document).ready(function(){
$(this).toggleClass(btnClass);
$(this).toggleClass('btn-default');
});
+
+ /**
+ * change text during btn-toggle click if possible
+ */
+ $('.media-loader').click(function() {
+ var target = $(this).data('target');
+ var iframe_load = $(target + ' > iframe');
+ var srctest = iframe_load.attr('src');
+ if(srctest === undefined || srctest === false){
+ iframe_load.attr('src', iframe_load.data('src'));
+ }
+ });
/**
* Select or deselect every categories on double clic
diff --git a/searx/templates/default/result_templates/map.html b/searx/templates/default/result_templates/map.html
index b3669f895..d37c2f374 100644
--- a/searx/templates/default/result_templates/map.html
+++ b/searx/templates/default/result_templates/map.html
@@ -1,7 +1,7 @@
<div class="result {{ result.class }}">
{% if "icon_"~result.engine~".ico" in favicons %}
- <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico) }}" alt="{{result.engine}}" />
+ <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />
{% endif %}
<div>
diff --git a/searx/templates/default/result_templates/torrent.html b/searx/templates/default/result_templates/torrent.html
index fb8988680..4c79a0a39 100644
--- a/searx/templates/default/result_templates/torrent.html
+++ b/searx/templates/default/result_templates/torrent.html
@@ -1,6 +1,6 @@
<div class="result torrent_result">
{% if "icon_"~result.engine~".ico" in favicons %}
- <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico) }}" alt="{{result.engine}}" />
+ <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />
{% endif %}
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
<p class="url">{{ result.pretty_url }}</p>
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html
index e46024d17..466756b6f 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -7,6 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="searx/{{ searx_version }}">
<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>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" />
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html
index 6ab26132e..b2430ed6a 100644
--- a/searx/templates/oscar/result_templates/default.html
+++ b/searx/templates/oscar/result_templates/default.html
@@ -5,6 +5,16 @@
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+{% if result.embedded %}
+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>
+{% endif %}
+
+{% if result.embedded %}
+<div id="result-media-{{ index }}" class="collapse">
+ {{ result.embedded|safe }}
+</div>
+{% endif %}
+
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
<div class="clearfix"></div>
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html
index bfb6cdbe6..9258a0cb7 100644
--- a/searx/templates/oscar/result_templates/torrent.html
+++ b/searx/templates/oscar/result_templates/torrent.html
@@ -5,9 +5,20 @@
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
-<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
-<br/>
-<a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
+<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
+{% if result.filesize %}</br>{{ icon('floppy-disk') }} {{ _('Filesize') }}
+ <span class="badge">
+ {% if result.filesize < 1024 %}{{ result.filesize }} Byte
+ {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} kb
+ {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} MB
+ {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} GB
+ {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} TB{% endif %}
+ </span>{% endif %}
+{% if result.files %}</br>{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %}</p>
+<p class="result-content">
+ <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a>
+ {% if result.torrentfile %}</br><a href="{{ result.torrentfile }}" class="torrentfile">{{ icon('download-alt') }} {{ _('torrent file') }}</a>{% endif %}
+</p>
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html
index ef4c5dd83..c3d02c14d 100644
--- a/searx/templates/oscar/result_templates/videos.html
+++ b/searx/templates/oscar/result_templates/videos.html
@@ -5,6 +5,16 @@
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+{% if result.embedded %}
+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>
+{% endif %}
+
+{% if result.embedded %}
+<div id="result-video-{{ index }}" class="collapse">
+ {{ result.embedded|safe }}
+</div>
+{% endif %}
+
<div class="container-fluid">
<div class="row">
<a href="{{ result.url }}"><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ result.thumbnail|safe }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html
index 380947ca0..46c230695 100644
--- a/searx/templates/oscar/results.html
+++ b/searx/templates/oscar/results.html
@@ -1,5 +1,6 @@
{% extends "oscar/base.html" %}
{% block title %}{{ q }} - {% endblock %}
+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno+1 }}">{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-8" id="main_results">
diff --git a/searx/translations/de/LC_MESSAGES/messages.mo b/searx/translations/de/LC_MESSAGES/messages.mo
index bcfe9dd56..d38001865 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 1639d7898..6c6a53da8 100644
--- a/searx/translations/de/LC_MESSAGES/messages.po
+++ b/searx/translations/de/LC_MESSAGES/messages.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-12-27 10:30+0000\n"
"Last-Translator: pointhi\n"
"Language-Team: German "
@@ -21,11 +21,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "vor {minutes} Minute(n)"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "vor {hours} Stunde(n), {minutes} Minute(n)"
@@ -173,31 +173,31 @@ msgstr "Zurück"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "Such-URL"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Ergebnisse herunterladen"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Vorschläge"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "vorherige Seite"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "nächste Seite"
@@ -276,7 +276,7 @@ msgstr "ändere das Aussehen von searx"
msgid "Search results"
msgstr "Suchergebnisse"
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr "Links"
@@ -360,6 +360,14 @@ msgstr "Irgendetwas ist falsch gelaufen."
msgid "cached"
msgstr "Im Cache"
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr "Bild ansehen"
@@ -392,6 +400,14 @@ msgstr "Seeder"
msgid "Leecher"
msgstr "Leecher"
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr "Übersetzung"
diff --git a/searx/translations/en/LC_MESSAGES/messages.mo b/searx/translations/en/LC_MESSAGES/messages.mo
index 9d746c2b2..c3099bf24 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 07948d1a8..cd807e6ac 100644
--- a/searx/translations/en/LC_MESSAGES/messages.po
+++ b/searx/translations/en/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-01-30 15:22+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: en <LL@li.org>\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr ""
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr ""
@@ -165,31 +165,31 @@ msgstr ""
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr ""
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr ""
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr ""
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr ""
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr ""
@@ -265,7 +265,7 @@ msgstr ""
msgid "Search results"
msgstr ""
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr ""
@@ -346,6 +346,14 @@ msgstr ""
msgid "cached"
msgstr ""
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr ""
@@ -378,6 +386,14 @@ msgstr ""
msgid "Leecher"
msgstr ""
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr ""
diff --git a/searx/translations/es/LC_MESSAGES/messages.mo b/searx/translations/es/LC_MESSAGES/messages.mo
index e737b1cd7..8a36374f6 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 686c0f460..6f336bf11 100644
--- a/searx/translations/es/LC_MESSAGES/messages.po
+++ b/searx/translations/es/LC_MESSAGES/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-11-26 20:38+0000\n"
"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
"Language-Team: Spanish "
@@ -19,11 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "hace {minutes} minuto(s)"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "hace {hours} hora(s) y {minutes} minuto(s)"
@@ -171,31 +171,31 @@ msgstr "Atrás"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "Buscar URL"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Descargar resultados"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Sugerencias"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "Página anterior"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "Página siguiente"
@@ -271,7 +271,7 @@ msgstr ""
msgid "Search results"
msgstr ""
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr ""
@@ -352,6 +352,14 @@ msgstr ""
msgid "cached"
msgstr ""
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr ""
@@ -384,6 +392,14 @@ msgstr ""
msgid "Leecher"
msgstr ""
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr ""
@@ -404,15 +420,9 @@ msgstr "General"
msgid "music"
msgstr "Música"
-msgid "social media"
-msgstr "Medios sociales"
-
msgid "images"
msgstr "Imágenes"
-msgid "videos"
-msgstr "Vídeos"
-
msgid "it"
msgstr "TIC"
diff --git a/searx/translations/fr/LC_MESSAGES/messages.mo b/searx/translations/fr/LC_MESSAGES/messages.mo
index ed0d6a4ec..37507f2f4 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 44e6b96c3..6afff3871 100644
--- a/searx/translations/fr/LC_MESSAGES/messages.po
+++ b/searx/translations/fr/LC_MESSAGES/messages.po
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-12-14 21:00+0000\n"
"Last-Translator: Cqoicebordel <david.barouh@wanadoo.fr>\n"
"Language-Team: French "
@@ -22,11 +22,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "il y a {minutes} minute(s)"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "il y a {hours} heure(s), {minutes} minute(s)"
@@ -174,31 +174,31 @@ msgstr "retour"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "URL de recherche"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Télécharger les résultats"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Suggestions"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "page précédente"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "page suivante"
@@ -277,7 +277,7 @@ msgstr "Modifier l'affichage de searx"
msgid "Search results"
msgstr "Résultats de recherche"
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr "Liens"
@@ -362,6 +362,14 @@ msgstr "Il y a un problème."
msgid "cached"
msgstr "en cache"
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr "afficher le média"
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr "cacher le media"
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr "Voir l'image"
@@ -394,6 +402,14 @@ msgstr "Sources"
msgid "Leecher"
msgstr "Téléchargeurs"
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr "afficher la vidéo"
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr "cacher la vidéo"
+
msgid "Localization"
msgstr "Localisation"
diff --git a/searx/translations/hu/LC_MESSAGES/messages.mo b/searx/translations/hu/LC_MESSAGES/messages.mo
index 69d4257b6..f4d56666f 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 d750a5350..16f021740 100644
--- a/searx/translations/hu/LC_MESSAGES/messages.po
+++ b/searx/translations/hu/LC_MESSAGES/messages.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-12-22 16:11+0000\n"
"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
"Language-Team: Hungarian "
@@ -20,11 +20,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "{minutes} perce"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} óra, {minutes} perce"
@@ -170,31 +170,31 @@ msgstr "vissza"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "Keresési URL"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Találatok letöltése"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Javaslatok"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "előző oldal"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "következő oldal"
@@ -273,7 +273,7 @@ msgstr "Megjelenés"
msgid "Search results"
msgstr "Keresési eredmények"
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr "Linkek"
@@ -354,6 +354,14 @@ msgstr "Hiba történt"
msgid "cached"
msgstr "tárolt"
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr "Kép megjelenítése"
@@ -386,6 +394,14 @@ msgstr "Seeder"
msgid "Leecher"
msgstr "Leecher"
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr "Nyelv"
diff --git a/searx/translations/it/LC_MESSAGES/messages.mo b/searx/translations/it/LC_MESSAGES/messages.mo
index 5c102b871..ce22605ae 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 bafa79e4e..3a49ca7fe 100644
--- a/searx/translations/it/LC_MESSAGES/messages.po
+++ b/searx/translations/it/LC_MESSAGES/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-11-26 20:38+0000\n"
"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
"Language-Team: Italian "
@@ -19,11 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "di {minutes} minuti fa"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "di {ore} h e {minutes} minuti fa"
@@ -171,31 +171,31 @@ msgstr "indietro"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "URL della ricerca"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Scarica i risultati"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Suggerimenti"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "pagina precedente"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "pagina successiva"
@@ -271,7 +271,7 @@ msgstr ""
msgid "Search results"
msgstr ""
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr ""
@@ -352,6 +352,14 @@ msgstr ""
msgid "cached"
msgstr ""
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr ""
@@ -384,6 +392,14 @@ msgstr ""
msgid "Leecher"
msgstr ""
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr ""
@@ -404,15 +420,9 @@ msgstr "generale"
msgid "music"
msgstr "musica"
-msgid "social media"
-msgstr "social media"
-
msgid "images"
msgstr "immagini"
-msgid "videos"
-msgstr "video"
-
msgid "it"
msgstr "it"
diff --git a/searx/translations/ja/LC_MESSAGES/messages.mo b/searx/translations/ja/LC_MESSAGES/messages.mo
index d44ee77a7..0b25be7a6 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 0a329ca09..c91fd1f8f 100644
--- a/searx/translations/ja/LC_MESSAGES/messages.po
+++ b/searx/translations/ja/LC_MESSAGES/messages.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-11-26 20:38+0000\n"
"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
"Language-Team: Japanese "
@@ -20,11 +20,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "{minutes}分前"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours}時間と{minutes}分前"
@@ -168,31 +168,31 @@ msgstr "バック"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr ""
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "ダウンロードの結果"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "提案"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "前のページ"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "次のページ"
@@ -268,7 +268,7 @@ msgstr ""
msgid "Search results"
msgstr ""
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr ""
@@ -349,6 +349,14 @@ msgstr ""
msgid "cached"
msgstr ""
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr ""
@@ -381,6 +389,14 @@ msgstr ""
msgid "Leecher"
msgstr ""
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr ""
@@ -401,15 +417,9 @@ msgstr "ウェブ"
msgid "music"
msgstr "音楽"
-msgid "social media"
-msgstr "ソーシャルメディア"
-
msgid "images"
msgstr "画像"
-msgid "videos"
-msgstr "動画"
-
msgid "it"
msgstr "情報技術"
diff --git a/searx/translations/nl/LC_MESSAGES/messages.mo b/searx/translations/nl/LC_MESSAGES/messages.mo
index afa9438e1..df5e7f45b 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 3d3a9def9..e3be7a90e 100644
--- a/searx/translations/nl/LC_MESSAGES/messages.po
+++ b/searx/translations/nl/LC_MESSAGES/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-12-11 13:50+0000\n"
"Last-Translator: André Koot <meneer@tken.net>\n"
"Language-Team: Dutch "
@@ -19,11 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "{minutes} min geleden"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} uur, {minutes} min geleden"
@@ -171,31 +171,31 @@ msgstr "terug"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "Zoek URL"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Downloaden zoekresultaten"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Suggesties"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "vorige pagina"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "volgende pagina"
@@ -274,7 +274,7 @@ msgstr "Wijzig searx layout"
msgid "Search results"
msgstr "Zoekresultaten"
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr "Links"
@@ -357,6 +357,14 @@ msgstr "Er ging iets fout."
msgid "cached"
msgstr "gecached"
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr "Toon afbeelding"
@@ -389,6 +397,14 @@ msgstr "Aanbieder"
msgid "Leecher"
msgstr "Ophaler"
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr "Vertaling"
diff --git a/searx/translations/tr/LC_MESSAGES/messages.mo b/searx/translations/tr/LC_MESSAGES/messages.mo
index 5d6c0498f..2ea370523 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 a39ae3fd8..22190141e 100644
--- a/searx/translations/tr/LC_MESSAGES/messages.po
+++ b/searx/translations/tr/LC_MESSAGES/messages.po
@@ -1,30 +1,30 @@
-# English translations for PROJECT.
+# English translations for .
# Copyright (C) 2014 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-#
+# This file is distributed under the same license as the project.
+#
# Translators:
# Caner Başaran <basaran.caner@gmail.com>, 2014
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
msgid ""
msgstr ""
-"Project-Id-Version: searx\n"
+"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2014-12-27 14:39+0100\n"
+"POT-Creation-Date: 2015-01-05 20:54+0100\n"
"PO-Revision-Date: 2014-12-28 08:20+0000\n"
"Last-Translator: Caner Başaran <basaran.caner@gmail.com>\n"
-"Language-Team: Turkish (http://www.transifex.com/projects/p/searx/language/tr/)\n"
+"Language-Team: Turkish "
+"(http://www.transifex.com/projects/p/searx/language/tr/)\n"
+"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
-"Language: tr\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: searx/webapp.py:247
+#: searx/webapp.py:263
msgid "{minutes} minute(s) ago"
msgstr "{minutes} dakika() önce"
-#: searx/webapp.py:249
+#: searx/webapp.py:265
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "{hours} saat(), {minutes} dakika() önce"
@@ -142,9 +142,11 @@ msgstr "Engelle"
#: searx/templates/default/preferences.html:92
#: searx/templates/oscar/preferences.html:132
msgid ""
-"These settings are stored in your cookies, this allows us not to store this "
-"data about you."
-msgstr "Ayarlar çerezlerinizde saklanır. Verdiğiniz izinler, sizin hakkınızda veri saklamak için değil."
+"These settings are stored in your cookies, this allows us not to store "
+"this data about you."
+msgstr ""
+"Ayarlar çerezlerinizde saklanır. Verdiğiniz izinler, sizin hakkınızda "
+"veri saklamak için değil."
#: searx/templates/courgette/preferences.html:94
#: searx/templates/default/preferences.html:94
@@ -168,31 +170,31 @@ msgstr "geri"
#: searx/templates/courgette/results.html:12
#: searx/templates/default/results.html:12
-#: searx/templates/oscar/results.html:83
+#: searx/templates/oscar/results.html:87
msgid "Search URL"
msgstr "Arama Bağlantısı"
#: searx/templates/courgette/results.html:16
#: searx/templates/default/results.html:16
-#: searx/templates/oscar/results.html:88
+#: searx/templates/oscar/results.html:92
msgid "Download results"
msgstr "Arama sonuçlarını indir"
#: searx/templates/courgette/results.html:34
#: searx/templates/default/results.html:42
-#: searx/templates/oscar/results.html:63
+#: searx/templates/oscar/results.html:67
msgid "Suggestions"
msgstr "Öneriler"
#: searx/templates/courgette/results.html:62
#: searx/templates/default/results.html:78
-#: searx/templates/oscar/results.html:37
+#: searx/templates/oscar/results.html:41
msgid "previous page"
msgstr "önceki sayfa"
#: searx/templates/courgette/results.html:73
#: searx/templates/default/results.html:89
-#: searx/templates/oscar/results.html:45
+#: searx/templates/oscar/results.html:49
msgid "next page"
msgstr "sonraki sayfa"
@@ -221,7 +223,9 @@ msgstr "Gücümün kaynağı"
#: searx/templates/oscar/base.html:69
msgid "a privacy-respecting, hackable metasearch engine"
-msgstr "kişisel gizliliğe saygılı ve merak edenlerin kurcalayabildiği bir meta arama motoru"
+msgstr ""
+"kişisel gizliliğe saygılı ve merak edenlerin kurcalayabildiği bir meta "
+"arama motoru"
#: searx/templates/oscar/navbar.html:6
msgid "Toggle navigation"
@@ -258,7 +262,10 @@ 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 "Aramaların nasıl gönderildiğini değiştir, <a href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">istek yöntemleri hakkında daha fazla bilgi</a>"
+msgstr ""
+"Aramaların nasıl gönderildiğini değiştir, <a "
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
+" rel=\"external\">istek yöntemleri hakkında daha fazla bilgi</a>"
#: searx/templates/oscar/preferences.html:84
msgid "Change searx layout"
@@ -268,12 +275,11 @@ msgstr "searx yerleşim düzenini değiştir"
msgid "Search results"
msgstr "Arama sonuçları"
-#: searx/templates/oscar/results.html:78
+#: searx/templates/oscar/results.html:82
msgid "Links"
msgstr "Bağlantılar"
-#: searx/templates/oscar/search.html:6
-#: searx/templates/oscar/search_full.html:7
+#: searx/templates/oscar/search.html:6 searx/templates/oscar/search_full.html:7
msgid "Start search"
msgstr "Aramayı başlat"
@@ -311,7 +317,9 @@ msgstr "Uyarı!"
#: searx/templates/oscar/messages/js_disabled.html:3
msgid "Please enable JavaScript to use full functionality of this site."
-msgstr "Lütfen, bu sitenin tüm işlevlerini kullanmak için JavaScript'i etkinleştirin."
+msgstr ""
+"Lütfen, bu sitenin tüm işlevlerini kullanmak için JavaScript'i "
+"etkinleştirin."
#: searx/templates/oscar/messages/no_data_available.html:4
msgid "There is currently no data available. "
@@ -325,7 +333,9 @@ msgstr "Üzgünüz!"
msgid ""
"we didn't find any results. Please use another query or search in more "
"categories."
-msgstr "herhangi bir sonuç bulamadık. Lütfen, başka sorgu kullanın veya daha fazla kategoride arama yapın."
+msgstr ""
+"herhangi bir sonuç bulamadık. Lütfen, başka sorgu kullanın veya daha "
+"fazla kategoride arama yapın."
#: searx/templates/oscar/messages/save_settings_successfull.html:7
msgid "Well done!"
@@ -350,6 +360,14 @@ msgstr "Bazı bazı şeylerde problem olmuş."
msgid "cached"
msgstr "önbellek"
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "show media"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/default.html:9
+msgid "hide media"
+msgstr ""
+
#: searx/templates/oscar/result_templates/images.html:21
msgid "Get image"
msgstr "Görseli indir"
@@ -382,6 +400,14 @@ msgstr "Besleyenler"
msgid "Leecher"
msgstr "Sömürenler"
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "show video"
+msgstr ""
+
+#: searx/templates/oscar/result_templates/videos.html:9
+msgid "hide video"
+msgstr ""
+
msgid "Localization"
msgstr ""
@@ -419,3 +445,4 @@ msgstr "haberler"
msgid "map"
msgstr "harita"
+
diff --git a/searx/utils.py b/searx/utils.py
index 5bd1ced4d..0b4de9410 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -1,15 +1,21 @@
# import htmlentitydefs
+import locale
+import dateutil.parser
+import cStringIO
+import csv
+import os
+import re
+
from codecs import getincrementalencoder
from HTMLParser import HTMLParser
from random import choice
from searx.version import VERSION_STRING
from searx import settings
+from searx import logger
-import cStringIO
-import csv
-import os
-import re
+
+logger = logger.getChild('utils')
ua_versions = ('29.0',
'30.0',
@@ -181,3 +187,22 @@ def get_result_templates(base_path):
f = os.path.join(directory[base_path_length:], filename)
result_templates.add(f)
return result_templates
+
+
+def format_date_by_locale(date_string, locale_string):
+ # strftime works only on dates after 1900
+ parsed_date = dateutil.parser.parse(date_string)
+ if parsed_date.year <= 1900:
+ return parsed_date.isoformat().split('T')[0]
+
+ orig_locale = locale.getlocale()[0]
+ try:
+ locale.setlocale(locale.LC_ALL, locale_string)
+ except:
+ logger.warning('cannot set locale: {0}'.format(locale_string))
+ formatted_date = parsed_date.strftime(locale.nl_langinfo(locale.D_FMT))
+ try:
+ locale.setlocale(locale.LC_ALL, orig_locale)
+ except:
+ logger.warning('cannot set original locale: {0}'.format(orig_locale))
+ return formatted_date
diff --git a/searx/webapp.py b/searx/webapp.py
index 6ee9af745..8ed4cc7c1 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -46,9 +46,12 @@ from searx.languages import language_codes
from searx.https_rewrite import https_url_rewrite
from searx.search import Search
from searx.query import Query
-from searx.autocomplete import backends as autocomplete_backends
+from searx.autocomplete import searx_bang, backends as autocomplete_backends
+from searx import logger
+logger = logger.getChild('webapp')
+
static_path, templates_path, themes =\
get_themes(settings['themes_path']
if settings.get('themes_path')
@@ -340,17 +343,22 @@ def autocompleter():
# check if search query is set
if not query.getSearchQuery():
- return
+ return '', 400
# run autocompleter
completer = autocomplete_backends.get(request.cookies.get('autocomplete'))
# check if valid autocompleter is selected
if not completer:
- return
+ return '', 400
+
+ # parse searx specific autocompleter results like !bang
+ raw_results = searx_bang(query)
- # run autocompletion
- raw_results = completer(query.getSearchQuery())
+ # normal autocompletion results only appear if max 3. searx results returned
+ if len(raw_results) <= 3:
+ # run autocompletion
+ raw_results.extend(completer(query.getSearchQuery()))
# parse results (write :language and !engine back to result string)
results = []
diff --git a/utils/update-translations.sh b/utils/update-translations.sh
index bac7d3c4c..2f9ab218f 100755
--- a/utils/update-translations.sh
+++ b/utils/update-translations.sh
@@ -9,7 +9,7 @@ SEARX_DIR='searx'
pybabel extract -F babel.cfg -o messages.pot $SEARX_DIR
for f in `ls $SEARX_DIR'/translations/'`; do
- pybabel update -i messages.pot -d $SEARX_DIR'/translations/' -l $f
+ pybabel update -N -i messages.pot -d $SEARX_DIR'/translations/' -l $f
# TODO - need to fix category translations
sed -i 's/#~ //' $SEARX_DIR'/translations/'$f'/LC_MESSAGES/messages.po'
done