handle records without downloads

pull/91/head
eric 2018-06-15 10:34:23 -04:00
parent 6094de0e44
commit bade8e7f4d
2 changed files with 16 additions and 0 deletions

View File

@ -393,6 +393,20 @@ def add_by_doab(doab_id, record=None):
url_to_provider(dl_url) if dl_url else None,
**metadata
)
else:
if 'format' in metadata:
del metadata['format']
edition = load_doab_edition(
title,
doab_id,
'',
'',
license,
language,
isbns,
None,
**metadata
)
return edition
except IdDoesNotExistError:
return None

View File

@ -103,6 +103,8 @@ FRONTIERSIN = re.compile(r'frontiersin.org/books/[^/]+/(\d+)')
def online_to_download(url):
urls = []
if not url:
return urls
if url.find(u'mdpi.com/books/pdfview/book/') >= 0:
doc = get_soup(url)
if doc: