8000
Skip to content 7FFF

zt64/sponsorblock-kt

Repository files navigation

sponsorblock-kt

Maven Central Version
badge-platform-jvm badge-platform-js badge-platform-js-node badge-platform-linux badge-platform-windows badge-platform-macos badge-platform-ios badge-platform-tvos badge-platform-watchos

A Kotlin Multiplatform client library for the SponsorBlock API, powered by Ktor.

Setup

Add the following to your gradle/libs.versions.toml:

[versions]
sbkt = "x.y.z"  # Replace with latest version

[libraries]
sbkt-client = { module = "dev.zt64.sbkt:client", version.ref = "sbkt" }
# or
sbkt-core = { module = "dev.zt64.sbkt:core", version.ref = "sbkt" }

Then add the dependency to your module's build.gradle.kts:

dependencies {
    implementation(libs.sbkt.client) // Full implementation with Ktor
    // or
    implementation(libs.sbkt.core)   // Core functionality only
}

Note

A Ktor engine implementation must be included in your dependencies to use the client.

Quick Start

// Create an unauthenticated guest client
val client = SponsorBlockClient()

// Get segments for a video
val segments = client.getSegments(VIDEO_ID)

// Create a client with a user ID
val userClient = SponsorBlockClient.user(USER_LOCAL_ID)

// Vote on segments
userClient.upvoteSegment(segmentUuid, videoId)

License

This project is licensed under the MIT License.

About

A Kotlin multi-platform wrapper around the SponsorBlock API

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages

0