Script Index


/var/lib/sorcery/modules/libdownload

This file contains functions for accessing download handlers. Download handlers handle the physical acquiring of files as opposed to the more abstract process of parsing and manipulating urls. A url handler will specify a download handler for a given url. dl handlers may call back to url handlers to have a url parsed it is up to the dl handler to interprit the results of the url parsing as it may be different for each type of url. dl handlers are responsible for connecting to the internet if they need to. WRITING NEW DL HANDLERS

Current dl handlers only need a single function
"dl_get_" This function takes the following arguments:
$target
$url_list List of urls to get the target from
$hints Hints, these help the function determine what
type of thing it is downloading or other tunables.
$dl_target Name of variable in which to store the name of the
result directory or file
$dl_type Name of the variable in which to store the type of
thing downloaded
The target parameter is advisory, it is a hint at what might be downloaded. The hints value is a list, values of interest to a particular dl_handler should be prefixed "dl_", the handler may define any hints which it see's necessary. There are also well defined hints: "tree" "file" these indicate that the type of thing being downloaded is probably a tree or file despite what we may think. The basic form of a dl handler's get function is simply a loop over each url until one successfully downloads, it should then set the target and type reference variable successfully.

Synopsis

Frontend interface for dl_handlers


function dl_get_bucket()

Parameters:

Note

The remainder of the arguments are target, url_list, hints, dl_target and dl_type. See above for information.

Param

type Name of handler

Description

Download a specified group of urls, they are assumed to all be understood by the specified handler.


function dl_connect()

Parameters:

Description

this nonsense is to get us connected to the outside world it should eventually be a seperate, userdefinable script, with this as the default of course


function dl_disconnect()

Parameters:

Description

this clever function disconnects us if we aren't downloading something the heuristic is rather poor.