66def response(resp):
67 results = []
68
69 json = resp.json()
70
71 for result in json['data']:
72
73 results.append(
74 {
75 'template': 'images.html',
76 'title': '',
77 'content': f"{result['category']} / {result['purity']}",
78 'url': result['url'],
79 'img_src': result['path'],
80 'thumbnail_src': result['thumbs']['small'],
81 'resolution': result['resolution'].replace('x', ' x '),
82 'publishedDate': datetime.strptime(result['created_at'], '%Y-%m-%d %H:%M:%S'),
83 'img_format': result['file_type'],
84 'filesize': humanize_bytes(result['file_size']),
85 }
86 )
87
88 return results