1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 16:33:16 +01:00

Update image.py

Fiction.Live seems to have changed how they host images
This commit is contained in:
Emmanuel C. Jemeni 2023-10-09 09:01:47 +01:00 committed by David Lynch
parent 4e9ad1ed7e
commit f557a48ac4

View file

@ -133,6 +133,9 @@ def get_image_from_url(
if url.startswith("https://www.filepicker.io/api/"):
logger.warning("Filepicker.io image detected, converting to Fiction.live image. This might fail.")
url = f"https://cdn3.fiction.live/fp/{url.split('/')[-1]}?&quality=95"
elif url.startswith("https://cdn3.fiction.live/images/") or url.startswith("https://ddx5i92cqts4o.cloudfront.net/images/"):
logger.warning("Converting url to cdn6. This might fail.")
url = f"https://cdn6.fiction.live/file/fictionlive/images/{url.split('/images/')[-1]}"
elif url.startswith("data:image") and 'base64' in url:
logger.info("Base64 image detected")
head, base64data = url.split(',')