A script written in Node.js for downloading websites from Web Archive.
Intended for use by:
- Webmasters — to restore their lost or hacked projects
- OSINT researchers — for local work with resources that no longer exist
This webarchive website downloader has an interactive interface, supports downloading with either original links preserved or rewritten into relative ones (for local usage).
If this project helped you, consider giving it a ⭐
Got ideas or suggestions? Feel free to open an issue!
- 📁Features of Web Archive Website Downloader
- 📁Requirements
- 📁Installation
- 📁Run
- 📁Run in Docker
- 📁Example
- 📁Common Issues
- 📁(Important) Download responsibly
- Download entire websites or individual pages from the archive, including HTML, images, scripts, styles, and other assets.
- Rewrite internal links for correct local browsing.
- Multithreading support.
- Save results into a chosen folder while keeping the original structure.
- Ability to download external assets (e.g., images or scripts from a CDN).
- The script fixes parameterized file names such as
main.css?ver=1.2intomain.cssfor proper local work.
- Node.js version 18.x or higher
-
Download the project in one of the following ways:
- Git instruction:
git clone https://github.com/birbwatcher/wayback-machine-downloader.git
- ZIP archive instruction:
Download .zip and extract it.
- Git instruction:
-
Go to the inner
wayback-machine-downloaderfolder, where thepackage.jsonfile is located:- If you cloned with Git:
cd wayback-machine-downloader/wayback-machine-downloader - If you extracted the .zip:
cd wayback-machine-downloader-main/wayback-machine-downloader
⚠️ Important: run commands from this folder (the one containingpackage.json). - If you cloned with Git:
-
Install dependencies:
npm install
node index.jsAfter launching, an interactive menu will appear with the following questions:
- base URL (e.g., https://example.com)
- date range (from/to)
- number of threads
- link rewriting mode (keep as-is or convert to relative)
- whether to remove
rel=canonicalfrom the downloaded site - whether to download external assets
- directory for saving the files
You can also run the Wayback Machine Downloader inside a Docker container.
This allows you to use the tool without installing Node.js manually.
Open your terminal and navigate to the folder where the Dockerfile is located.
For example, if you cloned the repository:
cd wayback-machine-downloaderdocker build -t wayback-machine-downloader .docker run -it -v $(pwd)/websites:/app/websites wayback-machine-downloader-it— enables interactive input/output for the terminal (so you can answer questions).-v $(pwd)/websites:/app/websites— mounts the localwebsitesfolder so downloaded sites are saved on your machine.
After running, the same interactive menu will appear as with the standard Node.js run.
All archived websites will be saved locally in the ./websites directory.
node downloader.jsDialog example:
Enter base URL to archive (e.g., https://example.com): https://example.com
From timestamp (YYYYMMDDhhmmss) or leave blank: 20200101000000
To timestamp (YYYYMMDDhhmmss) or leave blank: 20201231235959
Rewrite links? (yes=relative / no=as-is, default no): yes
Canonical: "keep" (default) or "remove": keep
How many download threads? (default 3): 5
Only exact URL (no wildcard /*)? (yes/no, default no): no
Target directory (leave blank for default websites/<host>/):
Download external assets? (yes/no, default no): noAfter this, the archive download will begin.
Answer: try specifying the base URL with /* at the end.
For example: https://example.com/*, or try downloading a different time range.
-
You may have restored the website with absolute links.
This means it will only work correctly on its original domain and not when opened locally. -
Some styles or assets might be hosted on another domain, for example on a CDN.
In this case, make sure to select "rewrite links" and "download external assets" during setup.
The script will then also fetch resources from external domains.п -
The website might rely on JavaScript frameworks (like Angular or React) for rendering.
In such cases, downloading will be more difficult and can take considerably longer.
Please note that downloading third-party websites may violate copyright laws.
Use this tool responsibly and make sure not to break the law.
