Advanced skip options/Draft

From SponsorBlock
Jump to navigation Jump to search
This article is a draft.
It is still a work in progress. You can discuss it and suggest improvements on Discord or Matrix.

Advanced skip options can be used to change the skip options depending on certain criteria of the submission itself.

Example:

// Skip sponsors at the start of the video
if time.start < 1 and time.end < 10 and category == "sponsor"
Auto skip

Each block consists of the word if along with a series of conditions separated by and and or, followed by an action.

The following attributes are supported:

  • time.start (when the segment starts in the video in seconds)
  • time.end (when the segment ends in the video in seconds)
  • time.duration (how long the segment is in seconds)
  • time.startPercent (when the segment starts in the video as a percentage)
  • time.endPercent (when the segment ends in the video as a percentage)
  • time.durationPercent (how long the segment is as a percentage of the total video length)
  • category
  • actionType
  • chapter.name (the title for chapters)
  • chapter.source (to separate SponsorBlock chapters from YouTube chapters)
  • channel.id (ID starting with UC)
  • channel.name (plain text name with spaces)
  • video.duration (the length of the video in seconds)
  • video.title

The following operators are supported:

  • <
  • <=
  • >
  • >=
  • ==
  • != (not equal)
  • *= (contains text ignore case)
  • !*= (not contains ignore case)
  • ~= (matches regex)
  • ~i= (matches regex ignore case)
  • !~= (doesn't match regex)
  • !~i= (doesn't match regex ignore case)

The following actions are supported:

  • Disabled
  • Show overlay
  • Manual skip
  • Auto skip

Unlike other words in the format, actions are case-insensitive.

The following categories are supported:

  •  sponsor
  •  selfpromo
  •  exclusive_access
  •  interaction
  •  poi_highlight
  •  intro
  •  outro
  •  preview
  •  hook
  •  filler
  •  chapter
  •  music_offtopic

The following source values are supported:

  • server
  • youtube
  • autogenerated
  • local

More examples

// Auto skip chapters that contain the word bloopers (case insensitive)
if category == "chapter" and chapter.name *= "bloopers"
Auto skip

// Auto skip chapters that start with the word Intro or intro
if category == "chapter" and chapter.name ~= "^[Ii]ntro"
Auto skip

// Auto skip chapters that start with the word Intro or intro but only if they are made by the YouTuber
if category == "chapter" and chapter.name ~= "^[Ii]ntro" and chapter.source == "youtube"
Auto skip

// Auto skip chapters that start with the word Intro or intro but only if they are submitted by a SponsorBlock user
if category == "chapter" and chapter.name ~= "^[Ii]ntro" and chapter.source == "server"
Auto skip

// Auto skip preview/recap on this specific channel
if category == "preview" and channel.id == "UCX8wm5-NEzN-eL-DNcsRRJA"
Auto skip

// Auto skip intros on channels with names containing trains
if category == "intro" and channel.name *= "trains"
Auto skip