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:
parent
91a35317cc
commit
b4195934c1
1 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue