From eab076ed197b3b0ba8c8d115df3e4d43f15c89c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 26 Jul 2024 12:24:56 +0200 Subject: [PATCH] new: remove capture Implements https://github.com/Lookyloo/lookyloo/pull/929 --- pylookyloo/api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pylookyloo/api.py b/pylookyloo/api.py index 4a62fe8..24044e4 100644 --- a/pylookyloo/api.py +++ b/pylookyloo/api.py @@ -330,6 +330,13 @@ def hide_capture(self, tree_uuid: str) -> dict[str, str]: r = self.session.post(urljoin(self.root_url, str(PurePosixPath('admin', tree_uuid, 'hide')))) return r.json() + def remove_capture(self, tree_uuid: str) -> dict[str, str]: + '''Remove a capture, it will be impossible to get it by UUID (requires an authenticated user, use init_apikey first)''' + if not self.apikey: + raise AuthError('You need to initialize the apikey to use this method (see init_apikey)') + r = self.session.post(urljoin(self.root_url, str(PurePosixPath('admin', tree_uuid, 'remove')))) + return r.json() + def get_redirects(self, capture_uuid: str) -> dict[str, Any]: '''Returns the initial redirects.