Giter Site home page Giter Site logo

scripttiger / abc Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 55 KB

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.

Home Page: https://scripttiger.github.io/more/

License: MIT License

Go 95.78% Batchfile 4.22%
go golang downloader streaming stream streaming-video scripttiger

abc's Introduction

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 reference implementation for more details on how to integrate ABC into your project.
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/

Donate

abc's People

Contributors

scripttiger avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sfidea

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.