Have you ever thought of backing up your icloud photos to your own disk?

Well, i haven’t found tools to do this job yet. I spent few hours to see how ICloud photos works via web interfaces. It’s pretty simple, it use some APIs to pull your photos library information.

Can you use a script instead of via Web? yes, you can , you need to get the cookies and paste it to your script.

It’s interesting that once you have the cookie you can query from any place – Apple does not check the IP , it just check the cookies only.  So, if you have the cookies, can you run it forever without any expiration date? No, for security reason, that cookies is only available for a period only – might be 5 or 10 minutes.

So, in order for your script to grab all your photos database, you need a fast connection to complete all queries before the cookies expires.

All the photos you see are store in some Apple storage servers, when you query the photos, the API will give you a direct link to get the photos. You don’t need special cookies to download the photos, but the link will expire in about 15 or 30 minutes.

So, in order to download all your photos library , you need a very fast connection to complete 2 tasks: pull the database and download the photos.

I was able to write a script to complete this task do these 2 tasks within 15 minutes. I have about 10K photos , about 77GB .

If you are interested in this script, ping me.