GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Why Go
  • Case Studies
  • Use Cases
  • Security
  • Learn
  • Effective Go
  • Go User Manual
  • Standard library
  • Release Notes
  • API
  • Packages
  • Recorded Talks
  • Meetups
  • Conferences

This view

  • Original page
  • New address

GeezerVison is showing pkg.go.dev — abc package - github.com/ScriptTiger/abc - Go Packages

Details

  • checked Valid go.mod file

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.

  • checked Redistributable license

    Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  • unchecked Tagged version

    Modules with tagged versions give importers more predictable builds.

  • unchecked Stable version

    When a project reaches major version v1 it is considered stable.

  • Learn more about best practices

Repository

github.com/ScriptTiger/abc

Links

  • Open Source Insights Logo Open Source Insights

README ¶

Say Thanks!

ABC: Arbitrary Byte Collector

ABC is a package for Go which can act as either a standard HTTP sequential downloader supporting streaming playback while downloading for supported "Web" videos (with supported players, such as VLC, MPlayer, ffplay, MPC-HC, etc.) and resume capabilities or as an arbitrary byte collector to download only arbitrary portions of files by manipulating the HTTP Range header as needed. ABC can easily be imported into any Go project and be implemented as Go routines to download arbitrary portions of files concurrently. The reference implementation of ABC launches a single instance of ABC, but can also be easily scripted for concurrency.

To import ABC into your project:
go get github.com/ScriptTiger/abc
Then just import "github.com/ScriptTiger/abc" and call abc.Download(...) to use.

Please refer to the dev package docs and reference implementation for more details and ideas on how to integrate ABC into your project.

Dev package docs:
https://pkg.go.dev/github.com/ScriptTiger/abc

Reference implementation:
https://github.com/ScriptTiger/abc/blob/main/ref/ref.go

Reference Implementation

Usage: abc [options...] <url> <file>

Argument Description
-agent <user-agent> Set User-Agent header
-i <URL> Source URL
-retry <number> Number of retries
-nodebug Don't display debug messages, such as errors
-nokeep If file already exists, delete and download new
-noprogress Don't display progress
-o <file> Destination file
-range <range> Set Range header
-timeout <duration> Set connection timeout

By default, if only a URL is given and no destination file, ABC will not download anything and just exit after returning any errors as well as the Content-Length and Accept-Ranges headers. If both the URL and destination file are given, without any additional arguments, ABC will either create a new destination file if it doesn't exist already, append to the existing destination file if it does exist but is not complete, or delete the existing file if it does exist but the server does not support resume capabilities and create a new file. ABC gives you both enough information as well as flexibility to either easily implement your own additional functionality in Go or via a scripted solution using the included reference implementation.

More About ScriptTiger

For more ScriptTiger scripts and goodies, check out ScriptTiger's GitHub Pages website:
https://scripttiger.github.io/

Documentation ¶

Index ¶

  • Constants
  • func Download(urlRaw, file, byteRange, agent *string, timeout *time.Duration, retryMax *uint, ...) (totalSize int64, acceptRanges string, err error)

Constants ¶

View Source
const NODEBUG = 1

Flag constants

View Source
const NOKEEP = 4
View Source
const NOPROGRESS = 2

Variables ¶

This section is empty.

Functions ¶

func Download ¶

func Download(urlRaw, file, byteRange, agent *string, timeout *time.Duration, retryMax *uint, flags *uint8) (totalSize int64, acceptRanges string, err error)

Public ABC Download function

Types ¶

This section is empty.

Source Files ¶

View all Source files
  • abc.go

Directories ¶

Path Synopsis
ref
Click to show internal directories.
Click to hide internal directories.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.