mirror of https://github.com/CIRCL/lookyloo
fix: changed the way things are displayed and fixed errors to make the download working
parent
5a77044530
commit
c589933a40
lookyloo
website/web
templates
|
@ -897,10 +897,12 @@ class Lookyloo():
|
|||
if url.empty_response:
|
||||
if ct.root_hartree.rendered_node == url:
|
||||
# check if a file is available
|
||||
filename, data = self.lookyloo.get_data(self.uuid)
|
||||
filename, data = self.get_data(capture_uuid)
|
||||
if filename:
|
||||
# we have a file to download
|
||||
url.add_feature('has_dl_file', True)
|
||||
url.add_feature('downloaded_filename', filename)
|
||||
url.add_feature('downloaded_filesize', data.getbuffer().nbytes)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ def image(tree_uuid: str):
|
|||
@app.route('/tree/<string:tree_uuid>/data', methods=['GET'])
|
||||
def data(tree_uuid: str):
|
||||
filename, data = lookyloo.get_data(tree_uuid)
|
||||
if len(filename) == 0:
|
||||
if len(filename) != 0:
|
||||
if filetype.guess_mime(data.getvalue()) is None:
|
||||
mime = 'application/octet-stream'
|
||||
else:
|
||||
|
|
|
@ -182,27 +182,30 @@
|
|||
{{ popup_icons(keys_response, url['url_object'], tree_uuid) }}
|
||||
|
||||
{% if url['url_object'].has_dl_file %}
|
||||
<a href="{{ url_for('get_data', tree_uuid=tree_uuid }}">
|
||||
Download file
|
||||
<a href="{{ url_for('data', tree_uuid=tree_uuid)}}">
|
||||
Download {{url['url_object'].downloaded_filename}}
|
||||
</a>
|
||||
|
||||
{% if url['url_object'].rendered_html %}
|
||||
<a href="{{ url_for('urlnode_rendered_content', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
|
||||
Download rendered HTML page
|
||||
</a>
|
||||
</br>
|
||||
<a href="{{ url_for('urlnode_urls_in_rendered_content', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
|
||||
Download URLs in rendered HTML page
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{% if url['url_object'].empty_response %}
|
||||
Empty body.
|
||||
({{sizeof_fmt(url['url_object'].downloaded_filesize)}})
|
||||
ici
|
||||
{% else %}
|
||||
{{ ressource_legitimacy_details(url['legitimacy'], url['url_object'].body.getbuffer().nbytes) }}
|
||||
{% if url['url_object'].rendered_html %}
|
||||
<a href="{{ url_for('urlnode_rendered_content', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
|
||||
Download rendered HTML page
|
||||
</a>
|
||||
</br>
|
||||
<a href="{{ url_for('urlnode_urls_in_rendered_content', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
|
||||
Download URLs in rendered HTML page
|
||||
</a>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if url['url_object'].empty_response %}
|
||||
Empty body.
|
||||
{% else %}
|
||||
{{ ressource_legitimacy_details(url['legitimacy'], url['url_object'].body.getbuffer().nbytes) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{%endif%}
|
||||
</div>
|
||||
|
||||
|
||||
{% if url['known_content'] %}
|
||||
{{ known_content_details(url['known_content']) }}
|
||||
|
|
Loading…
Reference in New Issue