curl -fsSL "https://hydrological.org/api/v1/datasets/tdx-hydro-geoglows/links.txt?bbox=-75,-20,-50,5" \
| xargs -n 1 curl -fLO
import os
import requests
listing = requests.get("https://hydrological.org/api/v1/datasets/tdx-hydro-geoglows/links.txt?bbox=-75,-20,-50,5")
listing.raise_for_status()
if listing.headers.get("X-Links-Incomplete"):
print("Not every file is listed:", listing.headers["X-Links-Incomplete"])
for url in listing.text.split():
name = url.rsplit("/", 1)[-1]
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(name + ".part", "wb") as f:
for chunk in r.iter_content(1 << 20):
f.write(chunk)
os.replace(name + ".part", name)
const res = await fetch("https://hydrological.org/api/v1/datasets/tdx-hydro-geoglows/links?bbox=-75,-20,-50,5");
const { groups } = await res.json();
for (const g of groups) g.links.forEach(l => console.log(l.url));