add lastYear_or_1000games

This commit is contained in:
vrubelroman 2025-11-16 12:48:23 +03:00
parent 7232a8d304
commit 3226d4c162
3 changed files with 92 additions and 1 deletions

View file

@ -77,11 +77,13 @@ class LichessAPI:
logger.error(f"Error getting week stats: {e}")
return None
async def get_games_period(self, username: str, since: int, until: int) -> Optional[Dict[str, Any]]:
async def get_games_period(self, username: str, since: int, until: int, rated_only: Optional[bool] = None) -> Optional[Dict[str, Any]]:
"""Get games for a specific period"""
try:
url = f"{self.stats_base_url}/games/{username}/period"
params = {"since": since, "until": until}
if rated_only is not None:
params["rated_only"] = "true" if rated_only else "false"
logger.info(f"🔍 LichessAPI.get_games_period: URL={url}, params={params}")
async with aiohttp.ClientSession() as session: