semsevens236 downloadsArchive remote URLs from markdown locally and serve from local cache on render.
Archive remote URLs referenced in your markdown to a local cache, and transparently serve the cache when the note is rendered. Defends your vault against link rot without rewriting any markdown.
Notes that quote articles, tweets, or research often embed remote images, video, or audio:


When the original host disappears (the WeChat account is deleted, the tweet is removed, the CDN expires the URL), every embed in your vault silently breaks. The note still reads, but the visual context is gone.
For every remote <img>, <video>, <audio> it encounters:
<mdDir>/_archive/<sha1>.<ext> — one folder per markdown's directory, notes stay self-contained.<centralPath>/<bucket>/<sha1>.<ext> — a single shared folder at a vault-relative path, bucketed by the first 2 hex chars of the SHA1 (256 buckets). True global dedup; cache survives moving the markdown.src to the local archive at display time — in both Reading mode and Live Preview..md never changes. If you later view the file outside Obsidian, share it, or this plugin is uninstalled, the remote URL still works as a fallback.The archive is content-addressed by URL hash, so the same URL appearing in multiple notes is stored once (sibling mode dedups per folder; central mode dedups across the whole vault).
┌──────────────────────────┐
│  │ ← markdown stays as-is
└──────────┬───────────────┘
│
▼
┌──────────────────────────────────────┐
│ Scanner extracts URLs │
│ Policy decides which to archive │ ← domain rules + media extension
│ Downloader fetches with retry │
│ File saved at _archive/<sha1>.<ext> │
└──────────────────────────────────────┘
│
▼
┌──────────────────────────────────────┐
│ At render time: │
│ resolve(url) → vault path → swap │ ← Reading + Live Preview
│ if local present, else leave remote │
└──────────────────────────────────────┘
The plugin archives in three ways:
Scan vault & archive remote resources walks every markdown file in scope.| Setting | Default | Purpose |
|---|---|---|
| Archive mode | Sibling |
Sibling = per-note folder; Central = one shared vault-relative folder with hash bucketing. |
| Archive directory name (sibling) | _archive |
Subfolder name (sibling to each .md) that holds cached files. |
| Central archive path (central) | _archive |
Vault-relative folder that holds all cached files, bucketed by hash prefix. |
| Auto-archive on file modify | on | If off, only the manual scan command triggers downloads. |
| Included paths | (empty = whole vault) | Newline-separated vault paths to operate on. Example: raw/wechat. |
Built-in rules in policies.ts:
| Domain | Action | Notes |
|---|---|---|
mmbiz.qpic.cn, res.wx.qq.com, mmbiz.qlogo.cn |
archive | WeChat — requires Referer: https://mp.weixin.qq.com/ |
pbs.twimg.com |
archive | Twitter / X images |
video.twimg.com |
skip | Twitter videos are large and the CDN is long-term stable |
youtube.com, youtu.be, vimeo.com |
skip | stream-only |
| (anything else) | archive only if URL has a media extension (.jpg/.png/.mp4/…) |
prevents accidentally fetching HTML page URLs |
[0, 1s, 3s] backoff.http:// URLs are automatically upgraded to https:// (Obsidian's requestUrl does not accept cleartext HTTP).<archive>/.failed.jsonl with URL, error, and timestamp.While awaiting Community Plugins approval:
BRAT: Add a beta plugin for testing.semsevens/obsidian-archive-redirect.Download main.js and manifest.json from the latest release into <vault>/.obsidian/plugins/archive-redirect/, then enable.
Archive Redirect never modifies your markdown. The URL in your .md stays
remote; the local cache is swapped in only at render time, via the rendered
<img> / <video> / <audio> element's src attribute.
This means third-party "remove orphaned attachments" plugins cannot see that
the local cache is in use — they scan for markdown ![]() or [[wikilink]]
references, not HTML src attributes. They will flag every file in _archive/
as orphaned and may delete the entire folder, including content whose source
URLs are already dead and unrecoverable.
Known dangerous combinations (verified via GitHub issues — 450-image vault wipes have happened in the wild):
oz-clear-unused-images — repeated reports of mass deletion of HTML-referenced images.Local Images Plus "Remove orphaned attachments" / "(Plugin folder)" commands.Mitigations Archive Redirect ships with:
.archive-redirect-managed is written into every archive folder
with a warning. Some cleanup plugins respect such markers; most do not.Your responsibility: either uninstall the cleanup tool while Archive Redirect is active, or configure it to exclude your archive folder.
The plugin is designed to behave well across multiple devices that share the same vault via iCloud Drive / Obsidian Sync / Dropbox / Syncthing. URLs are hashed to deterministic paths, settings live in <vault>/.obsidian/plugins/archive-redirect/data.json (which syncs), and the local cache itself is stored inside the vault — so a file fetched on one device naturally appears on all of them after sync.
That said, real-world sync introduces a handful of caveats worth knowing:
vault.adapter.exists(path) which sees the metadata and treats the file as present — but the rendered <img> then shows a brief blank while iCloud streams the actual bytes in. Mitigation: in the Finder, right-click _archive/ → Download Now, or disable "Optimize Mac Storage" entirely..icloud-conflict-* siblings. No data is lost, but you get a mess to clean up. Run migration on one device, wait for sync to finish, then verify on the other._archive/ folders that A has emptied. B's notes will silently fall back to remote URLs and stay slower. Update Archive Redirect on every device before switching to central mode.centralArchivePath on one device and immediately start using the new path on another (before data.json has propagated), the two devices will write to different folders. The new Reconcile stale central archive folders command (v0.5.1+) detects this by scanning for the .archive-redirect-managed marker file outside the current central path and offers to merge._archive/ (or your central path) to Always Keep Downloaded in Finder..archive-redirect-managed, run Reconcile stale central archive folders from the command palette — it will move the orphan into the current central path.crypto module; mobile support requires swapping to Web Crypto (which is async) and is planned for a later release.src after Obsidian renders the element. It does not interfere with other plugins (e.g. auto-embed) that work on page URLs.MIT