Addshore

It's a blog

Cambridge Analytica, #DeleteFacebook, and adding EXIF data back to your photos

Back in 2016 I wrote a short hacky script for taking HTML from facebook data downloads and adding any data possible back to the image files that also came with the download. I created this as I wanted to grab all of my photos from Facebook and be able to upload them to Google Photos and have Google automatically slot them into the correct place in the timeline. Recent news articles about Cambridge Analytica and harvesting of Facebook data have lead to many people deciding the leave the platform, so I decided to check back with my previous script and see if it still worked, and make it a little easier to use.

Step #1 – Move it to Github

Originally I hadn’t really planned on anyone else using the script, in fact I still don’t really plan on it. But let’s keep code in Github not on aging blog posts.

https://github.com/addshore/facebook-data-image-exif

Step #2 – Docker

The previous version of the script had hard coded paths, and required a user to modify the script, and also download things such as the ExifTool before it would work.

Now the Github repo contains a Dockerfile that can be used that includes the script and all necessary dependencies

If you have Docker installed running the script is now as simple as docker run --rm -it -v //path/to/facebook/export/photos/directory://input facebook-data-image-exif.

Step #3 – Update the script for the new format

As far as I know the format of the facebook data dump downloads is not documented anywhere. The format totally sucks, it would be quite nice to have some JSON included, or anything slightly more structured than HTML.

The new format moved the location of the HTML files for each photos album, but luckily the format of the HTML remained mostly the same (or at least the crappy parsing I created still worked).

The new data download did however do something odd with the image sources. Instead of loading them from the local directory (all of the data you have just downloaded) the srcs would still point to the facebook CDN. Not sure if this was intentional, but it’s rather crappy. I imagine if you delete your whole facebook account these static HTML files will actually stop working. Sounds like someone needs to write a little script for this…

Step #4 – Profit!

Well, no profit, but hopefully some people can make use of this again, especially those currently fleeing facebook.

You can find the “download a copy” of my data link at the bottom of your facebook settings.

I wonder if there are any public figures for the rate of facebook account deactivations and deletions…

3 Comments

  1. Hi, this is great but I have absolutely no programming experience – is there either an easier way or a step by step guide that you could make please? ‘Run the script with the correct things passed’ makes no sense to me and I’ve never used Docker! Thanks!

    • addshore

      March 27, 2018 at 3:54 pm

      I did want to try and make and even easier to use version.
      What OS are you running?
      Perhaps I could rewrite it in something a little better…

      • Either Mac or Windows 7 would be fantastic. I used a website to download all of my FB photos but there are no dates on any of them and even when I found a website that supposedly did download the EXIF data too it didn’t work and 95% of my ‘tagged in’ photos weren’t visible! Thanks

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2018 Addshore

Theme by Anders NorenUp ↑

%d bloggers like this: