mirror of https://github.com/CIRCL/lookyloo
new: get all the ressources hashes in API
parent
7ad9aa7bbc
commit
7b32454f9a
|
@ -65,6 +65,18 @@ class CaptureStatusQuery(Resource):
|
|||
return {'status_code': lookyloo.get_capture_status(capture_uuid)}
|
||||
|
||||
|
||||
@api.route('/json/<string:capture_uuid>/hashes')
|
||||
@api.doc(description='Get all the hashes of all the resources of a capture',
|
||||
params={'capture_uuid': 'The UUID of the capture'})
|
||||
class CaptureHashes(Resource):
|
||||
def get(self, capture_uuid: str):
|
||||
cache = lookyloo.capture_cache(capture_uuid)
|
||||
if not cache:
|
||||
return {'error': 'UUID missing in cache, try again later.'}
|
||||
to_return: Dict[str, Any] = {'response': {'hashes': list(lookyloo.get_hashes(capture_uuid))}}
|
||||
return to_return
|
||||
|
||||
|
||||
@api.route('/json/<string:capture_uuid>/redirects')
|
||||
@api.doc(description='Get all the redirects of a capture',
|
||||
params={'capture_uuid': 'The UUID of the capture'})
|
||||
|
|
Loading…
Reference in New Issue