Makes a full backup of a SmugMug account (images and videos are supported).
The program loops over the images and videos of the user's albums and saves them in the destination folder, replicating the SmugMug paths.
You can run the app multiple times, all exising files will be skipped if their sizes match.
Note on multiple runs
The app skips existing files but doesn't check their sizes. So if you interrupt a running execution of the program while it's saving a file, it will exist but will also probably be corrupted.
I'd like to manage this situation, but in the meanwhile when you interrupt an execution, take notes of the last files shown in the console and check if they're valid, deleting them otherwise.
Releases for multiple systems can be found in the project releases page
SmugMug requires OAuth1 authentication. OAuth1 requires 4 values: API key and secret you can get from SmugMug registering the app (they're generic for the app) and user token and secret each user must obtain (they authorize the app to access the user's data).
Apply for an API key: https://api.smugmug.com/api/developer/apply
You'll get an API key and secret, save them as environment variables:
export API_KEY="<key>"
export API_SECRET="<secret>"
The get_tokens
folder contains a script from SmugMug to obtain OAuth1 tokens.
You need to create a config.json
file with your API key/secret using example.json
as example.
Then, using a python3 environment, run run-console.sh
.
The script will show you a link you must open with your browser. SmugMug will give you a 6-digit
code you must then paste to the console prompt.
That's the last step, the console will show the user token and secret. Export them:
export USER_TOKEN="<token>"
export USER_SECRET="<secret>"
To build and install the program:
git clone https://github.com/tommyblue/smugmug-backup.git
make build
More make
commands are available, run make help
to get help
With all the four environment variables set, you can run the program with:
./smugmug-backup -user <username> -destination <path of downloads> -ignorefetcherrors
The username can be found in the first part of the url in your SmugMug's homepage.
In my case the url is https://tommyblue.smugmug.com/ and the username is tommyblue
.
Local path to save SmugMug pictures and videos. If not empty, only new or changed files will be downloaded.
Ignore Smugmug API fetch errors and go on with the sync. If not provided, exits at the first error.
To increase the logging, export a DEBUG=1
environment variable:
DEBUG=1 ./smugmug-backup -user <username> -destination <path of downloads>
OAuth1 signature has been heavily inspired by https://github.com/gomodule/oauth1
The code in the get_tokens
folder is a copy of https://gist.github.com/smugkarl/10046914
If you find a bug or want to suggest something, please open an issue.
If you want to contribute to this project, fork the repo and open a pull-request. Contributing is more than welcome 😄