Skip to content
Matthias Hecker edited this page Feb 8, 2015 · 12 revisions

url.discover

Delegate url to a subtask by its domain or by a regexp. In case no matching task was found the url.generic task is run. If the url is invalid it is discarded.

Signature

Name Type Description
item_id int The id of an item.
url string URL.

url.generic

Called for a unspecified url, it determines the type of the URL by loading only the first few bytes, those are then used to match against magic numbers (file signatures) of accepted filetypes. In which case it delegates the url to url.download.

Signature

Name Type Description
item_id int The id of an item.
url string A URL.

url.download

Downloads a URL to a temporary destination then delegates to file.discover.

Signature

Name Type Description
item_id int The id of an item.
url string A URL.

file.discover

Validates the type and size of a temporary file, it delegates based on mimetype. Images proceed to image.discover. If it fails validation a error is logged and the tempfile deleted.

Signature

Name Type Description
item_id int The id of an item.
tempfile string List of absolute paths to a temporary files.
data.url string Download Url. (optional)
data.upload string Original upload filename. (optional)

image.discover

Image processing, it validates and collects metadata about the image. Then schedules storing the image at their final destination.

Signature

Name Type Description
item_id int The id of an item. It must exist.
tempfile string Absolute path to a temporary image file.
data.mimetype string Detected mimetype of the file.
data.url string Url this file was downloaded from.
data.upload string Original upload filename.