Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Do not download OAdoi URL if not requested, consider non-PDF OA URL
Browse files Browse the repository at this point in the history
  • Loading branch information
nemobis committed Oct 4, 2019
1 parent 0da3ff0 commit bb95d7c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doi-doai-openaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def main(argv=None):
pdf = get_oadoi(doi)
if pdf:
print(doi)
get_doi_download(doi, pdf)
if args['--download']:
get_doi_download(doi, pdf)
else:
if get_doai_oa(doi):
print(doi)
Expand Down Expand Up @@ -243,7 +244,10 @@ def get_oadoi(doi):
return False

if oadoi:
return oadoi['url_for_pdf']
if oadoi['url_for_pdf']:
return oadoi['url_for_pdf']
else:
return oadoi['url']
else:
return None

Expand Down

0 comments on commit bb95d7c

Please sign in to comment.