From c9f116458ef5a94d7b680bd383336f2c8625dfc9 Mon Sep 17 00:00:00 2001 From: datawhores Date: Tue, 20 Aug 2024 17:31:00 -0500 Subject: [PATCH] fix leaky bucket use --- ofscraper/classes/sessionmanager/download.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ofscraper/classes/sessionmanager/download.py b/ofscraper/classes/sessionmanager/download.py index a25b42095..9a4ef71d9 100644 --- a/ofscraper/classes/sessionmanager/download.py +++ b/ofscraper/classes/sessionmanager/download.py @@ -1,6 +1,5 @@ import contextlib import time -from aiolimiter import AsyncLimiter import asyncio import ofscraper.classes.sessionmanager.ofsession as ofsessionmanager import ofscraper.classes.sessionmanager.sessionmanager as sessionManager @@ -15,6 +14,7 @@ SIGN, TOO_MANY, ) +from ofscraper.classes.sessionmanager.leaky import LeakyBucket import ofscraper.utils.settings as settings @@ -51,7 +51,7 @@ def __init__( wait_min = wait_min or constants.getattr("OF_MIN_WAIT_API") wait_max = wait_max or constants.getattr("OF_MAX_WAIT_API") log = log or common_globals.log - self.leaky_bucket = AsyncLimiter(settings.get_download_limit(), 1) + self.leaky_bucket = LeakyBucket(settings.get_download_limit(), 1) super().__init__( sem_count=sem_count, retries=retries,