on master help sign in
[fix] fixes google play engines (#1651)
f34b5ceAlexandre Flament
searx/engines/xpath.py+3−6
@@ -111,13 +111,10 @@ def response(resp):
111 tmp_result = {'url': url, 'title': title, 'content': content}
111 tmp_result = {'url': url, 'title': title, 'content': content}
112
112
113 # add thumbnail if available
113 # add thumbnail if available
114− thumbnail = None
115 if thumbnail_xpath:
114 if thumbnail_xpath:
116− thumbnail = extract_url(
117− result.xpath(thumbnail_xpath), search_url
115+ thumbnail_xpath_result = result.xpath(thumbnail_xpath)
118− )
116+ if len(thumbnail_xpath_result) > 0:
119− if thumbnail:
117+ tmp_result['img_src'] = extract_url(thumbnail_xpath_result, search_url)
120− tmp_result['img_src'] = thumbnail
121
118
122 results.append(tmp_result)
119 results.append(tmp_result)
123 else:
120 else:
searx/settings.yml+3−3
@@ -321,7 +321,7 @@ engines:
321 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
321 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
322 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
322 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
323 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
323 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
324− thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]/img/@data-src'
324+ thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]//img/@data-src'
325 categories : files
325 categories : files
326 shortcut : gpa
326 shortcut : gpa
327 disabled : True
327 disabled : True
@@ -333,7 +333,7 @@ engines:
333 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
333 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
334 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
334 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
335 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
335 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
336− thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]/img/@data-src'
336+ thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]//img/@data-src'
337 categories : videos
337 categories : videos
338 shortcut : gpm
338 shortcut : gpm
339 disabled : True
339 disabled : True
@@ -345,7 +345,7 @@ engines:
345 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
345 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
346 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
346 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
347 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
347 content_xpath : './/div[@class="RZEgze"]//a[@class="mnKHRc"]'
348− thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]/img/@data-src'
348+ thumbnail_xpath : './/div[@class="uzcko"]/div/span[1]//img/@data-src'
349 categories : music
349 categories : music
350 shortcut : gps
350 shortcut : gps
351 disabled : True
351 disabled : True