From d951ee4b83a9e67c3296f2ef0a3dcb6f7570f0f0 Mon Sep 17 00:00:00 2001 From: Dave Mogle Date: Mon, 17 Aug 2020 10:31:07 -0400 Subject: [PATCH] Prefer kepub (#1439) Only offer kepub download URL over Kobo sync API when available --- cps/kobo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cps/kobo.py b/cps/kobo.py index a6dfc3f6..8d97785e 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -344,7 +344,9 @@ def get_seriesindex(book): def get_metadata(book): download_urls = [] - for book_data in book.data: + kepub = [data for data in book.data if data.format == 'KEPUB'] + + for book_data in kepub if len(kepub) > 0 else book.data: if book_data.format not in KOBO_FORMATS: continue for kobo_format in KOBO_FORMATS[book_data.format]: