Initial commit
This commit is contained in:
commit
98ed7e8839
2263 changed files with 108711 additions and 0 deletions
10
lib/vido-extractor/build.gradle.kts
Normal file
10
lib/vido-extractor/build.gradle.kts
Normal file
|
@ -0,0 +1,10 @@
|
|||
plugins {
|
||||
id("lib-android")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":lib:playlist-utils"))
|
||||
implementation("dev.datlag.jsunpacker:jsunpacker:1.0.1") {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package eu.kanade.tachiyomi.lib.vidoextractor
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
class VidoExtractor(private val client: OkHttpClient) {
|
||||
companion object {
|
||||
private const val VIDO_URL = "https://pink.vido.lol"
|
||||
private val REGEX_ID = Regex("master\\|(.*?)\\|")
|
||||
}
|
||||
|
||||
private val playlistUtils by lazy { PlaylistUtils(client) }
|
||||
|
||||
fun videosFromUrl(url: String, prefix: String = ""): List<Video> {
|
||||
val document = client.newCall(GET(url)).execute().body.string()
|
||||
val id = REGEX_ID.find(document)?.groupValues?.get(1)
|
||||
val masterUrl = "$VIDO_URL/hls/$id/master.m3u8"
|
||||
return playlistUtils.extractFromHls(masterUrl, videoNameGen = { "${prefix}Vido - ($it)" })
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue