feat: pangea image URL handling

This commit is contained in:
Iain Learmonth 2026-03-26 10:22:02 +00:00
parent fdc7c3c3b4
commit e21b725192

10
src/pangea/client.py Normal file
View file

@ -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