diff --git a/basethon/json_async_converter.py b/basethon/json_async_converter.py index 88b1507..6ef7963 100644 --- a/basethon/json_async_converter.py +++ b/basethon/json_async_converter.py @@ -11,7 +11,7 @@ from basethon.async_base_session import AsyncBaseSession from basethon.proxy_parser import ProxyParser -class JsonAsyncConverter(AsyncBaseSession): +class JsonAsyncConverter: def __init__( self, base_dir: Path, @@ -28,7 +28,7 @@ class JsonAsyncConverter(AsyncBaseSession): proxy: прокси для подключения формат: http:ip:port:user:pswd json_write: записывать в json файл информацию о string_session + proxy? """ - super().__init__(base_dir, errors_dir, banned_dir) + self.__base_session = AsyncBaseSession(base_dir, errors_dir, banned_dir) self.__api_id, self.__api_hash = 2040, "b18441a1ff607e10a989891a5462e627" self.__json_write = json_write self.__proxy = ProxyParser(proxy).asdict_thon @@ -71,7 +71,7 @@ class JsonAsyncConverter(AsyncBaseSession): string_session: str proxy: dict """ - async for item, json_file, json_data in self: + async for item, json_file, json_data in self.__base_session: _item, _json_file, _json_data = await self._main(item, json_file, json_data) yield _item, _json_file, _json_data @@ -82,7 +82,7 @@ class JsonAsyncConverter(AsyncBaseSession): """ count = 0 self.__json_write = True - async for item, json_file, json_data in self: + async for item, json_file, json_data in self.__base_session: await self._main(item, json_file, json_data) count += 1 return count diff --git a/basethon/json_converter.py b/basethon/json_converter.py index f71649d..acc0ec3 100644 --- a/basethon/json_converter.py +++ b/basethon/json_converter.py @@ -11,7 +11,7 @@ from .base_session import BaseSession from .proxy_parser import ProxyParser -class JsonConverter(BaseSession): +class JsonConverter: def __init__( self, base_dir: Path, @@ -28,7 +28,7 @@ class JsonConverter(BaseSession): proxy: прокси для подключения формат: http:ip:port:user:pswd json_write: записывать в json файл информацию о string_session + proxy? """ - super().__init__(base_dir, errors_dir, banned_dir) + self.__base_session = BaseSession(base_dir, errors_dir, banned_dir) self.__api_id, self.__api_hash = 2040, "b18441a1ff607e10a989891a5462e627" self.__json_write = json_write self.__proxy = ProxyParser(proxy).asdict_thon @@ -82,7 +82,7 @@ class JsonConverter(BaseSession): """ count = 0 self.__json_write = True - for item, json_file, json_data in self: + for item, json_file, json_data in self.__base_session: self._main(item, json_file, json_data) count += 1 return count