From 1c73f26e2dc92beee08b98045c0f5e510cef65e7 Mon Sep 17 00:00:00 2001 From: blank X Date: Mon, 21 Mar 2022 11:07:53 +0700 Subject: [PATCH] Fix Imgur bug https://redd.it/ti6wi5 --- redditbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redditbot.py b/redditbot.py index 1b2a314..8a47b91 100644 --- a/redditbot.py +++ b/redditbot.py @@ -362,7 +362,7 @@ async def main(): if domain == 'imgur.com' or domain.endswith('.imgur.com'): parsed[1] = 'i.imgur.com' if parsed[2].startswith('/a/') or parsed[2].startswith('/gallery/'): - albumid = os.path.split(parsed[2].rstrip('/'))[1] + albumid = os.path.splitext(os.path.split(parsed[2].rstrip('/'))[1])[0] async with session.get(f'https://imgur.com/ajaxalbums/getimages/{albumid}/hit.json?all=true') as resp: apidata = (await resp.json())['data'] if apidata['count'] == 1: