Fix Toonitalia + extractors (#1331)
* Update extractors * Add more streamsb links * StreamSB fix
This commit is contained in:
@ -8,6 +8,7 @@ import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
class StreamSBExtractor(private val client: OkHttpClient) {
|
||||
@ -26,11 +27,13 @@ class StreamSBExtractor(private val client: OkHttpClient) {
|
||||
|
||||
// animension, asianload and dramacool uses "common = false"
|
||||
private fun fixUrl(url: String, common: Boolean): String {
|
||||
val sbUrl = url.substringBefore("/e/").substringBefore("/embed-")
|
||||
val id = url.substringAfter("/e/")
|
||||
val sbUrl = "https://${url.toHttpUrl().host}"
|
||||
val id = url.substringAfter("${url.toHttpUrl().host}")
|
||||
.substringAfter("/e/")
|
||||
.substringAfter("/embed-")
|
||||
.substringBefore("?")
|
||||
.substringBefore(".html")
|
||||
.substringAfter("/")
|
||||
return if (common) {
|
||||
val hexBytes = bytesToHex(id.toByteArray())
|
||||
"$sbUrl/sources51/625a364258615242766475327c7c${hexBytes}7c7c4761574550654f7461566d347c7c73747265616d7362"
|
||||
|
Reference in New Issue
Block a user