Created
February 7, 2021 06:47
-
-
Save jpillora/702ded79330043e38e8202b5c73835e5 to your computer and use it in GitHub Desktop.
Download iCloud link from Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Does this work for shared icloud folders?
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
Running
gives me
Edit:
So I needed to change the
\
to a|
like this:but now
echo $URL
gives me