Download Flickr photos in your Jekyll posts

code • November 4, 2018

I’ve stored all my photos for this blog on Flickr. For a while now I have kicked around the idea of finding a new home for them. One big reason being that a lot of the images are bloated and I would like to create my own system to control them. And now that Flickr is changing its storage policies, it’s time to move my boxes of photos out of their basement.

I wrote a module that will scan your Jekyll posts, download all your Flickr photos, and update the photos paths with the new relative ones.

And, guess what reader, it will download the original Flickr photo.

Under the hood

  1. The script starts by authenticating your Flickr account. This is especially necessary if you have private photos.
  2. Next, it’ll find all your posts.
  3. For each post, the script reads the post to find Flickr URLs.
  4. If the script finds photos, it’ll download each photo and then updates the photo paths in your post for the new relative ones.

You can find the code on GitHub with instructions on how to use the module on your own site.

🔮 Curious about how I’m hosting my photos now? Continue on to Storing assets in an AWS bucket.

Keep reading code