Merge pull request #990 from Gluejar/maintenance2022

fix mdpi
pull/94/head
Eric Hellman 2022-04-05 12:30:16 -04:00 committed by GitHub
commit 6ff4ba8b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -733,13 +733,9 @@ def harvest_mdpi(ebook):
return None, 0
elif 'img.mdpi.org' in ebook.url:
return harvest_generic(ebook)
elif ebook.url.find(u'mdpi.com/books/pdfview/book/') >= 0:
doc = get_soup(ebook.url)
if doc:
obj = doc.find('object', type='application/pdf')
if obj and 'data' in obj:
return make_dl_ebook(obj['data'], ebook)
return None, 0
elif ebook.url.find('mdpi.com/books/pdfview/book/') >= 0:
url = ebook.url.replace('pdfview', 'pdfdownload')
return make_dl_ebook(url, ebook)
return harvest_one_generic(ebook, selector)