From 6eb2aec15a8b4dc0ac2bc4da20ed561f037a6392 Mon Sep 17 00:00:00 2001 From: blank X Date: Thu, 3 Sep 2020 12:03:15 +0700 Subject: [PATCH] Fix bug --- redditbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redditbot.py b/redditbot.py index 2b72491..de2d7a3 100644 --- a/redditbot.py +++ b/redditbot.py @@ -234,8 +234,9 @@ async def main(): mimetype = await _get_file_mimetype(filename) if mimetype.startswith('image') and preview and preview['enabled']: preview = preview['images'][0] - urls = [preview['source']['url']] - urls.extend(reversed(i['url'] for i in preview['resolutions'])) + urls = [i['url'] for i in preview['resolutions']] + urls.append(preview['source']['url']) + urls.reverse() for url in urls: if os.path.getsize(filename) < 10000000: break