tommyblue / smugmug-backup

Makes a full backup of a SmugMug account
MIT License
86 stars 15 forks source link

SmugMug Source files don't download (RAW/DNG) #61

Open cobetts opened 3 days ago

cobetts commented 3 days ago

Hi! I was able to download the JPG files super quick! However, anything that's uploaded with SmugMug Source did not pull the raw down with the JPG as well. I don't see anything in the documentation mentioning Source, so I'm not sure if this is supported. I've attached the [store] portion of my config below.

[store] destination = "/Users/***/Documents/smugmug-full-backup" write_csv = true concurrent_albums = 5 concurrent_downloads = 10

tommyblue commented 3 days ago

hi @cobetts , I didn't even know what source is 😅 I don't have that service, thus I don't have access to the APIs. If you want to investigate the APIs and send me accurate documentation, I can try to implement something

cobetts commented 1 day ago

@tommyblue Fair haha. Source is their additional add-on that stores RAW files alongside JPGs. I searched through documentation and didn't find a specific reference, but their support team was able to provide details on how the RAW files can be accessed and documentation. Does this help?

You can actually access RAW files in SmugMug Source via the Components endpoint: https://api.smugmug.com/api/v2/library/asset/IMAGEKEY!components

For files in SmugMug Source, that should allow you access to the RAW file via the DownloadUrl element and if we created a JPG preview for it, also that JPG.

tommyblue commented 1 day ago

@cobetts it could, in fact. The problem is that my components don't include any raw, I need help from your side:

tommyblue commented 1 day ago

To clarify the goal, this is the component I see (under Response in the JSON):

"Component": [
            {
                "ComponentType": "i",
                "ComponentKey": "KKKKKKKK",
                "DownloadUrl": "https://photos.smugmug.com/photos/XXXXXXX/0/YYYYYYYYY/D/XXXXXXX-D.jpg",
                "Extension": "JPG",
                "FileName": "photo.jpg",
                "FileSize": 10000,
                "MD5": "1234567890",
                "Url": "https://photos.smugmug.com/photos/XXXXXXX/0/ZZZZZZZ/O/KKKKKKK.jpg",
                "Uri": "/api/v2/library/asset/KKKKKKKK/component/i/KKKKKKKK",
                "UriDescription": "Representation of a single component of an asset",
                "Uris": {
                    "Image": {
                        "Uri": "/api/v2/image/KKKKKKKK-0",
                        "Locator": "Image",
                        "LocatorType": "Object",
                        "UriDescription": "Image by key",
                        "EndpointType": "Image"
                    }
                }
            }
        ],

I need to see the same structure for a RAW file, to understand if I can extract and download the file

cobetts commented 11 hours ago

Hi @tommyblue thank you for the clear walkthrough! It looks like for images with RAW files there are two components stored separately. One for the JPG and one for the RAW. I have found the JSON you requested and added it below:

 "Component": [
            {
                "ComponentType": "i",
                "ComponentKey": "XXXXX",
                "DownloadUrl": "https://photos.smugmug.com/photos/XXXXX.jpg",
                "Extension": "JPG",
                "FileName": "XXXXX.jpg",
                "FileSize": 13355583,
                "MD5": "XXXXX",
                "Url": "https://photos.smugmug.com/photos/XXXXX.jpg",
                "Uri": "/api/v2/library/asset/XXXXX/component/i/XXXXX",
                "UriDescription": "Representation of a single component of an asset",
                "Uris": {
                    "Image": {
                        "Uri": "/api/v2/image/XXXXX",
                        "Locator": "Image",
                        "LocatorType": "Object",
                        "UriDescription": "Image by key",
                        "EndpointType": "Image"
                    }
                }
            },
            {
                "ComponentType": "svi",
                "ComponentKey": "XXXXX",
                "DownloadUrl": "https://www.smugmug.com/smugvault/XXXXX",
                "Extension": "RAF",
                "FileName": "XXXXX.raf",
                "FileSize": 40556112,
                "MD5": "XXXXX",
                "Url": "https://www.smugmug.com/smugvault/XXXXX",
                "Uri": "/api/v2/library/asset/MV7ZL7c/component/svi/XXXXX",
                "UriDescription": "Representation of a single component of an asset"
            }
        ],