mirror of https://github.com/searxng/searxng.git
add the apple app store engine
The Apple App Store is the digital app distribution platform for iOS & iPadOS.
This commit is contained in:
parent
4dc70b08a5
commit
e5c1b64b1d
|
@ -0,0 +1,51 @@
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
# lint: pylint
|
||||||
|
"""
|
||||||
|
Apple App Store
|
||||||
|
"""
|
||||||
|
|
||||||
|
from json import loads
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
from dateutil.parser import parse
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": 'https://www.apple.com/app-store/',
|
||||||
|
"wikidata_id": 'Q368215',
|
||||||
|
"official_api_documentation": (
|
||||||
|
'https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/'
|
||||||
|
'iTuneSearchAPI/UnderstandingSearchResults.html#//apple_ref/doc/uid/TP40017632-CH8-SW1'
|
||||||
|
),
|
||||||
|
"use_official_api": True,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": 'JSON',
|
||||||
|
}
|
||||||
|
|
||||||
|
categories = ['files', 'apps']
|
||||||
|
|
||||||
|
search_url = 'https://itunes.apple.com/search?{query}'
|
||||||
|
|
||||||
|
|
||||||
|
def request(query, params):
|
||||||
|
params['url'] = search_url.format(query=urlencode({'term': query, 'media': 'software'}))
|
||||||
|
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp):
|
||||||
|
results = []
|
||||||
|
|
||||||
|
json_result = loads(resp.text)
|
||||||
|
|
||||||
|
for result in json_result['results']:
|
||||||
|
results.append(
|
||||||
|
{
|
||||||
|
'url': result['trackViewUrl'],
|
||||||
|
'title': result['trackName'],
|
||||||
|
'content': result['sellerName'] + ': ' + result['description'],
|
||||||
|
'img_src': result['artworkUrl100'],
|
||||||
|
'thumbnail': result['screenshotUrls'][0],
|
||||||
|
'publishedDate': parse(result['currentVersionReleaseDate']),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return results
|
|
@ -268,6 +268,11 @@ engines:
|
||||||
shortcut: apkm
|
shortcut: apkm
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|
||||||
|
- name: apple app store
|
||||||
|
engine: apple_app_store
|
||||||
|
shortcut: aps
|
||||||
|
disabled: true
|
||||||
|
|
||||||
# Requires Tor
|
# Requires Tor
|
||||||
- name: ahmia
|
- name: ahmia
|
||||||
engine: ahmia
|
engine: ahmia
|
||||||
|
|
Loading…
Reference in New Issue