There are one to three steps to installing snatch:
First things first! If you use guiprep or guiguts, then you already have perl installed. You just need to make sure perl is in your system's PATH.
*nix: I will assume you know how to install perl (Debian: `apt-get perl`; Gentoo: `emerge perl`; etc.).
Windows: You basically have two options:
Mac: Please refer to the following thread at DP: http://www.pgdp.net/phpBB2/viewtopic.php?t=3777
Download the latest release.
To unzip snatch, you need an unzip program. The DP forums contain some good suggestions:
Unzip the latest release to the directory of your choice (I use ~/dp/snatch/ under linux and C:\temp\dp\snatch\ under Windows).
Now, go to the command line. (Under Windows go to Start->Run and type "cmd" [without quotes] in the "Open" field then hit Enter.) Navigate to the directory where you put snatch, and run the program as you desire (see the Examples section for, well, examples...).
Snatch now reads a config file to set some default settings. Included in the distribution is a file called "config.example.rc". If installing for the first time, you should copy (or rename) "config.example.rc" to "config.rc". For most users, that is all you will need to do. However, if you want to tweak default snatch performance, you can mess with the settings as detailed below.
It is important to remember when modifying the config.rc to include double quotation marks (") around each value and put a semi-colon (;) at the end.
| name | variable | example values | description |
|---|---|---|---|
| User Agent | $config{'useragent'} |
Mozilla/6.0 |
Some sites will only allow certain "user agents" (browsers and other programs that access the web) to access their site. If for some reason the default user agent isn't working, or if you prefer to use a different user agent for another reason, uncomment this option and change as desired. As of version 0.5, if this option is not set, snatch will choose a random user agent from the list in the uagents file. As of version 0.5.2, the user agent can be set by the -ua option, which overrides this setting. |
| HTTP Proxy | $config{'proxy'} |
http://proxy.myserver.com/ http://username:password@myproxy.myserver.com:8080/ |
This is commented (disabled) by default, but if you are trying to download through a proxy, just uncomment the variable and put in your proxy server address. Proxy support is provided by the LWP::UserAgent perl module. Proxy environment variables currently not supported. As of version 0.5.2, the -p flag overrides this option. Using "-p off" on the commandline will disable proxy support altogether. |
| Download Directory | $config{'dir'} |
*nix: "~/snatch/dp/" Windows "C:\Documents and Settings\username\My Documents\dp\snatch\" |
This option sets the default download directory. Please note that this option can be overridden using the "-d" flag on the commandline. |
| Default format | $config{'format'} |
image |
This option defines the default preferred download format. Since the format is heavily site-dependent, this option may be overridden by the module. Each module defines its own default download format. If this option is not set, or if the value of this option is not valid for that module, the module may use its default value type or it may fail to download any files. Refer to the module's documentation in snatch.html for details on default module types. This value may be overridden by the "-f" option on the command line. |
| Verbose Reporting | $config{'verbose'} |
0 1 |
This option enables or disables verbose reporting. It is usually needed only for reporting bugs or developing new modules (or for insanely watching as each page is downloaded, as I am wont to do from time to time) |
| Renumber Files | $config{'renumber'} |
0 1 |
This option enables renumbering of downloaded files. Please note that modules may choose to override this option for technical reasons. Refer to the documentation for details on which modules override this option. Setting this option to "1" is equivalent to using the "-r" option on the command line. |
| Wait Between Files | $config{'wait'} |
[integer] |
Sometimes it may be useful (and even courteous) to pause for a few seconds (or longer) between downloading files. If this option is set, snatch will wait the number of seconds specified between each file. This setting can be overridden using the "-w" option on the command line. |
| Cookie File (0.5 and later) | $config{'cookiefile'} |
cookies.txt |
Experimental! Use this file to store cookies. |