Skip to main content

Download Latest

Download a file only if the remote file has changed.

Example

URL='https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US'
ARCHIVE="firefox.tar.bz2"

dl "$URL" "$ARCHIVE"

if [ -f "$ARCHIVE.new" ]; then
  echo "New version detected"
  tar -xjf "$ARCHIVE"
fi

Install

pip install download-latest

See the install guide for more information.

Usage

usage: download-latest [ -h | --help ] [OPTIONS] URL [FILE]

Download URL to FILE only if remote file has changed.

positional arguments:
  URL                url to download
  FILE               path to output (deduced if not specified, see below)

options:
  -h, --help         show this help message and exit
  -V, --version      show program's version number and exit
  -n, --dry-run      do not download (default: false)
  -f, --force        do not check for changes (default: false)
  -q, --quiet        suppress output (default: false)
  -v, --verbose      increase output (default: false)
  -c, --color        enable colorized output
  -C, --no-color     disable colorized output
  -p, --progress     enable the progress meter
  -P, --no-progress  disable the progress meter
  --backend BACKEND  how to download (default: auto)

BACKEND can be one of 'auto', 'curl', 'wget', or 'python'. If 'auto' is
selected, 'curl' will be chosen if available, then 'wget', then 'python'.

If the color or progress options are not specified, they are determined
from the TTY.

If FILE is not specified, it will be deduced by the filename part of the
URL. If no filename can be deduce, e.g., https://example.com/, then the
program will exit with an error.

Additional files may be generated:

FILE.new       present when download occured, otherwise absent
FILE.download  in-progress download

Metadata

Release files for download-latest 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for download-latest 0.2.0
File Size Uploaded
download_latest-0.2.0.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for download-latest 0.2.0
File Interpreter ABI Platform
download_latest-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.8 kB

Release files / download_latest-0.2.0.tar.gz

Download URL download_latest-0.2.0.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c0d5b94f5141b6b29ee666f48d3b80b19247a2cdf3433343a312f7b97afa6f50
BLAKE2b-256 checksum
How to use checksums
c238624a6fb4c07608f846c45f127b9589a86d3c5cbbf28ac76220b940d156d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.12.0 Linux/6.1.43-1.qubes.fc37.x86_64

Release files / download_latest-0.2.0-py3-none-any.whl

Download URL download_latest-0.2.0-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca25d8e377b0f7be74447df7d2f6b493bfd17cbf2fd2a87d6a0e1698c5b3ec6e
BLAKE2b-256 checksum
How to use checksums
c7f0681e4b8981051a72d248a689c9d54fc9827cda5f4d8a4f39214443f7853f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.12.0 Linux/6.1.43-1.qubes.fc37.x86_64

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page