forked from AlmightyHak/extensions-source
chore: Sync with latest commits
This commit is contained in:
parent
9b96273df0
commit
56c945d716
115 changed files with 2230 additions and 445 deletions
|
@ -3,11 +3,13 @@ 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.Headers
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
class VidBomExtractor(private val client: OkHttpClient) {
|
||||
fun videosFromUrl(url: String): List<Video> {
|
||||
val doc = client.newCall(GET(url)).execute().asJsoup()
|
||||
fun videosFromUrl(url: String, headers: Headers? = null): List<Video> {
|
||||
val request = if (headers != null) GET(url, headers) else GET(url)
|
||||
val doc = client.newCall(request).execute().asJsoup()
|
||||
val script = doc.selectFirst("script:containsData(sources)")!!
|
||||
val data = script.data().substringAfter("sources: [").substringBefore("],")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue