You will find question masks in several places, please hover on them to view brief descriptions. You can find FAQs on our website or report issues in our bug tracking system.

### Batch Descriptors

Batch Descriptor is used to construct URLs for batch downloads, it is defined as:
[start:end] or
[start:end:step]

Examples:

Descriptor | Results
--- | ---
[1:100] | 1,2,3,...,99,100
[1:100:3] | 1,4,7,...,97,100
[a:z] | a,b,...,z
[F:Y] | F,G,...,Y
[01:100] | 01,02,03,...,99,100

### Naming Masks

Naming Masks help you set file name for tasks. Below are all the allowed Naming Masks when specifying file name. Content surrounded by square brackets is optional.

Mask | Meaning
--- | ---
*name* | File name
*ext* | File extension
*url* | Complete URL
*host* | URL host name
*query* | URL query string
*anchor* | URL anchor string
*subdirs* | URL sub-directories
*text* | Text along with the link or image
*title* | Title attribute of the link or image
*page_title* | Title of the referring page
*num* | A counter that increases whenever a task is added
*size* | Size of the file, measured in Bytes
*refer* | Referrer URL
*mime* | Mime Type
*remark* | Remarks
*hh* | Current hour in 2 digits
*mm* | Current minute in 2 digits
*ss* | Current second in 2 digits
*y* | Current year in 4 digits
*m* | Current month in 2 digits
*d* | Current date in 2 digits
*wd* | Current weekday in 1 digits, see the Time Constants in Rule System section
*datetime[,yyyy-MM-dd hh:mm:ss]* | Current datetime with an optional format string, if the format string is omitted, the datetime will be formatted as 'yyyy-MM-dd hh:mm:ss' by default
*date[,yyyy-MM-dd]* | Current date with an optional format string, if the format string is omitted, the date will be formatted as 'yyyy-MM-dd' by default
*time[,hh:mm:ss]* | Current time with an optional format string, if the format string is omitted, the time will be formatted as 'hh:mm:ss' by default
*addtime[,yyyy-MM-dd hh:mm:ss]* | The datetime when the task is added, the optional format string is handled in the same way as *datetime*

For URL values, you can add 'flat' to convert all the slashes to underscores, e.g. *flaturl*, *flatsubdirs*.

Please note that file names can also include sub-folders, e.g. dirA/dirB/*name*.*ext*.

### Rule System

A Rule is used for filtering tasks in Download Manager and for automatically setting Naming Masks.

Rule Condition can reference another Rule by enclosing its Reference Name in curly braces, e.g. the pre-defined Rule r_done_audio references Rule r_done in its condition.

Rule Condition can use Naming Masks to retrieve information from a task. Besides those listed in above section, below are some more masks that you can use in Rule Conditions.

Mask | Meaning
--- | ---
*state* | Current state of the task
*time_elapsed* | Time already spent for the task
*progress* | Current progress of the task

Rule Condition can also reference pre-defined Constants by square brackets, e.g. the Rule r_done references the [finish] Constant as described below. The square brackets are also used to reference Extension Filters, because Extension Filters are treated as Regular Expression string Constants, e.g. the Rule r_done_audio references the [ext_audio] Extension Filter.

The following table summarizes the pre-defined Constants(all in lower-case):

Constant | Meaning/Value
--- | ---
[mon] | 1
[tue] | 2
[wed] | 3
[thu] | 4
[fri] | 5
[sat] | 6
[sun] | 0
[download] | Task state: downloading
[inqueue] | Task state: waiting in queue
[paused] | Task state: paused
[finished] | Task state: finished
[interrupted] | Task state: interrupted
[now] | Current time
[today],[today_] | The beginning of today, i.e. 00:00:00; the version with a trailing underscore indicates the end of today, i.e. 23:59:59. You can also add a traling underscore to all the Time Constants below
[yesterday] | The beginning of yesterday, i.e. 00:00:00
[this_week] | See above
[last_week] | See above
[this_month] | See above
[last_month] | See above
[this_year] | See above
[last_year] | See above
[n_days_ago] | The beginning of the last 'n' days, 'n' can be replaced by any positive number, e.g. [3_days_ago]
[n_weeks_ago] | See above
[n_months_ago] | See above
[n_years_ago] | See above

There can be string value, numeric value and datetime value in a Rule Condition. You can perform arithmetic calculation on numbers, use '+' to concat strings, and use '-' to get difference of two datetime values. Below are the functions that you can use on different value types:

Type | Function | Parameters | Description
--- | --- | --- | ---
string | is | a Regular Expression string | Test if the string matches exactly. E.g. *url*.is("xxx")
string | has | same as above | Test if the string contains the sub-string. E.g. *url*.has("xxx")
string | beginwith | same as above | Test if the string starts with the sub-string. E.g. *url*.beginwith("xxx")
string | endwith | same as above | Test if the string ends with the sub-string. E.g. *url*.endwith("xxx")
datetime | aft | a time value or time string | Test if the time is later than. E.g. *addtime*.aft("2012-3-11"), *addtime*.aft([now])
datetime | b4 | same as above | Test if the time is earlier than. E.g. *addtime*.b4("2012-3-11")
datetime | btwn | two time values or time strings | Test if the time is between. E.g. *addtime*.btwn("2012-3-11","2013-3-11")
datetime | is | a Time Constant string | This is a helper function for testing something like *addtime*>=[today]&&*addtime*<=[today_] in a shorter line, *addtime*.is("today")

Some more helpful functions:

Function | Parameter | Description
--- | --- | ---
yearof | a time value or time string | Return a number represents the year of given parameter. E.g. yearof("2012-3-11"), yearof(*addtime*)
monthof | same as above | Return a number represents the month
dateof | same as above | Return a number represents the date
dayof | same as above | Return a number represents the weekday
hourof | same as above | Return a number represents the hour
minuteof | same as above | Return a number represents the minute
secondof | same as above | Return a number represents the second
kb | a number | Convert KiloBytes to Bytes. E.g. kb(1)=1024
mb | same as above | Convert MegaBytes to Bytes. E.g. mb(1)=1024*1024
gb | same as above | Convert GigaBytes to Bytes. E.g. gb(1)=1024*1024*1024
hour | same as above | Return a number represents x hours. E.g. [now]-*addtime*<hour(3) means task is added within 3 hours
min | same as above | Return a number represents x minutes
sec | same as above | Return a number represents x seconds

### Panic Button

If the extension is broken and cannot work anymore, try click the button below. It will clean all tasks and settings, and then reload the extension.