Skip to content

Commit

Permalink
chg: [search domain by name] sanityze domain name + show domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Dec 9, 2024
1 parent ea12a44 commit f4fca05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/lib/crawlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def api_get_onion_lookup(domain): # TODO check if object process done ???
meta['titles'].append(t.get_content())
return meta

def api_get_domain_from_url(url):
url = url.lower()
url_unpack = unpack_url(url)
return url_unpack['domain']

# # # # # # # #
# #
Expand Down
5 changes: 5 additions & 0 deletions var/www/blueprints/crawler_splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,17 @@ def domains_search_name():

if not name:
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')
if domains_types:
domains_types = domains_types[0].split(',')
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)
return render_template("domains/domains_result_list.html", template_folder='../../',
l_dict_domains=l_dict_domains, bootstrap_label=bootstrap_label,
Expand Down

0 comments on commit f4fca05

Please sign in to comment.