diff --git a/wagtail/wagtailembeds/embeds.py b/wagtail/wagtailembeds/embeds.py index 5b3f59fc22..d66c5ebcc1 100644 --- a/wagtail/wagtailembeds/embeds.py +++ b/wagtail/wagtailembeds/embeds.py @@ -77,7 +77,9 @@ def embedly(url, max_width=None, key=None): # Return embed as a dict return { - 'title': oembed['title'], + 'title': oembed['title'] if 'title' in oembed else '', + 'author_name': oembed['author_name'] if 'author_name' in oembed else '', + 'provider_name': oembed['provider_name'] if 'provider_name' in oembed else '', 'type': oembed['type'], 'thumbnail_url': oembed.get('thumbnail_url'), 'width': oembed.get('width'), @@ -114,7 +116,9 @@ def oembed(url, max_width=None): # Return embed as a dict return { - 'title': oembed['title'], + 'title': oembed['title'] if 'title' in oembed else '', + 'author_name': oembed['author_name'] if 'author_name' in oembed else '', + 'provider_name': oembed['provider_name'] if 'provider_name' in oembed else '', 'type': oembed['type'], 'thumbnail_url': oembed.get('thumbnail_url'), 'width': oembed.get('width'),