A tool to batch-download files from the internet
Project description
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"
Link Locators
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file snag-0.1.0.tar.gz
.
File metadata
- Download URL: snag-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0603169dbbf712588ce4ff4a6850e1bf9e1f67ac0c752dd4b2472a3ebe32c0d |
|
MD5 | 2d2e9b7dabf11ca6509572556b674385 |
|
BLAKE2b-256 | 040f347d0d1e801151656b336e79596a5bd8b35931528480ad5b4c8febe90b40 |
File details
Details for the file snag-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: snag-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1076998dd22ab33f6832b8ddf784eb93c499afbfbe4f18099a9a0af95b81fca7 |
|
MD5 | 727b5bc5a1c8a7cff35cd598bc308fae |
|
BLAKE2b-256 | 78a2646c1e02d7c5d54f3dc0243e80bd161d1f04d216f713053fbdf2a8817698 |