tommyblue / smugmug-backup

Makes a full backup of a SmugMug account

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug if file has no filename

buchhla opened this issue · comments

First, this script is great!

I do think I found a minor error though. It looks like I have a few photos in a gallery that have no filename. Not sure how that is even possible, but it looks like your download dies at that point.

Getting https://photos.smugmug.com/Album/SubAlbum/Assorted-Pictures/i-jJM8qjW/0/c1ea69b1/D/x-D.jpg
2019/12/16 08:38:33 open /home/e/SmugMug//Album/SubAlbum/Assorted-Pictures/: is a directory

If I look at Album/SubAlbum/Assorted-Pictures/i-jJM8qjW from the website under organize, there are five photos in that album that have no filename. So maybe that is an exception to look for?

FYI, I did just verify that removing the photos with no filename makes the issue go away, so that is the workaround for now.

@buchhla thanks for reporting this.
I'm wondering what's the best option here. We could skip files with missing names, but I don't really like it because it means a photo isn't saved. Giving it a random name isn't good either, because a new photo will be saved every time.
So probably the best option is to find another unique string to use instead of the name. I'll take a look at the JSON response, but I think I can find something to use if the filename is empty

@buchhla would you mind testing the empty_filename branch? It should fix https://github.com/tommyblue/smugmug-backup/tree/empty_filename

Merged to master