diff --git a/src/widgets.py b/src/widgets.py index 42005a1..75d4dd8 100644 --- a/src/widgets.py +++ b/src/widgets.py @@ -502,9 +502,14 @@ class PostItem(Gtk.ListBoxRow): return scaled_img def get_oembed_thumb(self, oembed): - url = oembed.thumbnail_url - old_width = oembed.thumbnail_width - old_height = oembed.thumbnail_height + if 'thumbnail_url' in oembed: + url = oembed.thumbnail_url + old_width = oembed.thumbnail_width + old_height = oembed.thumbnail_height + else: + url = oembed.url + old_width = oembed.width + old_height = oembed.height ratio = old_width / old_height new_height = 256 / ratio r = requests.get(url)