From e4d1ed852f660a448b5465d00ca1f44e181d3b7f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 10 Feb 2020 16:32:13 +0100 Subject: [PATCH] Fix page numbers --- media/scraper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/media/scraper.py b/media/scraper.py index 2aaf670..045a8b0 100644 --- a/media/scraper.py +++ b/media/scraper.py @@ -86,6 +86,8 @@ class BedetequeScraper: search_nb_pages = re.search(regex_nb_of_pages, content) if search_nb_pages and search_nb_pages.group(1).isnumeric(): data['number_of_pages'] = search_nb_pages.group(1) + elif 'number_of_pages' not in data: + data['number_of_pages'] = 0 # Get author and illustrator author = re.search(regex_author, content)