Davide Cassenti

Davide Cassenti

Gentleman and Scholar Software Engineer

Posts Tagged ‘python’

Upload to Flickr with Python

Saturday, July 19, 2008

Today I have found an interesting python script that allows you to upload photos from a local directory to Flickr; I decided to modify it and post here my modifications. The original script can be found here.

The script is pretty easy to use: it searches image files in a given directory, check an history file in order to know if the photo has been already uploaded, and if it is not the case, upload it on flickr; it is possible to specify if the photo needs to be public, private or shared, which tags assign to it and which name/description add.

The only thing I didn’t like was the way used by the script to know if the file was been already uploaded: simply, only the file name was used; I decided to change the script in order to allow to rename or move the photos inside the same directory (and sub directories) that uploadr.py is checking: to do so, I use the md5 digest of the image file as key in the history file. Another little thing I have added, is a lock file: if the script is already running it will exit with an error message on the screen.

…no, it is not finished: click here to read the rest of the post!