mirror of https://github.com/CIRCL/lookyloo
chg: Use URL from capture settings file
parent
e3e184a317
commit
474ab91dcd
|
@ -341,6 +341,14 @@ class CapturesIndex(Mapping):
|
||||||
with (capture_dir / 'uuid').open() as f:
|
with (capture_dir / 'uuid').open() as f:
|
||||||
uuid = f.read().strip()
|
uuid = f.read().strip()
|
||||||
|
|
||||||
|
# Get capture settings as they were submitted
|
||||||
|
capture_settings_file = capture_dir / 'capture_settings.json'
|
||||||
|
if capture_settings_file.exists():
|
||||||
|
with capture_settings_file.open() as f:
|
||||||
|
capture_settings = json.load(f)
|
||||||
|
else:
|
||||||
|
capture_settings = {}
|
||||||
|
|
||||||
logger = LookylooCacheLogAdapter(self.logger, {'uuid': uuid})
|
logger = LookylooCacheLogAdapter(self.logger, {'uuid': uuid})
|
||||||
try:
|
try:
|
||||||
tree = load_pickle_tree(capture_dir, capture_dir.stat().st_mtime, logger)
|
tree = load_pickle_tree(capture_dir, capture_dir.stat().st_mtime, logger)
|
||||||
|
@ -375,7 +383,7 @@ class CapturesIndex(Mapping):
|
||||||
har = HarFile(har_files[0], uuid)
|
har = HarFile(har_files[0], uuid)
|
||||||
cache['title'] = har.initial_title
|
cache['title'] = har.initial_title
|
||||||
cache['timestamp'] = har.initial_start_time
|
cache['timestamp'] = har.initial_start_time
|
||||||
cache['url'] = har.root_url
|
cache['url'] = capture_settings['url'] if capture_settings.get('url') else har.root_url
|
||||||
cache['redirects'] = json.dumps(tree.redirects) if tree else ''
|
cache['redirects'] = json.dumps(tree.redirects) if tree else ''
|
||||||
cache['incomplete_redirects'] = 0
|
cache['incomplete_redirects'] = 0
|
||||||
cache['user_agent'] = har.root_user_agent if har.root_user_agent else 'No User Agent.'
|
cache['user_agent'] = har.root_user_agent if har.root_user_agent else 'No User Agent.'
|
||||||
|
|
Loading…
Reference in New Issue