forked from platypush/platypush
[youtube
] Don't fail if some items in the response have missing attrs.
This commit is contained in:
parent
daa93f5994
commit
6411688e65
1 changed files with 4 additions and 4 deletions
|
@ -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", [])
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue