mirror of https://github.com/CIRCL/lookyloo
fix: Cleanup prints, improve archiver.
parent
8978f1b798
commit
9497060028
|
@ -122,6 +122,7 @@ class Archiver(AbstractManager):
|
||||||
for capture_path in captures:
|
for capture_path in captures:
|
||||||
p.delete(str(capture_path))
|
p.delete(str(capture_path))
|
||||||
(capture_path / 'tree.pickle').unlink(missing_ok=True)
|
(capture_path / 'tree.pickle').unlink(missing_ok=True)
|
||||||
|
(capture_path / 'tree.pickle.gz').unlink(missing_ok=True)
|
||||||
capture_path.rename(dest_dir / capture_path.name)
|
capture_path.rename(dest_dir / capture_path.name)
|
||||||
p.execute()
|
p.execute()
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ def load_pickle_tree(capture_dir: Path, last_mod_time: int) -> CrawledTree:
|
||||||
with gzip.open(pickle_file_gz, 'rb') as _pg:
|
with gzip.open(pickle_file_gz, 'rb') as _pg:
|
||||||
tree = pickle.load(_pg)
|
tree = pickle.load(_pg)
|
||||||
except pickle.UnpicklingError as e:
|
except pickle.UnpicklingError as e:
|
||||||
print(e)
|
|
||||||
remove_pickle_tree(capture_dir)
|
remove_pickle_tree(capture_dir)
|
||||||
|
|
||||||
if tree:
|
if tree:
|
||||||
|
@ -110,10 +109,8 @@ def load_pickle_tree(capture_dir: Path, last_mod_time: int) -> CrawledTree:
|
||||||
# The capture was moved.
|
# The capture was moved.
|
||||||
remove_pickle_tree(capture_dir)
|
remove_pickle_tree(capture_dir)
|
||||||
except EOFError as e:
|
except EOFError as e:
|
||||||
print(e)
|
|
||||||
remove_pickle_tree(capture_dir)
|
remove_pickle_tree(capture_dir)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
|
||||||
remove_pickle_tree(capture_dir)
|
remove_pickle_tree(capture_dir)
|
||||||
|
|
||||||
if list(capture_dir.rglob('*.har')) or list(capture_dir.rglob('*.har.gz')):
|
if list(capture_dir.rglob('*.har')) or list(capture_dir.rglob('*.har.gz')):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is automatically @generated by Poetry and should not be changed by hand.
|
# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand.
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aiohttp"
|
name = "aiohttp"
|
||||||
|
@ -648,14 +648,14 @@ tests = ["asttokens", "littleutils", "pytest", "rich"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "filelock"
|
name = "filelock"
|
||||||
version = "3.9.1"
|
version = "3.10.0"
|
||||||
description = "A platform independent file lock."
|
description = "A platform independent file lock."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
files = [
|
files = [
|
||||||
{file = "filelock-3.9.1-py3-none-any.whl", hash = "sha256:4427cdda14a1c68e264845142842d6de2d0fa2c15ba31571a3d9c9a1ec9d191c"},
|
{file = "filelock-3.10.0-py3-none-any.whl", hash = "sha256:e90b34656470756edf8b19656785c5fea73afa1953f3e1b0d645cef11cab3182"},
|
||||||
{file = "filelock-3.9.1.tar.gz", hash = "sha256:e393782f76abea324dee598d2ea145b857a20df0e0ee4f80fcf35e72a341d2c7"},
|
{file = "filelock-3.10.0.tar.gz", hash = "sha256:3199fd0d3faea8b911be52b663dfccceb84c95949dd13179aa21436d1a79c4ce"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
|
|
Loading…
Reference in New Issue