ソースを参照

Add language support

Cqoicebordel 10 年 前
コミット
10e4f6f316
共有2 個のファイルを変更した8 個の追加0 個の削除を含む
  1. 5
    0
      searx/engines/subtitleseeker.py
  2. 3
    0
      searx/settings.yml

+ 5
- 0
searx/engines/subtitleseeker.py ファイルの表示

15
 # engine dependent config
15
 # engine dependent config
16
 categories = ['videos']
16
 categories = ['videos']
17
 paging = True
17
 paging = True
18
+language = ""
18
 
19
 
19
 # search-url
20
 # search-url
20
 url = 'http://www.subtitleseeker.com/'
21
 url = 'http://www.subtitleseeker.com/'
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]

+ 3
- 0
searx/settings.yml ファイルの表示

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