forked from AlmightyHak/extensions-source
Initial commit
This commit is contained in:
commit
98ed7e8839
2263 changed files with 108711 additions and 0 deletions
3
lib/vidbom-extractor/build.gradle.kts
Normal file
3
lib/vidbom-extractor/build.gradle.kts
Normal file
|
@ -0,0 +1,3 @@
|
|||
plugins {
|
||||
id("lib-android")
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package eu.kanade.tachiyomi.lib.vidbomextractor
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
class VidBomExtractor(private val client: OkHttpClient) {
|
||||
fun videosFromUrl(url: String): List<Video> {
|
||||
val doc = client.newCall(GET(url)).execute().asJsoup()
|
||||
val script = doc.selectFirst("script:containsData(sources)")!!
|
||||
val data = script.data().substringAfter("sources: [").substringBefore("],")
|
||||
|
||||
return data.split("file:\"").drop(1).map { source ->
|
||||
val src = source.substringBefore("\"")
|
||||
var quality = "Vidbom: " + source.substringAfter("label:\"").substringBefore("\"")
|
||||
if (quality.length > 15) {
|
||||
quality = "Vidshare: 480p"
|
||||
}
|
||||
Video(src, quality, src)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue