Skip to content

External Assets and CDN

Harsimran Sidhu edited this page Jul 15, 2026 · 1 revision

External Assets and CDN

By default, Website Downloader mirrors resources from the same origin as your start URL and leaves third-party references pointing at the live web. That keeps mirrors small and avoids pulling in the entire internet.

When a site depends on external resources — CDN-hosted CSS/JS, web fonts, image hosts — you can opt in to downloading them.

Enable external downloads

website-downloader --url https://example.com --download-external-assets

This downloads external static assets and rewrites the allowed ones to local paths.

Restrict to specific domains (recommended)

website-downloader --url https://example.com \
  --external-domains cdn.example.com fonts.gstatic.com
  • --external-domains is an allowlist. Only assets from the listed domains (and their subdomains) are downloaded.
  • Passing --external-domains implies --download-external-assets, so you don't need both.
  • This is cleaner and safer than allowing every third-party resource on the page.

Where external assets are stored

Downloaded external assets are placed under a cdn/ folder, namespaced by domain:

example_backup/
  index.html
  assets/
    site.css
  cdn/
    cdn.example.com/
      library.js
    fonts.gstatic.com/
      font.woff2

References in your HTML, CSS, and JS are rewritten to point at these local copies.

SRI and CORS attributes

When an external <script> or <link> is localized, the tool removes integrity and crossorigin attributes where needed — those checks assume the original CDN URL and would otherwise break the offline copy.

Tips

  • Start without external assets and only add domains you actually need — check the page for broken styling or missing fonts, then allowlist those hosts.
  • Combine with --max-asset-bytes to avoid pulling in very large media.

See also: CLI Reference, How It Works.

Clone this wiki locally