Skip to content

Commit

Permalink
new: get uuids by category via API
Browse files Browse the repository at this point in the history
  • Loading branch information
adrima01 committed Jul 23, 2024
1 parent ca07ea5 commit 0bdda99
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pylookyloo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,18 @@ def get_recent_captures(self, timestamp: str | datetime | float | None=None) ->
r = self.session.get(url)
return r.json()

def get_categories_captures(self, category: str | None=None) -> list[str] | dict[str, list[str]] | None:
'''Get uuids for a specific category or all categorized uuids if category is None
:param category: The category according to which the uuids are to be returned
'''
if not category:
url = urljoin(self.root_url, str(PurePosixPath('json', 'categories')))
else:
url = urljoin(self.root_url, str(PurePosixPath('json', 'categories', category)))
r = self.session.get(url)
return r.json()

@overload
def upload_capture(self, *, quiet: Literal[True],
listing: bool = False,
Expand Down

0 comments on commit 0bdda99

Please sign in to comment.