Migrated from Substack, how do I pull the images to Ghost local storage

Used the totally amazing migrate substack CLI to pull the content.

Images are still linked to Substack’s AWS storage.

Any ideas / Best practices on how to automagically pull these images to Ghost local storage?


I think this sample code should be useful as a starting point:

Basically, you identify images in your post’s HTML, upload those images via the API, rewrite the HTML to point at the new images, send the post HTML to Ghost.

If you’re going to loop over a bunch of posts, you’ll probably want to throttle the speed a bit (or wait for each post to be handled before moving to the next one) to avoid timeouts, too many handles & connections open, etc.

Closed platforms. “These people never give up?” Kpt’n Kilgore, Apocalypse Now.

Al’rite: pull html, find the image url’s, pull image, upload over api, re-write HTML, stash html back into post. Tx!

Could be worse! At least it’s all online. Try migrating newsletters from SendFox!

1 Like