Ushie 420edb051e feat(twitch): block-embedded-ads patch (#231)
Co-authored-by: Tim Schneeberger <tim.schneeberger@outlook.de>
2022-12-06 00:11:55 +01:00

18 lines
505 B
Kotlin

package app.revanced.twitch.adblock
import okhttp3.Request
interface IAdblockService {
fun friendlyName(): String
fun maxAttempts(): Int
fun isAvailable(): Boolean
fun rewriteHlsRequest(originalRequest: Request): Request?
companion object {
fun Request.isVod() = url.pathSegments.contains("vod")
fun Request.channelName() =
url.pathSegments
.firstOrNull { it.endsWith(".m3u8") }
.run { this?.replace(".m3u8", "") }
}
}