From e21b725192014237b2ea3958e3079ebe7a136501 Mon Sep 17 00:00:00 2001 From: irl Date: Thu, 26 Mar 2026 10:22:02 +0000 Subject: [PATCH] feat: pangea image URL handling --- src/pangea/client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/pangea/client.py diff --git a/src/pangea/client.py b/src/pangea/client.py new file mode 100644 index 0000000..902d372 --- /dev/null +++ b/src/pangea/client.py @@ -0,0 +1,10 @@ +import re +from urllib.parse import urlparse, urlunparse + + +def pangea_expanded_image_url(url: str) -> str: + parsed = urlparse(url) + if parsed.netloc.startswith("gdb.") and parsed.path.endswith(".jpg"): + path = re.sub(r"_w[0-9]+_", "_w600_", parsed.path) + return urlunparse(parsed._replace(path=path)) + return url