Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deadsniper

CLI tool that finds broken or dead links on a web page. Give it a URL; it crawls the site recursively (same-domain), checks discovered links, and reports dead links (4xx/5xx, soft 404s) and links that block the scraper (403).

Quick start

macOS / Linux (one-liner):

curl -fsSL https://raw.githubusercontent.com/shutterscripter/deadsniper/main/install.sh | sh

Add to PATH if prompted (e.g. in ~/.zshrc or ~/.bashrc):

export PATH="$PATH:$HOME/.local/bin"

Then run:

deadsniper -u https://example.com

Windows: Download the latest deadsniper-windows-amd64.exe from Releases, then:

.\deadsniper-windows-amd64.exe -u https://example.com

Supported platforms

Platform Install
macOS (Intel) One-liner above, or Releasesdeadsniper-darwin-amd64
macOS (Apple Silicon) One-liner above, or Releases → deadsniper-darwin-arm64
Linux (amd64/arm64) One-liner above, or Releases → deadsniper-linux-amd64 / deadsniper-linux-arm64
Windows (amd64/arm64) Releasesdeadsniper-windows-amd64.exe / deadsniper-windows-arm64.exe

Usage

deadsniper -u <URL>

Examples:

deadsniper -u https://example.com
deadsniper --url https://mysite.com/page.html
deadsniper -u https://example.com --recursive --max-depth 5
deadsniper -u https://example.com -r=false
deadsniper --version

Recursive crawl examples

# Default recursive crawl (same-domain), depth 3
deadsniper -u https://example.com

# Recursive crawl with custom depth
deadsniper -u https://example.com --recursive --max-depth 5

# Short flags
deadsniper -u https://example.com -r -m 5

# Disable recursion (single page only)
deadsniper -u https://example.com -r=false

Options

Flag Short Description Default
--url -u URL of the page to check for dead links (required)
--verbose -v Verbose output false
--threads -t Number of threads 1
--delay -d Delay between requests (seconds) 0.5
--timeout -T Request timeout (seconds) 10
--output-type -o Output: 1=text file, 2=json file 1
--recursive -r Recursively crawl same-domain pages true
--max-depth -m Max recursion depth for page crawling 3
--help -h Help
--version Print version

Output

  • Dead links — URLs that returned 4xx/5xx or a “soft 404” (HTTP 200 but page says not found).
  • Blocked (403) — URLs that returned 403 (server blocks the scraper; may work in a browser).

With --output-type:

  • -o 1: write dead links to data.txt
  • -o 2: write dead links to data.json

How it works

  1. Fetches the URL with a browser-like User-Agent.
  2. Parses HTML and collects <a href="..."> links recursively on same-domain pages (up to --max-depth).
  3. Requests each link and classifies: dead (4xx/5xx or soft 404), blocked (403), or OK (200/301/302/304).

Build from source

Single platform:

go build -o deadsniper .
# Or: go build -o $(go env GOPATH)/bin/deadsniper .

All platforms (local):

chmod +x build.sh
./build.sh

Binaries go to dist/. Requires Go 1.23+.

git tag v0.1.4
git push origin v0.1.4

License

See LICENSE in the repository.

About

CLI tool that finds broken or dead links on a web page.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages