From fd7f35f6c3dcd3fdb6b6d0c2794973a26f34a83b Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 10 Aug 2020 20:03:37 -0400 Subject: [PATCH] add elgar --- core/loaders/harvest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/loaders/harvest.py b/core/loaders/harvest.py index 96063d0f..93b4a327 100644 --- a/core/loaders/harvest.py +++ b/core/loaders/harvest.py @@ -91,6 +91,7 @@ def harvesters(ebook): yield ebook.provider == 'Ledizioni', harvest_badhead yield ebook.provider == 'muse.jhu.edu', harvest_muse yield ebook.provider == 'IOS Press Ebooks', harvest_ios + yield ebook.provider == 'elgaronline.com', harvest_elgar def ebf_if_harvested(url): onlines = EbookFile.objects.filter(source=url) @@ -618,3 +619,10 @@ def harvest_ios(ebook): logger.warning('couldn\'t get soup for %s', ebook.url) return None, 0 + +def harvest_elgar(ebook): + def chap_selector(doc): + return doc.select('#toc li.pdfLink a[href]') + return harvest_stapled_generic(ebook, None, chap_selector) + +