Coder Social home page Coder Social logo

wtsize's Introduction

WTSize

On the road with a limited data plan or bad network and want to know if it's safe to download a particular remote file? WTSize (what the size) is a small Python 3 CLI app which checks the size of remote files without downloading them (by looking at the Content-Length header).

>>> wtsize https://site.tld/some_big_file.zip
822.24 MiB

Usage

wtsize URL
wtsize URL [--unit=MiB]
wtsize -h | --help
wtsize --version

Install

pip install wtsize

Limitations

  • Not all servers return a Content-Length header so you might be unable to get the actual file size without, well, downloading the file. wtsize will tell you if that's the case.
  • In some cases the Content-Length cannot be known before accessing the body (dynamic content)
  • Headers can easily be spoofed. Generally, though, there's a good chance that the Content-Length header in the server response is accurate.

wtsize's People

Contributors

davidhamann avatar

Watchers

James Cloos avatar

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.