lookyloo/modules.py
def url_lookup(self, url: str, force: bool=False) -> None:
        '''Lookup an URL on VT
        Note: force means 2 things:
            * (re)scan of the URL
            * re fetch the object from VT even if we already did it today

        Note: the URL will only be sent for scan if autosubmit is set to true in the config
        '''
        if not self.available:
            raise ConfigError('VirusTotal not available, probably no API key')

        url_id = vt.url_id(url)
        url_storage_dir = self.__get_cache_directory(url)
        url_storage_dir.mkdir(parents=True, exist_ok=True)
        vt_file = url_storage_dir / date.today().isoformat()

        scan_requested = False
        if self.autosubmit and force:
            self.client.scan_url(url)
            scan_requested = True

        if not force and vt_file.exists():
            return

        for _ in range(3):
            try:
                url_information = self.client.get_object(f"/urls/{url_id}")
                with vt_file.open('w') as _f:
                    json.dump(url_information.to_dict(), _f)
                break
            except APIError as e:
                if not self.autosubmit:
                    break
                if not scan_requested and e.code == 'NotFoundError':
                    self.client.scan_url(url)
                    scan_requested = True
            time.sleep(5)
Lookup an URL on VT
        Note: force means 2 things:
            * (re)scan of the URL
            * re fetch the object from VT even if we already did it today

        Note: the URL will only be sent for scan if autosubmit is set to true in the config
        
Lookup an URL on VT
Note: force means 2 things:
(re)scan of the URL
re fetch the object from VT even if we already did it today

the URL will only be sent for scan if autosubmit is set to true in the config
Lookup an URL on VT Note : force means 2 things : ( re ) scan of the URL re fetch the object from VT even if we already did it today the URL will only be sent for scan if autosubmit is set to true in the config
def url_lookup(self, url: str, force: bool=False) -> None:
        if not self.available:
            raise ConfigError('VirusTotal not available, probably no API key')
        url_id = vt.url_id(url)
        url_storage_dir = self.__get_cache_directory(url)
        url_storage_dir.mkdir(parents=True, exist_ok=True)
        vt_file = url_storage_dir / date.today().isoformat()
        scan_requested = False
        if self.autosubmit and force:
            self.client.scan_url(url)
            scan_requested = True
        if not force and vt_file.exists():
            return
        for _ in range(3):
            try:
                url_information = self.client.get_object(f"/urls/{url_id}")
                with vt_file.open('w') as _f:
                    json.dump(url_information.to_dict(), _f)
                break
            except APIError as e:
                if not self.autosubmit:
                    break
                if not scan_requested and e.code == 'NotFoundError':
                    self.client.scan_url(url)
                    scan_requested = True
            time.sleep(5)
def url_lookup ( self , url : str , force : bool = False ) -> None : if not self . available : raise ConfigError ( 'VirusTotal not available, probably no API key' ) url_id = vt . url_id ( url ) url_storage_dir = self . __get_cache_directory ( url ) url_storage_dir . mkdir ( parents = True , exist_ok = True ) vt_file = url_storage_dir / date . today ( ) . isoformat ( ) scan_requested = False if self . autosubmit and force : self . client . scan_url ( url ) scan_requested = True if not force and vt_file . exists ( ) : return for _ in range ( 3 ) : try : url_information = self . client . get_object ( f"/urls/{url_id}" ) with vt_file . open ( 'w' ) as _f : json . dump ( url_information . to_dict ( ) , _f ) break except APIError as e : if not self . autosubmit : break if not scan_requested and e . code == 'NotFoundError' : self . client . scan_url ( url ) scan_requested = True time . sleep ( 5 )
Lookup an URL on VT
Note: force means 2 things:
 (re)scan of the URL
 re fetch the object from VT even if we already did it today
Lookup an URL on VT Note : force means 2 things : ( re ) scan of the URL re fetch the object from VT even if we already did it today
'''Lookup an URL on VT
        Note: force means 2 things:
            * (re)scan of the URL
            * re fetch the object from VT even if we already did it today

        Note: the URL will only be sent for scan if autosubmit is set to true in the config
        '''
self
url
str
force
bool