mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 21:01:01 +00:00
[mod] vimeo engine mods
This commit is contained in:
parent
6f8daea724
commit
0eb3cdf664
1 changed files with 8 additions and 5 deletions
|
@ -5,9 +5,13 @@ from lxml import html
|
||||||
|
|
||||||
base_url = 'http://vimeo.com'
|
base_url = 'http://vimeo.com'
|
||||||
search_url = base_url + '/search?{query}'
|
search_url = base_url + '/search?{query}'
|
||||||
|
url_xpath = None
|
||||||
|
content_xpath = None
|
||||||
|
title_xpath = None
|
||||||
|
results_xpath = ''
|
||||||
|
|
||||||
# the cookie set by vime contains all the following values, but only __utma seems to be requiered
|
# the cookie set by vimeo contains all the following values, but only __utma seems to be requiered
|
||||||
Cookie = {
|
cookie = {
|
||||||
#'vuid':'918282893.1027205400'
|
#'vuid':'918282893.1027205400'
|
||||||
# 'ab_bs':'%7B%223%22%3A279%7D'
|
# 'ab_bs':'%7B%223%22%3A279%7D'
|
||||||
'__utma':'00000000.000#0000000.0000000000.0000000000.0000000000.0'
|
'__utma':'00000000.000#0000000.0000000000.0000000000.0000000000.0'
|
||||||
|
@ -19,14 +23,13 @@ Cookie = {
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
params['url'] = search_url.format(query=urlencode({'q' :query}))
|
params['url'] = search_url.format(query=urlencode({'q' :query}))
|
||||||
print params['url']
|
params['cookies'] = cookie
|
||||||
params['cookies'] = Cookie
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
def response(resp):
|
def response(resp):
|
||||||
results = []
|
results = []
|
||||||
dom = html.fromstring(resp.text)
|
dom = html.fromstring(resp.text)
|
||||||
|
|
||||||
p = HTMLParser()
|
p = HTMLParser()
|
||||||
|
|
||||||
for result in dom.xpath(results_xpath):
|
for result in dom.xpath(results_xpath):
|
||||||
|
|
Loading…
Reference in a new issue