Skip to main content

Snag

A program to automatically fetch free software from the web. Any software with an unauthenticated download link can be downloaded fully automatically, while other software's download pages will be opened for manual download.

While this is primarily intended to assist in regular updates of downloaded software, any file type can be downloaded with this tool.

Installation

sudo pip install snag

Usage

To download the programs, navigate to the folder in which you would like the programs to be placed and run the following command:

snag [config | -e/--example] [options]

Options

config			- Specifies where to look for config file. Required (Mutually exclusive with -e)
-e, --example		- enables use of the built-in example download list (Mutually exclusive with config)
-o, --out		- Specifies output directory for downloaded files (default: ./)
-q, --quiet	 	- disables printing to the terminal.  Incompatible with -v.
-v, --verbose	 	- enables verbose status messages.  Incompatible with -q.
-l, --log	 	- enables logging to specified log file (default: ./log)
-c, --chars		- Specifies maximum number of characters to be printed per logging action. Set to 0 for unlimited printing. (default: 0)

Example:

snag -vl ./TTConfig.csv

(Enables verbose mode and logging, and uses ./TTConfig.csv as the config file)

Configuration

The config file must be formatted as a csv with the following fields:

Program Name, Download Page URL, Link Locator, File Type Extension, Category

Each line should specify the download information for one program. Lines starting with a '#' will be ignored.

Example:

Adium,https://adium.im/.downloadInfo:a:*href,dmg,mac

This downloads the file "Adium.dmg" from the url by getting the href attribute of a link that is the child of an element with the class "downloadInfo", and saves it to the folder "mac"

The link locator is a string that the program uses to find the download link of a program on a page.

A valid link locator is composed of a series of "nodes" delimited by colons (:).

Example:

 #osversion:^:a:*href

This finds the element with the ID "osversion", moves to its parent element, finds its first child of type a, and gets the href attribute of the element.

The type of a node is determined by its first character. The available node type prefixes are listed below:

. (period) 	- Class attribute
# (pound sign)  - ID attribute
^ (caret)	- Move to parent element
@ (at sign)	- Get title
* (asterisk)	- Get specified attribute
No prefix	- Get element type

Release files for snag 1.0.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 snag 1.0.0
File Size Uploaded
snag-1.0.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for snag 1.0.0
File Interpreter ABI Platform
snag-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / snag-1.0.0.tar.gz

Download URL snag-1.0.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bd15b8f098e8906571e1b973375ef8da7f9dbf05a14e0ed61a92570e990098cc
BLAKE2b-256 checksum
How to use checksums
f3acdffb3fc95b708bd081c4b60ef6579596e2fa8f16ebc61c7ab5e5d3d869d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / snag-1.0.0-py3-none-any.whl

Download URL snag-1.0.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dfab1657c091a1e1fd4f3882d48c2c8358239217859d7ca5624a2b0792df9b3
BLAKE2b-256 checksum
How to use checksums
4200e289d1464a138601f04fdaae982926191adce0f0bdd4945ec05f7307ba99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

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