Sfoglia il codice sorgente

Add icons and badge for the themes

Add kickass in engine list
Add content for the result from kickass
Cqoicebordel 10 anni fa
parent
commit
e623ee593a

+ 3
- 2
searx/engines/kickass.py Vedi File

13
 from urllib import quote
13
 from urllib import quote
14
 from lxml import html
14
 from lxml import html
15
 from operator import itemgetter
15
 from operator import itemgetter
16
+from dateutil import parser
16
 
17
 
17
 # engine dependent config
18
 # engine dependent config
18
 categories = ['videos', 'music', 'files']
19
 categories = ['videos', 'music', 'files']
52
         link = result.xpath('.//a[@class="cellMainLink"]')[0]
53
         link = result.xpath('.//a[@class="cellMainLink"]')[0]
53
         href = urljoin(url, link.attrib['href'])
54
         href = urljoin(url, link.attrib['href'])
54
         title = ' '.join(link.xpath('.//text()'))
55
         title = ' '.join(link.xpath('.//text()'))
55
-        #content = escape(' '.join(result.xpath(content_xpath)))
56
+        content = escape(html.tostring(result.xpath('.//span[@class="font11px lightgrey block"]')[0], method="text"))
56
         seed = result.xpath('.//td[contains(@class, "green")]/text()')[0]
57
         seed = result.xpath('.//td[contains(@class, "green")]/text()')[0]
57
         leech = result.xpath('.//td[contains(@class, "red")]/text()')[0]
58
         leech = result.xpath('.//td[contains(@class, "red")]/text()')[0]
58
 
59
 
73
         # append result
74
         # append result
74
         results.append({'url': href,
75
         results.append({'url': href,
75
                         'title': title,
76
                         'title': title,
76
-                        'content': '',
77
+                        'content': content,
77
                         'seed': seed,
78
                         'seed': seed,
78
                         'leech': leech,
79
                         'leech': leech,
79
                         'magnetlink': magnetlink,
80
                         'magnetlink': magnetlink,

BIN
searx/static/courgette/img/icon_kickass.ico Vedi File


BIN
searx/static/default/img/icon_kickass.ico Vedi File


BIN
searx/static/oscar/img/icons/kickass.png Vedi File


+ 1
- 1
searx/webapp.py Vedi File

70
 
70
 
71
 #TODO configurable via settings.yml
71
 #TODO configurable via settings.yml
72
 favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud',
72
 favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud',
73
-            'twitter', 'stackoverflow', 'github', 'deviantart']
73
+            'twitter', 'stackoverflow', 'github', 'deviantart', 'kickass']
74
 
74
 
75
 cookie_max_age = 60 * 60 * 24 * 365 * 23  # 23 years
75
 cookie_max_age = 60 * 60 * 24 * 365 * 23  # 23 years
76
 
76