This commit is contained in:
Manchik
2026-04-17 22:22:40 +03:00
commit c82866b58a
135 changed files with 18493 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
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, {})