on master help sign in
[fix] fixes google play engines (#1651)

update commit 87baa74a863ac74ae4c86bbfcb04148ba7f70696

commitf34b5cedb11bcb38eb2ad76cc3ed2b5eb421a75a authorAlexandre Flament <alex@al-f.net> dateThu 25 Jul 2019, 09:31 (7 years ago) parentcac8e7c
2 files changed+6−9
searx/engines/xpath.py+3−6 searx/settings.yml+3−3
searx/engines/xpath.py+3−6
@@ -111,13 +111,10 @@ def response(resp):
111111 tmp_result = {'url': url, 'title': title, 'content': content}
112112
113113 # add thumbnail if available
114− thumbnail = None
115114 if thumbnail_xpath:
116− thumbnail = extract_url(
117− result.xpath(thumbnail_xpath), search_url
118− )
119− if thumbnail:
120− tmp_result['img_src'] = thumbnail
115+ thumbnail_xpath_result = result.xpath(thumbnail_xpath)
116+ if len(thumbnail_xpath_result) > 0:
117+ tmp_result['img_src'] = extract_url(thumbnail_xpath_result, search_url)
121118
122119 results.append(tmp_result)
123120 else:
searx/settings.yml+3−3
@@ -321,7 +321,7 @@ engines:
321321 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
322322 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
323323 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'
325325 categories : files
326326 shortcut : gpa
327327 disabled : True
@@ -333,7 +333,7 @@ engines:
333333 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
334334 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
335335 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'
337337 categories : videos
338338 shortcut : gpm
339339 disabled : True
@@ -345,7 +345,7 @@ engines:
345345 title_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a'
346346 url_xpath : './/div[@class="RZEgze"]//div[@title and not(@title="")]/a/@href'
347347 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'
349349 categories : music
350350 shortcut : gps
351351 disabled : True