diff --git a/twscrape/accounts_pool.py b/twscrape/accounts_pool.py index ac176fd..24d46b1 100644 --- a/twscrape/accounts_pool.py +++ b/twscrape/accounts_pool.py @@ -121,6 +121,13 @@ async def get_all(self): rs = await fetchall(self._db_file, qs) return [Account.from_rs(x) for x in rs] + async def get_account(self, username: str): + qs = "SELECT * FROM accounts WHERE username = :username" + rs = await fetchone(self._db_file, qs, {"username": username}) + if not rs: + return None + return Account.from_rs(rs) + async def save(self, account: Account): data = account.to_rs() cols = list(data.keys())