From 2c66dcd1b60a930a3774a51b47eddf5eaab09cfc Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 7 Apr 2020 13:04:44 -0400 Subject: [PATCH] Use the HTTPS version of Scholars Portal books Signed-off-by: Dan Scott --- tools/ebooks/prep_ebook_records.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/ebooks/prep_ebook_records.py b/tools/ebooks/prep_ebook_records.py index 220a1a272d..7786453e2f 100755 --- a/tools/ebooks/prep_ebook_records.py +++ b/tools/ebooks/prep_ebook_records.py @@ -1289,6 +1289,12 @@ def get_subfields(field, data, platform): subs = [] url = field["u"] + # Let's get to HTTPS whenever possible + if url.startswith("http://books.scholarsportal.info"): + url = url.replace( + "http://books.scholarsportal.info", "https://books.scholarsportal.info" + ) + # Is this an ebrary URL? ebrary = False if url.find(".ebrary.com") > -1: @@ -1305,9 +1311,9 @@ def get_subfields(field, data, platform): subs.extend(["u", url]) else: if data["ebrary_code"] == "ocls" and re.search(r"ra.ocls.ca", field["u"]): - subs.extend(["u", field["u"]]) + subs.extend(["u", url]) else: - subs.extend(["u", data["proxy"] + field["u"]]) + subs.extend(["u", data["proxy"] + url]) # Check for a $z as the first 856; in Springer records, at least, this # indicates a multi-volume set that requires keeping the $z around -- 2.11.0