summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2014-12-23 01:41:25 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2014-12-23 01:41:25 +0100
commit829948b85df0510e331372bcd60cb31db9c96a5c (patch)
tree1cd082f7cb0dd4fb2de821ed9347843326d7d6d1
parent550232fc21ff2c3ae9a5de3d8b999de66c96171c (diff)
downloadsearxng-829948b85df0510e331372bcd60cb31db9c96a5c.tar.gz
searxng-829948b85df0510e331372bcd60cb31db9c96a5c.zip
Add language support
Allow the user to select a language. It must be written in english, and capitalized, ie : English, French, German, Hungarian...
-rw-r--r--searx/engines/subtitleseeker.py6
-rw-r--r--searx/settings.yml11
2 files changed, 13 insertions, 4 deletions
diff --git a/searx/engines/subtitleseeker.py b/searx/engines/subtitleseeker.py
index 346298300..c72f81899 100644
--- a/searx/engines/subtitleseeker.py
+++ b/searx/engines/subtitleseeker.py
@@ -16,6 +16,8 @@ from lxml import html
categories = ['videos']
paging = True
+language = ""
+
# search-url
url = 'http://www.subtitleseeker.com/'
search_url = url+'search/TITLES/{query}&p={pageno}'
@@ -41,6 +43,10 @@ def response(resp):
for result in dom.xpath(results_xpath):
link = result.xpath(".//a")[0]
href = link.attrib.get('href')
+
+ if language is not "":
+ href = href + language + "/"
+
title = escape(link.xpath(".//text()")[0])
content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
diff --git a/searx/settings.yml b/searx/settings.yml
index cc7073181..ed22ad90d 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -1,13 +1,13 @@
server:
- port : 8888
- secret_key : "ultrasecretkey" # change this!
- debug : False # Debug mode, only for development
+ port : 2722
+ secret_key : "8f92c98926f04c8cb2a5fdc3bca19f7c" # change this!
+ debug : True # Debug mode, only for development
request_timeout : 2.0 # seconds
base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
themes_path : "" # Custom ui themes path
default_theme : default # ui theme
https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py
- useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator
+ useragent_suffix : "Cqcb Style" # suffix of searx_useragent, could contain informations like an email address to the administrator
engines:
- name : wikipedia
@@ -130,6 +130,9 @@ engines:
- name : subtitleseeker
engine : subtitleseeker
shortcut : ss
+# The language is an option. You can put any language written in english
+# Examples : English, French, German, Hungarian, Chinese...
+# language : English
- name : startpage
engine : startpage