@@ -70,11 +70,21 @@ def response(resp):
7070
7171 try:
7272 metadata = loads(result)
73− img_format = "{0} {1}x{2}".format(metadata['ity'], str(metadata['ow']), str(metadata['oh']))
74− source = "{0} ({1})".format(metadata['st'], metadata['isu'])
73+
74+ img_format = metadata.get('ity', '')
75+ img_width = metadata.get('ow', '')
76+ img_height = metadata.get('oh', '')
77+ if img_width and img_height:
78+ img_format += " {0}x{1}".format(img_width, img_height)
79+
80+ source = metadata.get('st', '')
81+ source_url = metadata.get('isu', '')
82+ if source_url:
83+ source += " ({0})".format(source_url)
84+
7585 results.append({'url': metadata['ru'],
7686 'title': metadata['pt'],
77− 'content': metadata['s'],
87+ 'content': metadata.get('s', ''),
7888 'source': source,
7989 'img_format': img_format,
8090 'thumbnail_src': metadata['tu'],