mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
make it simple
This commit is contained in:
parent
8659300063
commit
1f603490a3
1 changed files with 11 additions and 21 deletions
|
@ -1,6 +1,5 @@
|
||||||
package com.lagradost.cloudstream3.extractors
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.app
|
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
|
||||||
open class ByteShare : ExtractorApi() {
|
open class ByteShare : ExtractorApi() {
|
||||||
|
@ -10,26 +9,17 @@ open class ByteShare : ExtractorApi() {
|
||||||
|
|
||||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
||||||
val sources = mutableListOf<ExtractorLink>()
|
val sources = mutableListOf<ExtractorLink>()
|
||||||
with(app.get(url).document) {
|
val srcIdRegex = Regex("""(?<=/embed/)(.*)(?=\?)""")
|
||||||
this.select("script").map { script ->
|
val srcId = srcIdRegex.find(url)?.groups?.get(1)?.value
|
||||||
if (script.data().contains("'use strict';")) {
|
sources.add(
|
||||||
val data = script.data()
|
ExtractorLink(
|
||||||
.substringAfter("sources: [").substringBefore("]")
|
name,
|
||||||
.replace(" ", "")
|
name,
|
||||||
.substringAfter("src:\"").substringBefore("\",")
|
"$mainUrl/download/$srcId",
|
||||||
sources.add(
|
"",
|
||||||
ExtractorLink(
|
Qualities.Unknown.value,
|
||||||
name,
|
)
|
||||||
name,
|
)
|
||||||
data,
|
|
||||||
"",
|
|
||||||
Qualities.Unknown.value
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sources
|
return sources
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue