Giter Site home page Giter Site logo

pwget's Introduction

pwget = Parallel WGET

Similar to wget, but in parallel

Ever downloaded large files over internet, but connection often resets? Ever want to download in parallel using simple command like wget?

You have it now.

Installing...

$ go install github.com/wushilin/pwget@latest

After this, you will find pwget executable in your $GOPATH/bin. You can add this to your $PATH, or invoke with full path.

Usage

$ pwget <url>

Full usage explanation

  -H value
        Add custom http headers
  -c string
        Specify cookie Header value
  -j string
        Specifies the jump host
  -k string
        Specifies the jump host secret
  -n int
        Split into N segments and download in parallel (default 10)
  -o string
        Specify download output file (default is auto detect)
  -q    Specifies whether it should be quiet
  -r string
        Specify referrer
  -ua string
        Specify User Agent (default "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")

What is a jump host?

Jump host is a tool I wrote (similar to proxy, but light weight, secure by default). Checkout https://github.com/wushilin/netjumper

Features of pwget

Simple

# Download with 10 slices
$ pwget http://some-host.download.com/super-large.iso

# Download with 50 slices
$ pwget -n 50 http://some-host.download.com/super-large.iso

# With cookie
$ pwget -c "abc=def; other=sucks;" http://some-host.download.com/super-large.iso

# with referer
$ pwget -r "http://some-host.download.com" http://some-host.download.com/super-large.iso

# with User-Agent
$ pwget -ua "Some-Weird-Broser-String" http://some-host.download.com/super-large.iso

# Specify output file
$ pwget -o small.iso http://some-host.download.com/super-large.iso

# with custom header
$ pwget -H "someHeader: headerval" -o small.iso http://some-host.download.com/super-large.iso

# use with some jumper
$ pwget -j "jumpHost:9527" -k "secret" -H "someHeader: headerval" -o small.iso http://some-host.download.com/super-large.iso

Note that if jumper can't be connected, it will fall back to normal dialer (e.g. direct connection)

# use with quiet (no progress reporting)
$ pwget -q -H "someHeader: headerval" -o small.iso http://some-host.download.com/super-large.iso

Sample output

root@master /o/G/s/g/w/pwget# ./pwget -j home.myhome.net:9527 -k bigsecret "http://releases.ubuntu.com/18.04.1/ubuntu-18.04.1-desktop-amd64.iso?_ga=2.191772394.1990563598.1542159661-244726927.1539156732"
Quiet? false
Size 1953349632 Bytes, file name ubuntu-18.04.1-desktop-amd64.iso
Each segment 195334963 Bytes
Progress: 168057KB of 1907568KB (8%)

Resume capable

The program aborts only after 10 consecutive retries (with 5 seconds sleep inbetween retries) failed to download a single byte. The program resumes download from last abortion (based on file part size), however if you used -n to specify threads, the n must be the same otherwise this download may create corrupted file

Note: If server doesn't support Content-Length response header, the program will not download.

Enjoy!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.