Embeds: Save author_name and provider_name if set

pull/226/head
Karl Hobley 2014-05-02 11:54:20 +01:00
rodzic a771e6adc4
commit db5559b688
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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'),