mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Update 9GoalProvider.kt
This commit is contained in:
parent
4bcc0d5043
commit
68843ba2ba
1 changed files with 16 additions and 10 deletions
|
@ -75,7 +75,7 @@ class NineGoal : MainAPI() {
|
||||||
val matchesData = parseJson<matchesJSON>(app.get("$apiUrl/v1/match/featured").text)
|
val matchesData = parseJson<matchesJSON>(app.get("$apiUrl/v1/match/featured").text)
|
||||||
val liveHomePageList = matchesData.data.filter { it.isLive == true }.map {
|
val liveHomePageList = matchesData.data.filter { it.isLive == true }.map {
|
||||||
LiveSearchResponse(
|
LiveSearchResponse(
|
||||||
it.name.toString(),
|
it.name ?: "",
|
||||||
apiUrl + "/v1/match/" + it.id,
|
apiUrl + "/v1/match/" + it.id,
|
||||||
this@NineGoal.name,
|
this@NineGoal.name,
|
||||||
TvType.Live,
|
TvType.Live,
|
||||||
|
@ -84,7 +84,7 @@ class NineGoal : MainAPI() {
|
||||||
}
|
}
|
||||||
val featuredHomePageList = matchesData.data.filter { it.isLive == false }.map {
|
val featuredHomePageList = matchesData.data.filter { it.isLive == false }.map {
|
||||||
LiveSearchResponse(
|
LiveSearchResponse(
|
||||||
it.name.toString(),
|
it.name ?: "",
|
||||||
apiUrl + "/v1/match/" + it.id,
|
apiUrl + "/v1/match/" + it.id,
|
||||||
this@NineGoal.name,
|
this@NineGoal.name,
|
||||||
TvType.Live,
|
TvType.Live,
|
||||||
|
@ -102,7 +102,7 @@ class NineGoal : MainAPI() {
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val json = parseJson<oneMatch>(app.get(url).text).data
|
val json = parseJson<oneMatch>(app.get(url).text).data
|
||||||
return LiveStreamLoadResponse(
|
return LiveStreamLoadResponse(
|
||||||
json?.name.toString(),
|
json?.name ?: "",
|
||||||
url,
|
url,
|
||||||
this.name,
|
this.name,
|
||||||
"$url/stream",
|
"$url/stream",
|
||||||
|
@ -116,9 +116,15 @@ class NineGoal : MainAPI() {
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val sourcesData = parseJson<sourcesJSON>(app.get(data).text).data
|
val sourcesData = parseJson<sourcesJSON>(app.get(data).text).data
|
||||||
sourcesData?.playUrls?.apmap {
|
sourcesData?.playUrls?.apmap {
|
||||||
var quality = it.name?.substringAfter("(")?.substringBefore(")").toString()
|
val quality = it.name?.substringAfter("(")?.substringBefore(")").let {
|
||||||
val language = it.name?.replace(" ($quality)", "").toString()
|
when (it) {
|
||||||
quality = (if(quality == "Full HD") 1080 else if(quality == "HD") 720 else if(quality == "SD") 480 else Qualities.Unknown.value).toString()
|
"Full HD" -> 1080
|
||||||
|
"HD" -> 720
|
||||||
|
"SD" -> 480
|
||||||
|
else -> Qualities.Unknown.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val language = it.name?.replace(" (${it.name?.substringAfter("(")?.substringBefore(")")})", "") ?: ""
|
||||||
val brokenDomain = "canyou.letmestreamyou.net"
|
val brokenDomain = "canyou.letmestreamyou.net"
|
||||||
if(it.url.toString().startsWith("https://$brokenDomain")) {
|
if(it.url.toString().startsWith("https://$brokenDomain")) {
|
||||||
mapOf(
|
mapOf(
|
||||||
|
@ -132,9 +138,9 @@ class NineGoal : MainAPI() {
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
this.name,
|
this.name,
|
||||||
"$language - ${name}",
|
"$language - ${name}",
|
||||||
it.url.toString().replace(brokenDomain, value),
|
it.url?.replace(brokenDomain, value) ?: "",
|
||||||
"$mainUrl/",
|
"$mainUrl/",
|
||||||
quality.toInt(),
|
quality,
|
||||||
isM3u8 = true,
|
isM3u8 = true,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -144,9 +150,9 @@ class NineGoal : MainAPI() {
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
this.name,
|
this.name,
|
||||||
"$language - ${sourcesData.name}",
|
"$language - ${sourcesData.name}",
|
||||||
it.url.toString(),
|
it.url ?: "",
|
||||||
"$mainUrl/",
|
"$mainUrl/",
|
||||||
quality.toInt(),
|
quality,
|
||||||
isM3u8 = true,
|
isM3u8 = true,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue