'Search records with ZoomEye dorks.
param: dork
ex: country:cn
access https://www.zoomeye.org/search/dorks for more details.
param: page
total page(s) number
param: resource
set a search resource type, ex: [web, host]
param: facet
ex: [app, device]
A comma-separated list of properties to get summary information'

def dork_search(self, dork, page=0, resource='web', facet=['ip']):

    result = []
    if isinstance(facet, (tuple, list)):
        facet = ','.join(facet)
    zoomeye_api = self.zoomeye_dork_api.format(resource)
    headers = {'Authorization': ('JWT    %s' % self.token)}
    params = {'query': dork, 'page': (page + 1), 'facet': facet}
    resp = requests.get(zoomeye_api, params=params, headers=headers)
    if (resp and (resp.status_code == 200) and ('matches' in resp.json())):
        matches = resp.json().get('matches')
        result = matches
    return result
