Skip to content

Instantly share code, notes, and snippets.

@jpillora
Created February 7, 2021 06:47
Show Gist options
  • Save jpillora/702ded79330043e38e8202b5c73835e5 to your computer and use it in GitHub Desktop.
Save jpillora/702ded79330043e38e8202b5c73835e5 to your computer and use it in GitHub Desktop.
Download iCloud link from Terminal
#!/bin/bash
# given "https://www.icloud.com/iclouddrive/<ID>#<Filename>
ID="...."
URL=$(curl 'https://ckdatabasews.icloud.com/database/1/com.apple.cloudkit/production/public/records/resolve' \
--data-raw '{"shortGUIDs":[{"value":"$ID"}]}' --compressed \
jq -r '.results[0].rootRecord.fields.fileContent.value.downloadURL')
curl "$URL" -o myfile.ext
@pa-0
Copy link

pa-0 commented Apr 2, 2024

Does this work for shared icloud folders?

@NicosKaralis
Copy link

Is it possible to upload and/or delete with this method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment