summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2014-12-23 01:51:07 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2014-12-23 01:51:07 +0100
commit10e4f6f31631fe51d16b324223525570f3e75850 (patch)
tree75bad772092e572e92235417864f778b3781c6b2 /searx/engines
parent2ea55b1c6451e77381bd88dd82f635d48ff1b6fe (diff)
downloadsearxng-10e4f6f31631fe51d16b324223525570f3e75850.tar.gz
searxng-10e4f6f31631fe51d16b324223525570f3e75850.zip
Add language support
Allow the user to select a language. It must be written in english, and capitalized, ie : English, French, German, Hungarian...
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/subtitleseeker.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/engines/subtitleseeker.py b/searx/engines/subtitleseeker.py
index 346298300..48790a35c 100644
--- a/searx/engines/subtitleseeker.py
+++ b/searx/engines/subtitleseeker.py
@@ -15,6 +15,7 @@ from lxml import html
# engine dependent config
categories = ['videos']
paging = True
+language = ""
# search-url
url = 'http://www.subtitleseeker.com/'
@@ -41,6 +42,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]