diff --git a/tyora/session.py b/tyora/session.py index 29ac205..c31aa8f 100644 --- a/tyora/session.py +++ b/tyora/session.py @@ -10,6 +10,7 @@ from .utils import find_link, parse_form +HTTP_TIMEOUT = 10 logger = logging.getLogger(__name__) try: @@ -33,6 +34,10 @@ def __init__( {"User-Agent": user_agent(os.path.basename(sys.argv[0]), __version__)} ) + def request(self, *args, **kwargs): + kwargs.setdefault("timeout", HTTP_TIMEOUT) + return super(MoocfiCsesSession, self).request(*args, **kwargs) + @property def is_logged_in(self) -> bool: res = self.get(urljoin(self.base_url, "list"))