A Lavalink plugin to skip SponsorBlock segments in YouTube videos and provide information about chapters
Warning This plugin requires Lavalink v4 or higher
To install this plugin either download the latest release and place it into your plugins
folder or add the following
into your application.yml
lavalink:
plugins:
- dependency: "com.github.topi314.sponsorblock:sponsorblock-plugin:x.x.x" # replace x.x.x with the latest release tag!
repository: "https://maven.topi.wtf/releases"
Snapshot builds are available in https://maven.topi.wtf/snapshots with the short commit hash as the version
GET /v4/sessions/{sessionId}/players/{guildId}/sponsorblock/categories
Response:
[
"sponsor",
"selfpromo"
]
PUT /v4/sessions/{sessionId}/players/{guildId}/sponsorblock/categories
Request:
[
"sponsor",
"selfpromo"
]
DELETE /v4/sessions/{sessionId}/players/{guildId}/sponsorblock/categories
sponsor
selfpromo
interaction
intro
outro
preview
music_offtopic
filler
There are also two new events:
which is fired when the segments for a track are loaded
{
"op": "event",
"type": "SegmentsLoaded",
"guildId": "...",
"segments": [
{
"category": "...",
"start": 0, // in milliseconds
"end": 3000 // in milliseconds
}
]
}
which is fired when a segment is skipped
{
"op": "event",
"type": "SegmentSkipped",
"guildId": "...",
"segment": {
"category": "...",
"start": 0, // in milliseconds
"end": 3000 // in milliseconds
}
}
which is fired when the chapters for a track are loaded
{
"op": "event",
"type": "ChaptersLoaded",
"guildId": "...",
"chapters": [
{
"name": "Prelude",
"start": 0, // in milliseconds
"end": 0, // in milliseconds
"duration": "0" // in milliseconds
}
]}
which is fired when a new Chapter starts
{
"op": "event",
"type": "ChapterStarted",
"guildId": "...",
"chapter": {
"name": "Prelude",
"start": 0, // in milliseconds
"end": 0,// in milliseconds
"duration": "0" // in milliseconds
}
}
An example implementation in Go can be found here