Files
Steam-Panel/pysteamauth/base/storage.py
T
2026-04-17 22:22:40 +03:00

22 lines
572 B
Python

from typing import (
Dict,
Mapping,
)
from pysteamauth.abstract import CookieStorageAbstract
class BaseCookieStorage(CookieStorageAbstract):
def __init__(self):
self.cookies: Dict[str, Mapping[str, Mapping[str, str]]] = {}
async def set(self, login: str, cookies: Mapping[str, Mapping[str, str]]) -> None:
self.cookies[login] = cookies
async def get(self, login: str, domain: str) -> Mapping[str, str]:
cookies = self.cookies.get(login)
if not cookies:
return {}
return cookies.get(domain, {})