add a .png if the image returns an imgur gallery
This commit is contained in:
parent
f3eb5f4d7c
commit
afcf7d4ab9
@ -45,5 +45,10 @@ def get_image(boards, nsfw=False):
|
|||||||
if response['data']['domain'] not in domains:
|
if response['data']['domain'] not in domains:
|
||||||
# If we dont find an approved domain, re-try the request
|
# If we dont find an approved domain, re-try the request
|
||||||
return get_image(boards, nsfw=nsfw)
|
return get_image(boards, nsfw=nsfw)
|
||||||
|
image_url = response['data']['url'].replace('http://', 'https://')
|
||||||
|
|
||||||
return response['data']['url'].replace('http://', 'https://')
|
if not image_url.endswith('png') or not image_url.endswith('jpg') not image_url.endswith('gif'):
|
||||||
|
image_url = image_url + '.png'
|
||||||
|
|
||||||
|
|
||||||
|
return image_url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user