From 247a4a26b0b0c7c666d17f2e8fdf9c956c72f7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 22 Mar 2018 17:22:19 +0100 Subject: [PATCH] chg: Change cookie name, update legend, remove old pickled trees Fix #18 --- lookyloo/__init__.py | 7 +++++-- lookyloo/templates/tree.html | 29 +++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/lookyloo/__init__.py b/lookyloo/__init__.py index 0267916..d0497dc 100644 --- a/lookyloo/__init__.py +++ b/lookyloo/__init__.py @@ -30,6 +30,7 @@ if app.secret_key == 'changeme': Bootstrap(app) app.config['BOOTSTRAP_SERVE_LOCAL'] = True +app.config['SESSION_COOKIE_NAME'] = 'lookyloo' app.debug = True HAR_DIR = 'scraped' @@ -46,8 +47,7 @@ def session_management(): def load_tree(report_dir): if session.get('tree'): - # TODO delete file - pass + os.unlink(session.get('tree')) session.clear() har_files = sorted(glob(os.path.join(HAR_DIR, report_dir, '*.har'))) ct = CrawledTree(har_files) @@ -80,10 +80,13 @@ def scrape(): harfile = item['har'] png = base64.b64decode(item['png']) child_frames = item['childFrames'] + html = item['html'] with open(os.path.join(dirpath, '{0:0{width}}.har'.format(i, width=width)), 'w') as f: json.dump(harfile, f) with open(os.path.join(dirpath, '{0:0{width}}.png'.format(i, width=width)), 'wb') as f: f.write(png) + with open(os.path.join(dirpath, '{0:0{width}}.html'.format(i, width=width)), 'w') as f: + f.write(html) with open(os.path.join(dirpath, '{0:0{width}}.frames.json'.format(i, width=width)), 'w') as f: json.dump(child_frames, f) return tree(0) diff --git a/lookyloo/templates/tree.html b/lookyloo/templates/tree.html index b2a9972..4232deb 100644 --- a/lookyloo/templates/tree.html +++ b/lookyloo/templates/tree.html @@ -27,8 +27,33 @@ Redirect Redirect
- Cookie in URL Cookie in URL
+ Font Font
+ + HTML HTML
+ + JSON JSON
+ + CSS CSS
+ + EXE EXE
+ + Image Image
+ + Video Video
+ + iFrame iFrame
+ + Content type not set/unknown Content type not set/unknown
+
Tree details

Root URL: {{ root_url }}