Is there a way from the CLI on MacOS or Linux to download all the photos from a shared photo album (an album shared with me from another iCloud user, that shows up the shared tab on iOS or under the shared heading on MacOS) in Photos.app? I would like to setup a cron job to sync the photos locally so I can add them to the rest of our backuped data.
Take a look at iCloud Photos Downloader it is a command line interface for iCloud Photos based on Python.
To install, you can type
pip install icloudpd should the requirement of Python 2.7.x or 3.6.x be met. If you use Python 2.6.x will fail.
If you require Python, I reccomend using Homebrew Package Manager, which is known for being easy to install command line tools. If you’re going to install Python with this method, type
brew install python
You can also install Python using the package found on their website.
If you’re looking for more info about the package and command usages / 2 Factor Authentication scenarios, take a look at the Repository’s Readme.