From f557a48ac4e6cb7183f72b13671bed6b044c0250 Mon Sep 17 00:00:00 2001 From: "Emmanuel C. Jemeni" Date: Mon, 9 Oct 2023 09:01:47 +0100 Subject: [PATCH] Update image.py Fiction.Live seems to have changed how they host images --- ebook/image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ebook/image.py b/ebook/image.py index 1e84ad6..b89b59b 100644 --- a/ebook/image.py +++ b/ebook/image.py @@ -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(',')