add elgar

pull/94/head
eric 2020-08-10 20:03:37 -04:00
parent 6377a98409
commit fd7f35f6c3
1 changed files with 8 additions and 0 deletions

View File

@ -91,6 +91,7 @@ def harvesters(ebook):
yield ebook.provider == 'Ledizioni', harvest_badhead yield ebook.provider == 'Ledizioni', harvest_badhead
yield ebook.provider == 'muse.jhu.edu', harvest_muse yield ebook.provider == 'muse.jhu.edu', harvest_muse
yield ebook.provider == 'IOS Press Ebooks', harvest_ios yield ebook.provider == 'IOS Press Ebooks', harvest_ios
yield ebook.provider == 'elgaronline.com', harvest_elgar
def ebf_if_harvested(url): def ebf_if_harvested(url):
onlines = EbookFile.objects.filter(source=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) logger.warning('couldn\'t get soup for %s', ebook.url)
return None, 0 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)