https://github.com/movestill/smuggo
A SmugMug client written in Go.
https://github.com/movestill/smuggo
api client photos smugmug
Last synced: 12 months ago
JSON representation
A SmugMug client written in Go.
- Host: GitHub
- URL: https://github.com/movestill/smuggo
- Owner: movestill
- License: other
- Created: 2015-12-03T02:45:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T04:12:14.000Z (over 5 years ago)
- Last Synced: 2023-09-08T14:54:23.839Z (almost 3 years ago)
- Topics: api, client, photos, smugmug
- Language: Go
- Homepage:
- Size: 77.1 KB
- Stars: 7
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: license.txt
Awesome Lists containing this project
README
# smuggo
## Introduction
smuggo is a personal project that integrates SmugMug into my photo workflow.
I use it as the last step in my workflow. Once I "develop" a photo in
CaptureOne, CaptureOne "opens" the photo in smuggo. During the "open" step,
smuggo uploads the photo to my private SmugMug staging gallery.
This gives me a quick offsite backup of the developed image that's at least
large enough to make a small print or incorporate into a video should disaster
strike at home.
smuggo is also an excuse to get back into the Go language. I last touched it
in December 2014, so it was almost like starting from zero, again.
## Usage
### Get a SmugMug API Key (do this first!)
The first step is to get your own API key from SmugMug. Go to this page to
request a key: https://api.smugmug.com/api/developer/apply
You must be a SmugMug customer to get an key, but that's
probably a safe assumption if you want to use smuggo. After getting your key,
enter your key into smuggo by using the `apikey` command.
```shell
smuggo apikey
```
### Authorization (do this second!)
smuggo **must be authorized** before it can do anything with your SmugMug
account. Authorize it by typing:
```shell
smuggo auth
```
This command will immediately open your browser to SmugMug. You may have to
login with your SmugMug user name and password. After doing so, SmugMug will
give you a six digit code to enter into smuggo. This code will allow smuggo
to authorize itself.
If you ever want to **revoke** smuggo's authorization, login to your SmugMug
account and go to Account Settings. Click on Privacy and click the revoke
button next to smuggo.
### Getting Album Keys
Before you can upload into an album, you need to know its key. smuggo has a
command that lists all your albums and their associated keys.
```shell
smuggo albums
```
smuggo will output a list of your albums in alphabetical order. If you have a
large number of albums, you may want to pipe the output to grep or some other
utility to find the one you want. SmugMug also transfers a large amount of
data when listing albums. This command may take some time to complete if you
have a large number of albums.
If you have a large number of albums, finding the right album alphabetically
isn't the most efficient. smuggo supports SmugMug's album search capability.
SmugMug searches both the title and description for search terms that you
supply.
```shell
smuggo search ...
```
smuggo will list the first 15 results and then ask if you wish to list more
results.
### Uploading Files
My normal use case is to upload a single file since CaptureOne "opens" each
photo as it finishes processing.
Basic syntax:
```shell
smuggo upload
```
Here's a concrete example:
```shell
smuggo upload 5Jbd2q awesome_photo.jpg
```
However, there are times where I may want to upload multiple files outside of
my normal CaptureOne workflow. For those times, smuggo supports uploading
files in parallel.
```shell
smuggo multiupload . . .
```
The `num parallel uploads` parameter specifies how many simultaneous
uploads you'd like to do. The right number depends on your system and your
upload bandwidth. Here's an actual example that specifies up to 4
simultaneous uploads of two JPEG files and all the GIFs in the current
directory:
```shell
smuggo multiupload 4 5Jbd2q awesome_photo1.jpg awesome_photo2.jpg *.gif
```
### Preventing Duplicate Uploads to an Album
smuggo can prevent duplicate image uploads to an album _if_ you run the `images`
command for the album, beforehand. This isn't done automatically because my
workflow uploads images, one at a time, as they are generated by CaptureOne.
So, if you have an album that already has images or you also add images using
something other than smuggo, you'll need to run the `images` command to get
the current contents of your album. smuggo saves the images that it uploads to
SmugMug, but it doesn't know anything about images added to your album by other
means.
```shell
# Get images already uploaded to the album and save them to smuggo's database.
smuggo images
```
If you try to upload a duplicate image, smuggo will tell you that the image
already exists and give you the filename of the image or images already in the
album that are duplicates.
If you _want_ to allow duplicates, use the flag `-allowDupes` to tell smuggo
duplicates are allowed:
```shell
# Single file.
smuggo -allowDupes upload
# Multiple files.
smuggo -allowDupes multiupload . . .
```
## Building from Source
Download and install Go v1.16.x. Be sure to set your GOPATH environment
variable as described in the Go installation instructions.
Get the dependencies:
```shell
cd core
go mod download
```
Build:
```shell
cd core
make
```
## License
smuggo is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
## Credits
Thanks to Gary Burd for his OAuth library. I'm not sure if I would have
continued work on this project if I had to write the OAuth code, myself.
Also thanks to skratchdot for the open library that I use to conveniently open
SmugMug in the browser for authorization.
Of course, thanks to SmugMug for providing an API for building our own
tools!