@@ -0,0 +1,61 @@
4+ @website https://www.apkmirror.com
8+ @stable no (HTML can change)
9+ @parse url, title, thumbnail_src
13+from searx.engines.xpath import extract_text
14+from searx.url_utils import urlencode
16+# engine dependent config
20+# I am not 100% certain about this, as apkmirror appears to be a wordpress site,
21+# which might support time_range searching. If you want to implement it, go ahead.
22+time_range_support = False
25+base_url = 'https://www.apkmirror.com'
26+search_url = base_url + '/?post_type=app_release&searchtype=apk&page={pageno}&{query}'
30+def request(query, params):
32+ params['url'] = search_url.format(pageno=params['pageno'],
33+ query=urlencode({'s': query}))
37+# get response from search-request
41+ dom = html.fromstring(resp.text)
44+ for result in dom.xpath('.//div[@id="content"]/div[@class="listWidget"]/div[@class="appRow"]'):
46+ link = result.xpath('.//h5/a')[0]
47+ url = base_url + link.attrib.get('href') + '#downloads'
48+ title = extract_text(link)
49+ thumbnail_src = base_url + result.xpath('.//img')[0].attrib.get('src').replace('&w=32&h=32', '&w=64&h=64')
54+ 'thumbnail_src': thumbnail_src