snapdirect/src/pangea/client.py

11 lines
335 B
Python
Raw Normal View History

2026-03-26 10:22:02 +00:00
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