Exporting Nixplay Photo Albums Including Image Captions (Titles)
Nixplay makes great image frames. Their web interface also lets you download images back to your computer, for example, to reduce your Nixplay online storage. However, those downloaded archives only contain images (and videos), not the image captions (subtitles, descriptions) you may have entered when uploading an image. They also have weird names. Here's how you can still get to this data. Many thanks to Adrian Wagner for writing the Python code and helping me figure this all out!
The script below renames each downloaded image to start with its abbreviated capture date and time (so the files sort nicely), followed by its Image Caption (if any), followed by its original file name before it was uploaded (so it's easier to find the original in your photo library, for example). So a filename like 551528_bf71b37ee7dc418dab9b48d45377ab77.jpg will be changed to, say, 240303 1718 Sam the dog -- IMG_7994.jpg.
I posted a link to this page on the Nixplay subreddit, so check there for comments or fellow users.
Caveats
- I'm using a Mac, but the procedure should be similar on other operating systems. You'll need some programming/admin experience and use the Terminal.
- If the file contains an EXIF capture date (when the picture was taken), the script uses that to rename the file. If the EXIF capture date is missing (like in many images downloaded from websites), the script uses the "sortDate" in the json file instead. This is when the image was uploaded to Nixplay. It is always set and would give you the same sort order as on your frame, but I found the capture date more valuable (if it exists) to match images to calendar events, for example.
- The script replaces colons and slashes in captions with hyphens so they don't lead to problems when used as part of the filename on a Mac.
- For .mp4 videos, the downloaded album does not contain a still JPG, but the json assumes there is one. The script handles this correctly and again uses the sortDate in these cases.
Instructions
First, you'll need to install some tools:
- Install Homebrew
- Install Python: brew install python
- Install the Python Image Library: brew install pillow
- Save this Python script to a file image_name.py:
import os import json from PIL import Image f = open('1.json') j = json.load(f) for image_element in j.get('photos'): image_old_file_name = image_element.get('s3filename').split('/')[1] image_new_file_name = image_element.get('filename') # If the original was a video, the download does not contain a JPG still, only the MP4 if image_new_file_name[-4:]==".mp4": image_old_file_name = image_old_file_name[:-4] + ".mp4" caption = image_element.get('caption').replace(':','-').replace('/','-') if caption != "": image_new_file_name = caption + ' -- ' + image_new_file_name try: image_file = Image.open(image_old_file_name) image_exif = image_file.getexif() image_date = image_exif[306].replace(':','-').replace('/','-') # image_new_file_name = image_date + ' ' + image_new_file_name # This turns '2016-10-18 17-25-20' into '161018 1725': short_date = image_date[2:4]+image_date[5:7]+image_date[8:13]+image_date[14:16] image_new_file_name = short_date + ' ' + image_new_file_name except: # no EXIF capture date found, use Nixplay's sortDate instead: print("No capture date found in:" + image_old_file_name + " = " + image_new_file_name + " - using sortDate.") image_date = image_element.get('sortDate') # Turn '20210417084351' into '210417 0843': short_date = image_date[2:8]+' '+image_date[8:12] image_new_file_name = short_date + ' ' + image_new_file_name finally: image_file.close() os.rename(image_old_file_name, image_new_file_name)
Now download your album:
- In Safari, under Settings > Advanced, check "Show features for web developers"
- Log into your account at https://nixplay.com
- Under your account menu, navigate to My Nixplay > Photos > Content Library
- Select the album you want to export (we'll do one at a time)
- Select Actions > Download album
- You'll end up with one or more zip files. Unpack all of them and move all images (without subfolders) into a single folder MyPictures.
Now you got your image (and video) data, and we'll move on to retrieve those image captions.
- Select the Safari menu Developer > Show Web Inspector
- Go back to your Album list
- Click the trashcan on the far right of the Web Inspector pane beneath your Nixplay page content to clean the Web Inspector history
- Select your album once more
- The first items in the Web Inspector will be one or more json files depending on how many photos your album contains. Select them one by one and copy the contents into files 1.json, 2.json, etc. These files contain one entry per image/video in your album with the metadata. We are interested in the "caption", original "filename", and "sortDate".
- Put all json files and the Python script into the same MyPictures folder as your images.
- In Terminal, go to that folder and enter python3 image_name.py
- Edit the Python script to refer to 2.json, save it again, and repeat the above command. Repeat this for all json files you have.
- Repeat from step 7 for any other albums you want to download.
Done! All your files should now be renamed as described. Of course, some will be missing a caption (if you didn't enter one back when you uploaded it to Nixplay).