Template Syntax - solorey/Art-Saver GitHub Wiki

Template Syntax

Here is an example path template.

Saved/{site}/{userName}/{submissionId}_{title}_by_{userName}.{ext}

Every word wrapped in {} is a meta. This is a piece of information related the file being downloaded. All {metas} will be replaced with the appropriate extracted information when the file is downloaded. To know which {metas} are available click the help button under the textarea. Every site has different {metas} that are available. All {metas} are case sensitive.

Every / is a folder the file will be saved in. If the folder does not exist, it will be created.

The save location starts in the browsers Downloads folder. The start location can only be changed in the browsers settings.

It is recommended to at least have {submissionId} somewhere in the template. It is unique to every submission, can keep your files in chronological order, and can help find the exact webpage from where it was downloaded from.

Mods

There are some modifications that are available to {metas} that can change the value before it is applied to the template.

The syntax is ! followed by the modification.

  • Example: {meta!mod}

Modifications can be chained and modify the value from left to right.

  • Example: {meta!mod1!mod2!mod3}

The available modifications are as follows.

Uppercase

  • Syntax: !u

Convert the value to uppercase.

Example: Initial value: {meta} -> abcdef

  • {meta!u} -> ABCDEF

Lowercase

  • Syntax: !l

Convert the value to lowercase.

Example: Initial value: {meta} -> ABCDEF

  • {meta!l} -> abcdef

Add

  • Syntax: !<[+-]><number>

If the value is a number, add or subtract to it.

Example: Initial value: {meta} -> 100

  • {meta!+5} -> 105
  • {meta!-10} -> 90

Base

  • Syntax: !b<radix>

If the value is a number, convert the value to a new base. The base value must be at least 2 and no greater than 36.

Example: Initial value: {meta} -> 100

  • {meta!b16} -> 64
  • {meta!b2} -> 1100100

Pad

  • Syntax: !<fill?><[<>]><number>

Pad the value with a character. If no fill character is provided then default to space.

Example: Initial value: {meta} -> abc

  • {meta!x<6} -> xxxabc
  • {meta!<6} -> abc
  • {meta!x>6} -> abcxxx

Slice

  • Syntax: ![<start?>:<end?>]

Extract a section of the value.

Example: Initial value: {meta} -> abcdefghijklmnopqrstuvwxyz

  • {meta![6:12]} -> ghijkl
  • {meta![:12]} -> abcdefghijkl
  • {meta![6:]} -> ghijklmnopqrstuvwxyz
  • {meta![-12:-6]} -> opqrst
  • {meta![:-6]} -> abcdefghijklmnopqrst
  • {meta![-12:]} -> opqrstuvwxyz

Parent metas

If a submission was found within another submission. The parent submissions meta values can be accessed by adding ^ to the end of the meta name {meta^} and before any modifications {meta^!mod}.

This is currently only available for DeviantArt stash submissions.

⚠️ **GitHub.com Fallback** ⚠️