on master help sign in
Add language support

Allow the user to select a language. It must be written in english, and capitalized, ie : English, French, German, Hungarian...

commit10e4f6f31631fe51d16b324223525570f3e75850 authorCqoicebordel <Cqoicebordel@users.noreply.github.com> dateTue 23 Dec 2014, 01:51 (12 years ago) parent2ea55b1
2 files changed+8
searx/engines/subtitleseeker.py+5 searx/settings.yml+3
searx/engines/subtitleseeker.py+5
@@ -15,6 +15,7 @@ from lxml import html
1515# engine dependent config
1616categories = ['videos']
1717paging = True
18+language = ""
1819
1920# search-url
2021url = 'http://www.subtitleseeker.com/'
@@ -41,6 +42,10 @@ def response(resp):
4142 for result in dom.xpath(results_xpath):
4243 link = result.xpath(".//a")[0]
4344 href = link.attrib.get('href')
45+
46+ if language is not "":
47+ href = href + language + "/"
48+
4449 title = escape(link.xpath(".//text()")[0])
4550
4651 content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
searx/settings.yml+3
@@ -130,6 +130,9 @@ engines:
130130 - name : subtitleseeker
131131 engine : subtitleseeker
132132 shortcut : ss
133+# The language is an option. You can put any language written in english
134+# Examples : English, French, German, Hungarian, Chinese...
135+# language : English
133136
134137 - name : startpage
135138 engine : startpage