[`youtube`] Don't fail if some items in the response have missing attrs.

This commit is contained in:
Fabio Manganiello 2023-11-05 22:12:21 +01:00
parent daa93f5994
commit 6411688e65
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 4 additions and 4 deletions

View File

@ -57,10 +57,10 @@ class YoutubePlugin(Plugin):
results = [
{
"url": "https://www.youtube.com" + item["url"],
"title": item["title"],
"image": item["thumbnail"],
"duration": item["duration"],
"description": item["shortDescription"],
"title": item.get("title", '[No title]'),
"image": item.get("thumbnail"),
"duration": item.get("duration", 0),
"description": item.get("shortDescription"),
}
for item in rs.json().get("items", [])
]