add byteshare extractor

This commit is contained in:
LiJu09 2023-01-26 22:00:49 +01:00
parent 01f1edab3c
commit e375da6365
No known key found for this signature in database
GPG key ID: EECD727AC71F45F4
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
open class ByteShare : ExtractorApi() {
override val name = "ByteShare"
override val mainUrl = "https://byteshare.net"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
with(app.get(url).document) {
this.select("script").map { script ->
if (script.data().contains("'use strict';")) {
val data = script.data()
.substringAfter("sources: [").substringBefore("]")
.replace(" ","")
.substringAfter("src:\"").substringBefore("\",")
sources.add(ExtractorLink(
name,
name,
data,
"",
Qualities.Unknown.value
))
}
}
}
return sources
}
}

View file

@ -361,6 +361,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Cda(), Cda(),
Dailymotion(), Dailymotion(),
ByteShare(),
) )