1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2025-01-03 05:25:28 +00:00

HDBits provider: handle KeyError (common exception)

This commit is contained in:
Vitiko 2024-07-14 19:07:19 -04:00
parent 91a35317cc
commit b4195934c1

View file

@ -96,7 +96,12 @@ class HDBitsProvider(Provider):
"https://hdbits.org/api/torrents", json={**self._def_params, **lookup} "https://hdbits.org/api/torrents", json={**self._def_params, **lookup}
) )
response.raise_for_status() response.raise_for_status()
ids = [item["id"] for item in response.json()["data"]]
try:
ids = [item["id"] for item in response.json()["data"]]
except KeyError:
logger.debug("No data found")
return []
subtitles = [] subtitles = []
for torrent_id in ids: for torrent_id in ids: