Fix Imgur bug

https://redd.it/ti6wi5
This commit is contained in:
blank X 2022-03-21 11:07:53 +07:00
parent 40470bc6d7
commit 1c73f26e2d
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 1 additions and 1 deletions

View File

@ -362,7 +362,7 @@ async def main():
if domain == 'imgur.com' or domain.endswith('.imgur.com'): if domain == 'imgur.com' or domain.endswith('.imgur.com'):
parsed[1] = 'i.imgur.com' parsed[1] = 'i.imgur.com'
if parsed[2].startswith('/a/') or parsed[2].startswith('/gallery/'): 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: async with session.get(f'https://imgur.com/ajaxalbums/getimages/{albumid}/hit.json?all=true') as resp:
apidata = (await resp.json())['data'] apidata = (await resp.json())['data']
if apidata['count'] == 1: if apidata['count'] == 1: