Script to archive a Tumblr blog's photos and videos, generating a file structure like so:
tumblr_backup/
├── 1234567890/
│ ├── caption.txt
│ ├── image1.jpg
│ ├── image2.jpg
├── 2345678901/
│ ├── caption.txt
│ ├── video.mp4
Progress is written to progress.json for resuming in case of interruption.
- Node.js 20.6+ for
--env-filesupport - A Tumblr application and OAuth 1.0a tokens
- Access to the private or password-protected blog you want to archive
- Create a Tumblr application at https://www.tumblr.com/oauth/apps.
- Generate credentials for the account that can access the target blog.
- Copy
.env.exampleto.env. - Fill in
.envwith your Tumblr API key, API secret, OAuth token, OAuth token secret, and blog name. - Install dependencies with
npm install.
Set these values in .env:
API_KEY: your Tumblr consumer keyAPI_SECRET: your Tumblr consumer secretOAUTH_TOKEN: your OAuth access tokenOAUTH_TOKEN_SECRET: your OAuth access token secretBLOG_NAME: the blog hostname, for exampleexample.tumblr.com
The script uses OAuth because private and password-protected blogs are not safely handled by an API-key-only flow.
Run:
npm run backupThe script will:
- create
tumblr_backup/if needed - fetch posts from the configured blog in batches
- write each post into its own directory
- save progress to
progress.jsonafter every post so interrupted runs can resume
- Existing downloaded files are skipped.
- YouTube URLs are still downloaded through
@distube/ytdl-core. - If you change
BLOG_NAME, remove or renameprogress.jsonunless you want to reuse the old progress state.