Skip to content

sadiqui/golang-wget-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Available Flags

  • -B : Download in background
  • -O [string] : Output filename
  • -P [string] : Directory to save files
  • -i [string] : File containing URLs to download
  • -max-concurrent [int] : Maximum concurrent downloads (default 5)
  • -rate-limit [string] : Rate limit (e.g., 200k, 2M)
  • -mirror : Mirror website
    • -R [string] : Comma-separated file extensions to reject
    • -X [string] : Comma-separated paths to exclude
    • -convert-links [string] : Make files point to downloaded resources

Usage Examples

  • Basic examples:
# Build Go binary
go build -o wget main.go

# Simple file download
./wget https://example.com/index.html

# File download with custom filename
./wget -O homepage.html https://example.com/index.html

# JSON download with custom name
./wget -O data.json https://httpbin.org/json

# Download to specific directory
mkdir downloads
./wget -P downloads https://httpbin.org/xml

# Multiple files download
echo -e "https://example.com/index.html\nhttps://httpbin.org/xml" > urls.txt
./wget -i urls.txt

# Test 404 page
./wget https://example.com/notfound.html

# Test invalid URL
./wget htt://invalid-url
  • Advanced examples:

Chek test files written in shell 🙂

Reliable Test URLs

About

Recreating some functionalities of wget

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors