cloudstream-extensions-hexated/UseeTv/src/main/kotlin/com/hexated/UseeTv.kt

94 lines
3.0 KiB
Kotlin
Raw Permalink Normal View History

2022-09-09 16:09:54 +00:00
package com.hexated
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
import org.jsoup.nodes.Element
class UseeTv : MainAPI() {
Adityajd patch 1 (#616) * Update RebahinProvider.kt * Update LayarKacaProvider.kt update main url ="https://tv3.lk21official.wiki" change to "https://tv4.lk21official.wiki" * Update LayarKacaProvider.kt * Update Dubbindo.kt update domain * Update Cgvindo.kt * Update DramaidProvider.kt * Update DutaMovie.kt * Update Ngefilm.kt * Update Pusatfilm.kt * Update LayarKacaProvider.kt * Update build.gradle.kts * Update RebahinProvider.kt * Update DutaMovie.kt Update mainurl * Update build.gradle.kts * Update Ngefilm.kt * Update DramaSerial.kt * Update Nodrakorid.kt update mainurl * Update Pusatfilm.kt update mainurl * Update DramaSerial.kt update serverurl http://31.220.73.179/ * Update build.gradle.kts * Update LayarKacaProvider.kt update mainurl * Update DutaMovie.kt update mainurl * Update Pusatfilm.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Ngefilm.kt update mainurl * Update DutaMovie.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Pusatfilm.kt update mainurl * Update build.gradle.kts * Update LayarKacaProvider.kt update mainUrl update seriesUrl * Update UseeTv.kt update mainurl * Update Multiplex.kt fix indofilm * Update LayarKacaProvider.kt Update main url * Update build.gradle.kts Domain * Update DutaMovie.kt Update mainurl * Update Gomov.kt Update mainurl * Update Multiplex.kt Update mainurl * Update Ngefilm.kt Update mainurl * Update Pusatfilm.kt Update mainurl * Update Cgvindo.kt Update mainurl * Update Kitanonton.kt Update mainurl * Update RebahinProvider.kt Update mainurl * Update Pusatfilm.kt change to old mainurl
2024-02-29 21:27:45 +00:00
override var mainUrl = "https://www.indihometv.com/"
2022-09-09 16:09:54 +00:00
override var name = "Useetv"
override var lang = "id"
override val hasDownloadSupport = false
override val hasMainPage = true
override val supportedTypes = setOf(
TvType.Live
)
companion object {
Adityajd patch 1 (#616) * Update RebahinProvider.kt * Update LayarKacaProvider.kt update main url ="https://tv3.lk21official.wiki" change to "https://tv4.lk21official.wiki" * Update LayarKacaProvider.kt * Update Dubbindo.kt update domain * Update Cgvindo.kt * Update DramaidProvider.kt * Update DutaMovie.kt * Update Ngefilm.kt * Update Pusatfilm.kt * Update LayarKacaProvider.kt * Update build.gradle.kts * Update RebahinProvider.kt * Update DutaMovie.kt Update mainurl * Update build.gradle.kts * Update Ngefilm.kt * Update DramaSerial.kt * Update Nodrakorid.kt update mainurl * Update Pusatfilm.kt update mainurl * Update DramaSerial.kt update serverurl http://31.220.73.179/ * Update build.gradle.kts * Update LayarKacaProvider.kt update mainurl * Update DutaMovie.kt update mainurl * Update Pusatfilm.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Ngefilm.kt update mainurl * Update DutaMovie.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Pusatfilm.kt update mainurl * Update build.gradle.kts * Update LayarKacaProvider.kt update mainUrl update seriesUrl * Update UseeTv.kt update mainurl * Update Multiplex.kt fix indofilm * Update LayarKacaProvider.kt Update main url * Update build.gradle.kts Domain * Update DutaMovie.kt Update mainurl * Update Gomov.kt Update mainurl * Update Multiplex.kt Update mainurl * Update Ngefilm.kt Update mainurl * Update Pusatfilm.kt Update mainurl * Update Cgvindo.kt Update mainurl * Update Kitanonton.kt Update mainurl * Update RebahinProvider.kt Update mainurl * Update Pusatfilm.kt change to old mainurl
2024-02-29 21:27:45 +00:00
private const val mainLink = "https://www.indihometv.com/"
2022-09-09 16:09:54 +00:00
}
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val document = app.get("$mainUrl/tv/live").document
val home = listOf(
Pair("col-xs-4", "Semua"),
Pair("local", "Local"),
Pair("news", "News"),
).map { (soap,name) ->
val home = document.select("div#channelContainer div.col-channel").mapNotNull { it }.filter {
it.attr("class").contains(soap, true)
}.mapNotNull {
it.toSearchResult()
}
HomePageList(name, home, true)
}.filter { it.list.isNotEmpty() }
return HomePageResponse(home)
}
private fun Element.toSearchResult(): LiveSearchResponse? {
return LiveSearchResponse(
this.selectFirst("a")?.attr("data-name") ?: return null,
fixUrl(this.selectFirst("a")!!.attr("href")),
this@UseeTv.name,
TvType.Live,
fixUrlNull(this.select("img").attr("data-src")),
)
}
override suspend fun search(query: String): List<SearchResponse> {
return app.get("$mainUrl/tv/live").document.select("div#channelContainer div.col-channel").mapNotNull {
it
}.filter { it.select("a").attr("data-name").contains(query, true) }.mapNotNull {
it.toSearchResult()
}
}
override suspend fun load(url: String): LoadResponse? {
val document = app.get(url).document
val content = document.selectFirst("div.d-flex.video-schedule-time p")?.text()?.split("")
val link = document.select("script").findLast { it.data().contains("\$('.live').last()") }?.data()?.let{
Regex("'$mainLink(.*)';var").find(it)?.groupValues?.getOrNull(1)
}
return LiveStreamLoadResponse(
content?.firstOrNull()?.trim() ?: return null,
url,
this.name,
"$mainLink$link",
fixUrlNull(document.selectFirst("div.row.video-schedule img")?.attr("src")),
plot = document.selectFirst("title")?.text()
)
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
M3u8Helper.generateM3u8(
this.name,
data,
mainUrl
).forEach(callback)
return true
}
Adityajd patch 1 (#616) * Update RebahinProvider.kt * Update LayarKacaProvider.kt update main url ="https://tv3.lk21official.wiki" change to "https://tv4.lk21official.wiki" * Update LayarKacaProvider.kt * Update Dubbindo.kt update domain * Update Cgvindo.kt * Update DramaidProvider.kt * Update DutaMovie.kt * Update Ngefilm.kt * Update Pusatfilm.kt * Update LayarKacaProvider.kt * Update build.gradle.kts * Update RebahinProvider.kt * Update DutaMovie.kt Update mainurl * Update build.gradle.kts * Update Ngefilm.kt * Update DramaSerial.kt * Update Nodrakorid.kt update mainurl * Update Pusatfilm.kt update mainurl * Update DramaSerial.kt update serverurl http://31.220.73.179/ * Update build.gradle.kts * Update LayarKacaProvider.kt update mainurl * Update DutaMovie.kt update mainurl * Update Pusatfilm.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Ngefilm.kt update mainurl * Update DutaMovie.kt update mainurl * Update Multiplex.kt update mainurl * Update Ngefilm.kt update mainurl * Update Pusatfilm.kt update mainurl * Update build.gradle.kts * Update LayarKacaProvider.kt update mainUrl update seriesUrl * Update UseeTv.kt update mainurl * Update Multiplex.kt fix indofilm * Update LayarKacaProvider.kt Update main url * Update build.gradle.kts Domain * Update DutaMovie.kt Update mainurl * Update Gomov.kt Update mainurl * Update Multiplex.kt Update mainurl * Update Ngefilm.kt Update mainurl * Update Pusatfilm.kt Update mainurl * Update Cgvindo.kt Update mainurl * Update Kitanonton.kt Update mainurl * Update RebahinProvider.kt Update mainurl * Update Pusatfilm.kt change to old mainurl
2024-02-29 21:27:45 +00:00
}