Update getbib

This commit is contained in:
emrakyz 2022-10-07 20:08:58 +00:00 committed by GitHub
parent 32624bce64
commit 89e7d08b2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
if [ -f "$1" ]; then
# Try to get DOI from pdfinfo or pdftotext output.
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1 | sed 's/ //g') ||
doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*\s*\S*[0-9A-Za-z]" -m 1 ||
exit 1
else
doi="$1"