/medium-export-image-fill

A script to download (backup locally) all the images accompanying your Medium stories

Primary LanguagePythonThe UnlicenseUnlicense

medium-export-image-fill

Medium allows you to download your story archive, but that archive doesn’t contain your images. Ergo, it is not really an archive.

This script:

  • downloads all the images from your medium articles locally
  • rewrites the archive files so that they point to the local images

(I wrote a similar script for a Twitter archive.)

Why you should have a complete archive of your own data

  • n+1 backups is better than n backups.
  • Your own backup will make it possible to get to your data if you’re offline, or if Medium happens to be down.
  • Someone can hack into your account and delete your stories.
  • You can accidentally delete your stories or images.
  • Someone at Medium can make a mistake and delete them, too.
  • Years or decades from now, Medium might cease to exist.

Instructions

  1. Request your Medium archive from the bottom of https://medium.com/me/settings (Export content).
screen shot 2017-05-08 at 10 46 14
  1. Wait for the email.
  2. Download the archive from the email.
  3. Unpack it somewhere.
  4. Go to the posts/ subdirectory of that archive and run medium-export-image-fill.py there (using terminal/command line).

Note: You can interrupt the script at any time and run it again – it should start where it left off.

screen shot 2017-05-08 at 10 38 14

Details

  • The script downloads the images in highest quality. (Owing to how Medium image server works, those won’t be the exact original image files you uploaded, but they should be in the same resolution. This is particularly important for animated GIFs.)
  • Images are downloaded into images/ subdirectory.
  • The original versions of modified archive files are saved in original_articles/, just in case.

FAQ

Does this work on Windows?

Not sure. I wrote/tested it on Mac OS only. If you run it on Windows (successfully or not), please let me know.

How about Linux?

Some reported it worked for them properly on Ubuntu, FreeBSD, and Debian.

License

This script is in public domain. Run free.

Version history

1.01 (29 April 2018)

  • Make it work with Python 3

1.00 (8 May 2017)

  • Initial release