on master help sign in
Add language support
10e4f6fCqoicebordel
searx/engines/subtitleseeker.py+5
@@ -15,6 +15,7 @@ from lxml import html
15# engine dependent config
15# engine dependent config
16categories = ['videos']
16categories = ['videos']
17paging = True
17paging = True
18+language = ""
18
19
19# search-url
20# search-url
20url = 'http://www.subtitleseeker.com/'
21url = 'http://www.subtitleseeker.com/'
@@ -41,6 +42,10 @@ def response(resp):
41 for result in dom.xpath(results_xpath):
42 for result in dom.xpath(results_xpath):
42 link = result.xpath(".//a")[0]
43 link = result.xpath(".//a")[0]
43 href = link.attrib.get('href')
44 href = link.attrib.get('href')
45+
46+ if language is not "":
47+ href = href + language + "/"
48+
44 title = escape(link.xpath(".//text()")[0])
49 title = escape(link.xpath(".//text()")[0])
45
50
46 content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
51 content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
searx/settings.yml+3
@@ -130,6 +130,9 @@ engines:
130 - name : subtitleseeker
130 - name : subtitleseeker
131 engine : subtitleseeker
131 engine : subtitleseeker
132 shortcut : ss
132 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
133
136
134 - name : startpage
137 - name : startpage
135 engine : startpage
138 engine : startpage