commit
3f99ea1104
|
@ -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
|
||||
|
@ -411,8 +425,8 @@ def load_doab_oai(from_year=None, limit=100000):
|
|||
if from_year:
|
||||
from_ = datetime.datetime(year=from_year, month=1, day=1)
|
||||
else:
|
||||
# last 45 days
|
||||
from_ = datetime.datetime.now() - datetime.timedelta(days=45)
|
||||
# last 15 days
|
||||
from_ = datetime.datetime.now() - datetime.timedelta(days=15)
|
||||
doab_ids = []
|
||||
for record in doab_client.listRecords(metadataPrefix='oai_dc', from_=from_):
|
||||
if not record[1]:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue