From 83291978d537327801853994b72a5e6ba3e9fa92 Mon Sep 17 00:00:00 2001 From: vasilky3 Date: Tue, 12 Mar 2024 01:14:50 +0300 Subject: [PATCH] handle timeout in search --- src/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client.py b/src/client.py index 521f93a..9f35f61 100644 --- a/src/client.py +++ b/src/client.py @@ -147,8 +147,11 @@ async def search_by_indexer(self, indexer, t, title, year, season=None, ep=None, params["q"] += " S{:0>2}".format(season) if bool(ep): params["q"] += "E{:0>2}".format(ep) - - root = await self.send_request(self.query_by_indexer.format(indexer=indexer.id), params) + try: + root = await self.send_request(self.query_by_indexer.format(indexer=indexer.id), params) + except TimeoutError: + log.warn(f"Timeout while search {indexer.name}") + return {}, indexer if not root: return {}, indexer