Pārlūkot izejas kodu

Add language support

Cqoicebordel 10 gadus atpakaļ
vecāks
revīzija
2ea55b1c64
2 mainītis faili ar 4 papildinājumiem un 13 dzēšanām
  1. 0
    6
      searx/engines/subtitleseeker.py
  2. 4
    7
      searx/settings.yml

+ 0
- 6
searx/engines/subtitleseeker.py Parādīt failu

16
 categories = ['videos']
16
 categories = ['videos']
17
 paging = True
17
 paging = True
18
 
18
 
19
-language = ""
20
-
21
 # search-url
19
 # search-url
22
 url = 'http://www.subtitleseeker.com/'
20
 url = 'http://www.subtitleseeker.com/'
23
 search_url = url+'search/TITLES/{query}&p={pageno}'
21
 search_url = url+'search/TITLES/{query}&p={pageno}'
43
     for result in dom.xpath(results_xpath):
41
     for result in dom.xpath(results_xpath):
44
         link = result.xpath(".//a")[0]
42
         link = result.xpath(".//a")[0]
45
         href = link.attrib.get('href')
43
         href = link.attrib.get('href')
46
-        
47
-        if language is not "":
48
-            href = href + language + "/"
49
-
50
         title = escape(link.xpath(".//text()")[0])
44
         title = escape(link.xpath(".//text()")[0])
51
 
45
 
52
         content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
46
         content = result.xpath('.//div[contains(@class,"red")]//text()')[0]

+ 4
- 7
searx/settings.yml Parādīt failu

1
 server:
1
 server:
2
-    port : 2722
3
-    secret_key : "8f92c98926f04c8cb2a5fdc3bca19f7c" # change this!
4
-    debug : True # Debug mode, only for development
2
+    port : 8888
3
+    secret_key : "ultrasecretkey" # change this!
4
+    debug : False # Debug mode, only for development
5
     request_timeout : 2.0 # seconds
5
     request_timeout : 2.0 # seconds
6
     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
6
     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
7
     themes_path : "" # Custom ui themes path
7
     themes_path : "" # Custom ui themes path
8
     default_theme : default # ui theme
8
     default_theme : default # ui theme
9
     https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py
9
     https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py
10
-    useragent_suffix : "Cqcb Style" # suffix of searx_useragent, could contain informations like an email address to the administrator
10
+    useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator
11
 
11
 
12
 engines:
12
 engines:
13
   - name : wikipedia
13
   - name : wikipedia
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
136
 
133
 
137
   - name : startpage
134
   - name : startpage
138
     engine : startpage
135
     engine : startpage