Add SteamBot

This commit is contained in:
AlberLC
2024-07-04 04:05:02 +02:00
parent 4e44cdd112
commit 05e53bdc87

View File

@@ -2,7 +2,6 @@ __all__ = ['SteamBot']
import asyncio import asyncio
import base64 import base64
import itertools
import os import os
import random import random
import re import re
@@ -44,8 +43,9 @@ class SteamBot(MultiBot, ABC):
app_ids: Iterable[str], app_ids: Iterable[str],
session: aiohttp.ClientSession session: aiohttp.ClientSession
) -> None: ) -> None:
for ids_batch_batch in itertools.batched( for ids_batch_batch in flanautils.chunks(
itertools.batched(app_ids, constants.STEAM_IDS_BATCH), constants.STEAM_MAX_CONCURRENT_REQUESTS flanautils.chunks(list(app_ids), constants.STEAM_IDS_BATCH),
constants.STEAM_MAX_CONCURRENT_REQUESTS
): ):
gather_results = await asyncio.gather( gather_results = await asyncio.gather(
*(self._get_app_data(session, ids_batch, steam_region.code) for ids_batch in ids_batch_batch) *(self._get_app_data(session, ids_batch, steam_region.code) for ids_batch in ids_batch_batch)