From d5ea663590ab70799ff21304abb283d12ae05466 Mon Sep 17 00:00:00 2001 From: blank X Date: Fri, 4 Sep 2020 21:18:43 +0700 Subject: [PATCH] Add extra case for Imgur --- redditbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redditbot.py b/redditbot.py index 4104780..70101e7 100644 --- a/redditbot.py +++ b/redditbot.py @@ -208,7 +208,7 @@ async def main(): preview = getattr(random_post, 'preview', None) if domain.endswith('imgur.com'): parsed[1] = 'i.imgur.com' - if parsed[2].startswith('/a/'): + if parsed[2].startswith('/a/') or not splitted[1]: albumid = os.path.split(parsed[2])[1] async with session.get(f'https://imgur.com/ajaxalbums/getimages/{albumid}/hit.json?all=true') as resp: apidata = (await resp.json())['data']