Skip to content

Custom Formatter

Viren070 edited this page Apr 30, 2025 · 57 revisions

Here is a complete reference to the custom formatter system

A custom format allows you to fully control the output of the streams. You can test your formats live at the configuration page using the Preview.

When writing your format, you have access to specific objects, known as variables, each with their own properties. The format to access a variable is as follows:

{variableName.propertyName}.

You may also apply specific "modifiers". The available modifiers depend on the type of properties. i.e. strings, numbers, lists, each have their own modifiers.

Variables

Stream

Access Type Description
{stream.name} string Name of the stream or media file
{stream.size} number Size of the stream/file in bytes
{stream.personal} boolean Whether the stream is from personal library
{stream.quality} string Quality indicator of the stream
{stream.resolution} string Video resolution (e.g., "1080p", "4K")
{stream.languages} string[] Available audio/subtitle languages
{stream.visualTags} string[] Tags related to video characteristics
{stream.audioTags} string[] Tags related to audio characteristics
{stream.releaseGroup} string Name of the group that released the content
{stream.encode} string Encoding format (e.g., "x264", "HEVC")
{stream.indexer} string Source indexer that provided the stream
{stream.seeders} number Number of seeders (for torrents)
{stream.age} string Age of the stream since release
{stream.duration} number Duration of the media in seconds
{stream.infoHash} string Info hash for torrent identification
{stream.message} string Additional information or status message

Provider

Access Type Description
{provider.id} string Unique identifier of the provider
{provider.shortName} string Abbreviated name of the provider
{provider.name} string Full name of the provider
{provider.cached} boolean Whether the stream is cached

Addon

Access Type Description
{addon.id} string Unique identifier of the addon
{addon.name} string Display name of the addon

Debug

Access Type Description
{debug.json} string Raw JSON string representation of data
{debug.jsonf} string Formatted JSON string representation of data

Modifiers

String Modifiers

  • ::uppercase - Convert string to uppercase
  • ::lowercase - Convert string to lowercase
  • ::exists[trueValue||falseValue] - Return trueValue if string exists, otherwise falseValue
  • ::length - Return the length of the string
  • ::contains(substring)[trueValue||falseValue] - Check if string contains substring
  • ::trim - Remove whitespace from both ends of the string

Number Modifiers

  • ::>value[trueValue||falseValue] - Greater than comparison
  • ::<value[trueValue||falseValue] - Less than comparison
  • ::bytes - Format number as bytes with appropriate unit (KB, MB, GB)
  • ::time - Format number of seconds as human-readable time
  • ::format(decimals) - Format number with specified decimal places

Boolean Modifiers

  • ::istrue[trueValue||falseValue] - Return trueValue if true, falseValue if false
  • ::isfalse[trueValue||falseValue] - Return trueValue if false, falseValue if true

Array Modifiers

  • ::join(separator) - Join array elements with specified separator
  • ::length - Return the number of elements in the array
  • ::exists[trueValue||falseValue] - Return trueValue if array exists and has elements, otherwise falseValue
  • ::first - Return the first element of the array
  • ::last - Return the last element of the array

Examples

If you would like a format featured here, please DM me on Discord/Reddit at Viren_7.

GDrive

Author: Viren070

This is the default 'gdrive' format written as a custom formatter:

Name:

{stream.infoHash::exists["[P2P]"||""]}{provider.shortName::exists["[{provider.shortName}"||""]}{provider.cached::istrue["⚡] "||""]}{provider.cached::isfalse["⏳]"||""]}{addon.name}{stream.personal::istrue[" (Your Media)"||""]} {stream.resolution::exists["{stream.resolution}"||""]}

Description:

{stream.quality::exists["🎥 {stream.quality} "||""]}{stream.quality::exists["🎞️ {stream.encode} "||""]}{stream.quality::exists["🏷️ {stream.releaseGroup}"||""]}
{stream.visualTags::exists["📺 {stream.visualTags::join(' | ')} "||""]}{stream.audioTags::exists["🎧 {stream.audioTags::join(' | ')}"||""]}
{stream.size::>0["📦 {stream.size::bytes} "||""]}{stream.duration::>0["⏱️ {stream.duration::time} "||""]}{stream.seeders::>0["👥 {stream.seeders} "||""]}{stream.age::exists["📅 {stream.age} "||""]}{stream.indexer::exists["🔍 {stream.indexer}"||""]}
{stream.languages::exists["🌎 {stream.languages::join(' | ')}"||""]}
{stream.name::exists["📄 {stream.name}"||""]}

Clone this wiki locally