|
@@ -1,6 +1,4 @@
|
1
|
|
-from json import loads
|
2
|
1
|
from urllib import urlencode
|
3
|
|
-from searx.utils import html_to_text
|
4
|
2
|
from HTMLParser import HTMLParser
|
5
|
3
|
|
6
|
4
|
url = 'http://www.filecrop.com/'
|
|
@@ -10,7 +8,7 @@ class FilecropResultParser(HTMLParser):
|
10
|
8
|
def __init__(self):
|
11
|
9
|
HTMLParser.__init__(self)
|
12
|
10
|
self.__start_processing = False
|
13
|
|
-
|
|
11
|
+
|
14
|
12
|
self.results = []
|
15
|
13
|
self.result = {}
|
16
|
14
|
|
|
@@ -22,7 +20,7 @@ class FilecropResultParser(HTMLParser):
|
22
|
20
|
if tag == 'tr':
|
23
|
21
|
if ('bgcolor', '#edeff5') in attrs or ('bgcolor', '#ffffff') in attrs:
|
24
|
22
|
self.__start_processing = True
|
25
|
|
-
|
|
23
|
+
|
26
|
24
|
if not self.__start_processing:
|
27
|
25
|
return
|
28
|
26
|
|
|
@@ -50,7 +48,7 @@ class FilecropResultParser(HTMLParser):
|
50
|
48
|
self.data_counter = 0
|
51
|
49
|
self.results.append(self.result)
|
52
|
50
|
self.result = {}
|
53
|
|
-
|
|
51
|
+
|
54
|
52
|
def handle_data(self, data):
|
55
|
53
|
if not self.__start_processing:
|
56
|
54
|
return
|
|
@@ -59,7 +57,7 @@ class FilecropResultParser(HTMLParser):
|
59
|
57
|
self.result['content'] += data + ' '
|
60
|
58
|
else:
|
61
|
59
|
self.result['content'] = data + ' '
|
62
|
|
-
|
|
60
|
+
|
63
|
61
|
self.data_counter += 1
|
64
|
62
|
|
65
|
63
|
def request(query, params):
|