lookyloo/lookyloo.py
def _get_capture_dir(self, capture_uuid: str, /) -> Path:
        '''Use the cache to get a capture directory from a capture UUID'''
        capture_dir: str = self.redis.hget('lookup_dirs', capture_uuid)  # type: ignore
        if not capture_dir:
            raise MissingUUID(f'Unable to find UUID {capture_uuid} in the cache')
        to_return = Path(capture_dir)
        if not to_return.exists():
            # The capture was removed, remove the UUID
            self.redis.hdel('lookup_dirs', capture_uuid)
            self.logger.warning(f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.')
            raise NoValidHarFile(f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.')
        return to_return
Use the cache to get a capture directory from a capture UUID
Use the cache to get a capture directory from a capture UUID
Use the cache to get a capture directory from a capture UUID
def _get_capture_dir(self, capture_uuid: str, /) -> Path:
        capture_dir: str = self.redis.hget('lookup_dirs', capture_uuid)  
        if not capture_dir:
            raise MissingUUID(f'Unable to find UUID {capture_uuid} in the cache')
        to_return = Path(capture_dir)
        if not to_return.exists():
            self.redis.hdel('lookup_dirs', capture_uuid)
            self.logger.warning(f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.')
            raise NoValidHarFile(f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.')
        return to_return
def _get_capture_dir ( self , capture_uuid : str , / ) -> Path : capture_dir : str = self . redis . hget ( 'lookup_dirs' , capture_uuid ) if not capture_dir : raise MissingUUID ( f'Unable to find UUID {capture_uuid} in the cache' ) to_return = Path ( capture_dir ) if not to_return . exists ( ) : self . redis . hdel ( 'lookup_dirs' , capture_uuid ) self . logger . warning ( f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.' ) raise NoValidHarFile ( f'UUID ({capture_uuid}) linked to a missing directory ({capture_dir}). Removed now.' ) return to_return
Use the cache to get a capture directory from a capture UUID
Use the cache to get a capture directory from a capture UUID
'''Use the cache to get a capture directory from a capture UUID''' # type: ignore # The capture was removed, remove the UUID
self
capture_uuid
str