Skip to content

Commit

Permalink
handle timeout in search
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilky3 committed Apr 14, 2024
1 parent 85e71ce commit 8329197
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8329197

Please sign in to comment.