From 1f57305e11215d4813a89a28e8d1c868abfd9bce Mon Sep 17 00:00:00 2001 From: Alex Raubach Date: Mon, 10 Sep 2018 23:13:26 -0400 Subject: [PATCH] Download cover image if cover_url is in json --- ebook/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ebook/__init__.py b/ebook/__init__.py index 4a25801..dbb125b 100644 --- a/ebook/__init__.py +++ b/ebook/__init__.py @@ -107,7 +107,9 @@ def generate_epub(story, cover_options={}, output_filename=None): # The cover is static, and the only change comes from the image which we generate html = [('Cover', 'cover.html', cover_template)] - if story.cover_url: + if cover_options["cover_url"]: + image = make_cover_from_url(cover_options["cover_url"], story.title, story.author) + elif story.cover_url: image = make_cover_from_url(story.cover_url, story.title, story.author) else: image = make_cover(story.title, story.author, **cover_options)