"""Obtain the latest ImageMagick version from official repositories."""

import sys
from urllib.request import urlopen


BINARIES_URL = "https://download.imagemagick.org/ImageMagick/download/binaries/"

content = urlopen(BINARIES_URL).read().decode("utf-8")

for line in reversed(content.split("<td>")):
    if 'static.exe">ImageMagick' in line:
        filename = line.split('"')[1]
        sys.stdout.write(f"{BINARIES_URL}{filename}\n")
        break

@@ -142,17 +142,8 @@
 s://
-download.
 imag
@@ -158,28 +158,15 @@
 org/
-ImageMagick/download
+archive
 /bin

Fix Windows CI (#1841)