HDBits provider: handle KeyError (common exception)

pull/2581/head v1.4.4-beta.23
Vitiko 4 months ago
parent 91a35317cc
commit b4195934c1

@ -96,7 +96,12 @@ class HDBitsProvider(Provider):
"https://hdbits.org/api/torrents", json={**self._def_params, **lookup}
)
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 = []
for torrent_id in ids:

Loading…
Cancel
Save