feat: pangea image URL handling
This commit is contained in:
parent
fdc7c3c3b4
commit
e21b725192
1 changed files with 10 additions and 0 deletions
10
src/pangea/client.py
Normal file
10
src/pangea/client.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue