diff options
author | Dominik George <nik@velocitux.com> | 2022-06-28 00:00:08 +0200 |
---|---|---|
committer | Dominik George <nik@velocitux.com> | 2022-06-28 00:00:08 +0200 |
commit | 380bc90c70395b90cacd5ef30f3535aa987f4b66 (patch) | |
tree | c9e28d2cc337f825af8c748673173335d524155e | |
parent | 4f7de777b7bcf9b8fc15b203457b6c952be44769 (diff) | |
download | impressive-display-380bc90c70395b90cacd5ef30f3535aa987f4b66.tar.gz impressive-display-380bc90c70395b90cacd5ef30f3535aa987f4b66.tar.bz2 impressive-display-380bc90c70395b90cacd5ef30f3535aa987f4b66.zip |
Fix URLs with query strings
-rwxr-xr-x | bin/impressive-display | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/impressive-display b/bin/impressive-display index 66412f3..9b8c7ae 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -160,7 +160,7 @@ else fi function uri_is_supported { - check_uri=$1 + check_uri=${1%%\?*} if ! echo "$check_uri" | grep -q -E "^(file://|http://|https://).*"; then $OUTPUT "ERROR: PDF_URI format not supported: $check_uri" @@ -325,9 +325,10 @@ function is_sleep_hour { } function download_pdffile { - local pdf_uri=$1 + local pdf_uri_orig=$1 local recursing=${2:-no} + local pdf_uri=${pdf_uri_orig%%\?*} local pdf_filename=$(basename "$pdf_uri") local pdf_stripped=${pdf_filename%.gz} local pdf_extension=${pdf_stripped##*.} @@ -344,11 +345,11 @@ function download_pdffile { fi if [ "x$LOG_TO_SYSLOG" = "xyes" ]; then - if ! curl $NETRCFILE "$pdf_uri" 1> "$DOWNLOADED_FILE" 2>/dev/null; then + if ! curl $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE" 2>/dev/null; then $OUTPUT "The curl tool failed in retrieving PDF file. Run this tool interactively to debug problems." fi else - curl $NETRCFILE "$pdf_uri" 1> "$DOWNLOADED_FILE" + curl $NETRCFILE "$pdf_uri_orig" 1> "$DOWNLOADED_FILE" fi # is the file gzipped? |