in Acrolinx/AcrolinxURLProvider.py [0:0]
def main(self):
"""Find the download URL"""
username = self.env["username"]
password = self.env["password"]
url = URL.format(username, password)
# Fetch the API data
curl_cmd = self.prepare_curl_cmd()
curl_cmd.extend(["--head", url])
raw_headers = self.download_with_curl(curl_cmd)
header = self.parse_headers(raw_headers)
# Use semantic versioning for the version string, although historically this
# hasn't been anything particularly problematic
acrolinx_url = header.get("http_redirected")
if not acrolinx_url:
self.output(f"Header: {header}")
raise ProcessorError(
"Header did not contain an 'http_redirected' "
"value containing the expected Acrolinx URL. Check your "
"username and password."
)
self.output(f"Found URL: {acrolinx_url}")
self.env["url"] = acrolinx_url