diff --git a/KisskhProvider/build.gradle.kts b/KisskhProvider/build.gradle.kts index 83fa73d..2a84159 100644 --- a/KisskhProvider/build.gradle.kts +++ b/KisskhProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 1 +version = 2 cloudstream { @@ -7,7 +7,7 @@ cloudstream { // All of these properties are optional, you can safely remove them // description = "Lorem Ipsum" - // authors = listOf("Cloudburst") + authors = listOf("Hexated") /** * Status int as the following: diff --git a/KisskhProvider/src/main/kotlin/com/lagradost/KisskhProvider.kt b/KisskhProvider/src/main/kotlin/com/lagradost/KisskhProvider.kt index 940bb19..837abed 100644 --- a/KisskhProvider/src/main/kotlin/com/lagradost/KisskhProvider.kt +++ b/KisskhProvider/src/main/kotlin/com/lagradost/KisskhProvider.kt @@ -28,6 +28,8 @@ class KisskhProvider : MainAPI() { "&type=1&sub=0&country=2&status=0&order=2" to "TVSeries Last Update", "&type=3&sub=0&country=0&status=0&order=1" to "Anime Popular", "&type=3&sub=0&country=0&status=0&order=2" to "Anime Last Update", + "&type=4&sub=0&country=0&status=0&order=1" to "Hollywood Popular", + "&type=4&sub=0&country=0&status=0&order=2" to "Hollywood Last Update", ) override suspend fun getMainPage( diff --git a/Tvtwofourseven/build.gradle.kts b/Tvtwofourseven/build.gradle.kts new file mode 100644 index 0000000..fa8d9cb --- /dev/null +++ b/Tvtwofourseven/build.gradle.kts @@ -0,0 +1,22 @@ +// use an integer for version numbers +version = 1 + + +cloudstream { + language = "en" + // All of these properties are optional, you can safely remove them + + // description = "Lorem Ipsum" + authors = listOf("Hexated") + + /** + * Status int as the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta only + * */ + status = 1 // will be 3 if unspecified + tvTypes = listOf("Live") + iconUrl = "https://www.google.com/s2/favicons?domain=tv247.us&sz=%size%" +} \ No newline at end of file diff --git a/Tvtwofourseven/src/main/AndroidManifest.xml b/Tvtwofourseven/src/main/AndroidManifest.xml new file mode 100644 index 0000000..29aec9d --- /dev/null +++ b/Tvtwofourseven/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Tvtwofourseven/src/main/kotlin/com/lagradost/Tvtwofourseven.kt b/Tvtwofourseven/src/main/kotlin/com/lagradost/Tvtwofourseven.kt new file mode 100644 index 0000000..8eb9a6f --- /dev/null +++ b/Tvtwofourseven/src/main/kotlin/com/lagradost/Tvtwofourseven.kt @@ -0,0 +1,114 @@ +package com.lagradost + +import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.M3u8Helper +import com.lagradost.cloudstream3.utils.Qualities +import org.jsoup.nodes.Element +import java.net.URI + +class Tvtwofourseven : MainAPI() { + override var mainUrl = "http://tv247.us" + override var name = "Tv247" + override val hasDownloadSupport = false + override val hasMainPage = true + override val supportedTypes = setOf( + TvType.Live + ) + + override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { + val home = listOf( + Pair("$mainUrl/top-channels", "Top Channels"), + Pair("$mainUrl/all-channels", "All Channels") + ).apmap { (url,name) -> + val home = + app.get(url).document.select("div.grid-items div.item").mapNotNull { item -> + item.toSearchResult() + } + HomePageList(name, home) + }.filter { it.list.isNotEmpty() } + return HomePageResponse(home) + } + + private fun Element.toSearchResult(): LiveSearchResponse? { + return LiveSearchResponse( + this.selectFirst("div.layer-content a")?.text() ?: return null, + fixUrlNull(this.selectFirst("a")?.attr("href")) ?: return null, + this@Tvtwofourseven.name, + TvType.Live, + fixUrlNull(this.select("img").attr("src")), + ) + + } + + override suspend fun search(query: String): List { + return app.post( + "$mainUrl/wp-admin/admin-ajax.php", data = mapOf( + "action" to "ajaxsearchlite_search", + "aslp" to query, + "asid" to "1", + "options" to "qtranslate_lang=0&set_intitle=None&set_incontent=None&set_inposts=None" + ), + headers = mapOf("X-Requested-With" to "XMLHttpRequest") + ).document.select("div.item").mapNotNull { + LiveSearchResponse( + it.selectFirst("a")?.text() ?: return@mapNotNull null, + fixUrl(it.selectFirst("a")!!.attr("href")), + this@Tvtwofourseven.name, + TvType.Live, + fixUrlNull( + it.select("div.asl_image").attr("style").substringAfter("url(\"") + .substringBefore("\");") + ) + ) + } + } + + override suspend fun load(url: String): LoadResponse? { + val document = app.get(url).document + val data = + document.select("script").find { it.data().contains("var channelName =") }?.data() + val baseUrl = data?.substringAfter("baseUrl = \"")?.substringBefore("\";") + val channel = data?.substringAfter("var channelName = \"")?.substringBefore("\";") + return LiveStreamLoadResponse( + document.selectFirst("title")?.text()?.split("-")?.first()?.trim() ?: return null, + url, + this.name, + "$baseUrl$channel.m3u8", + fixUrlNull(document.selectFirst("img.aligncenter.jetpack-lazy-image")?.attr("src")), + plot = document.select("address").text() + ) + } + + override suspend fun loadLinks( + data: String, + isCasting: Boolean, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ): Boolean { + + if (URI(data).host == "cdn.espnfree.xyz") { + M3u8Helper.generateM3u8( + this.name, + data, + "$mainUrl/", + headers = mapOf("Origin" to mainUrl, "X-Cache" to "HIT"), + ).forEach(callback) + } else { + callback.invoke( + ExtractorLink( + source = name, + name = name, + url = data, + referer = "$mainUrl/", + quality = Qualities.Unknown.value, + isM3u8 = true, + headers = mapOf("Origin" to mainUrl) + ) + ) + } + + return true + + } +} \ No newline at end of file diff --git a/Tvtwofourseven/src/main/kotlin/com/lagradost/TvtwofoursevenPlugin.kt b/Tvtwofourseven/src/main/kotlin/com/lagradost/TvtwofoursevenPlugin.kt new file mode 100644 index 0000000..c9f7ef9 --- /dev/null +++ b/Tvtwofourseven/src/main/kotlin/com/lagradost/TvtwofoursevenPlugin.kt @@ -0,0 +1,14 @@ + +package com.lagradost + +import com.lagradost.cloudstream3.plugins.CloudstreamPlugin +import com.lagradost.cloudstream3.plugins.Plugin +import android.content.Context + +@CloudstreamPlugin +class TvtwofoursevenPlugin: Plugin() { + override fun load(context: Context) { + // All providers should be added in this manner. Please don't edit the providers list directly. + registerMainAPI(Tvtwofourseven()) + } +} \ No newline at end of file