Parcourir la source

[mod] vimeo engine mods

asciimoo il y a 11 ans
Parent
révision
0eb3cdf664
1 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 8
    5
      searx/engines/vimeo.py

+ 8
- 5
searx/engines/vimeo.py Voir le fichier

@@ -5,9 +5,13 @@ from lxml import html
5 5
 
6 6
 base_url = 'http://vimeo.com'
7 7
 search_url = base_url + '/search?{query}'
8
+url_xpath     = None
9
+content_xpath = None
10
+title_xpath   = None
11
+results_xpath = ''
8 12
 
9
-# the cookie set by vime contains all the following values, but only __utma seems to be requiered 
10
-Cookie = {
13
+# the cookie set by vimeo contains all the following values, but only __utma seems to be requiered
14
+cookie = {
11 15
     #'vuid':'918282893.1027205400'
12 16
     # 'ab_bs':'%7B%223%22%3A279%7D'
13 17
      '__utma':'00000000.000#0000000.0000000000.0000000000.0000000000.0'
@@ -19,14 +23,13 @@ Cookie = {
19 23
 
20 24
 def request(query, params):
21 25
     params['url'] = search_url.format(query=urlencode({'q' :query}))
22
-    print params['url']
23
-    params['cookies'] = Cookie
26
+    params['cookies'] = cookie
24 27
     return params
25 28
 
26 29
 def response(resp):
27 30
     results = []
28 31
     dom = html.fromstring(resp.text)
29
-    
32
+
30 33
     p = HTMLParser()
31 34
 
32 35
     for result in dom.xpath(results_xpath):