mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-18 08:26:15 +00:00
chg: [search domain by name] sanityze domain name + show domain
This commit is contained in:
parent
ea12a44836
commit
f4fca05524
2 changed files with 9 additions and 0 deletions
|
@ -103,6 +103,10 @@ def api_get_onion_lookup(domain): # TODO check if object process done ???
|
||||||
meta['titles'].append(t.get_content())
|
meta['titles'].append(t.get_content())
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
|
def api_get_domain_from_url(url):
|
||||||
|
url = url.lower()
|
||||||
|
url_unpack = unpack_url(url)
|
||||||
|
return url_unpack['domain']
|
||||||
|
|
||||||
# # # # # # # #
|
# # # # # # # #
|
||||||
# #
|
# #
|
||||||
|
|
|
@ -587,12 +587,17 @@ def domains_search_name():
|
||||||
|
|
||||||
if not name:
|
if not name:
|
||||||
return create_json_response({'error': 'Mandatory args name not provided'}, 400)
|
return create_json_response({'error': 'Mandatory args name not provided'}, 400)
|
||||||
|
name = crawlers.api_get_domain_from_url(name)
|
||||||
|
|
||||||
domains_types = request.args.getlist('domain_types')
|
domains_types = request.args.getlist('domain_types')
|
||||||
if domains_types:
|
if domains_types:
|
||||||
domains_types = domains_types[0].split(',')
|
domains_types = domains_types[0].split(',')
|
||||||
domains_types = Domains.sanitize_domains_types(domains_types)
|
domains_types = Domains.sanitize_domains_types(domains_types)
|
||||||
|
|
||||||
|
dom = Domains.Domain(name)
|
||||||
|
if dom.exists():
|
||||||
|
return redirect(url_for('crawler_splash.showDomain', domain=dom.get_id()))
|
||||||
|
|
||||||
l_dict_domains = Domains.api_search_domains_by_name(name, domains_types, meta=True, page=page)
|
l_dict_domains = Domains.api_search_domains_by_name(name, domains_types, meta=True, page=page)
|
||||||
return render_template("domains/domains_result_list.html", template_folder='../../',
|
return render_template("domains/domains_result_list.html", template_folder='../../',
|
||||||
l_dict_domains=l_dict_domains, bootstrap_label=bootstrap_label,
|
l_dict_domains=l_dict_domains, bootstrap_label=bootstrap_label,
|
||||||
|
|
Loading…
Add table
Reference in a new issue