Skip to content

Instantly share code, notes, and snippets.

@gecko655
Created August 3, 2026 15:46
Show Gist options
  • Select an option

  • Save gecko655/a6d42b542deac33fc979ef9f331b3dec to your computer and use it in GitHub Desktop.

Select an option

Save gecko655/a6d42b542deac33fc979ef9f331b3dec to your computer and use it in GitHub Desktop.
auth=xxxxxxxx
host=https://api.xxxx.com
for page in $(seq 1 $(curl -s -H "Authorization: $auth" "${host}/v1/items?page=1" | jq -r '.data.total_page')); do
for wm_card_id in $(curl -s -H "Authorization: $auth" "${host}/v1/items?page=${page}" | jq -r '.data.items[].wm_card_id'); do
dl_url=$(curl -X POST -s -H "Authorization: $auth" "${host}/v1/users/cards/${wm_card_id}/download-url" | jq -r '.data.download_url')
curl -s "$dl_url" -o "${wm_card_id}.zip"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment