mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2935036d1a
7 changed files with 127 additions and 3 deletions
|
@ -21,4 +21,6 @@ cloudstream {
|
|||
"TvSeries",
|
||||
"Movie",
|
||||
)
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=hdmovie2.plus&sz=%size%"
|
||||
}
|
28
TvpolanProvider/build.gradle.kts
Normal file
28
TvpolanProvider/build.gradle.kts
Normal file
|
@ -0,0 +1,28 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
|
||||
dependencies {
|
||||
implementation("me.xdrop:fuzzywuzzy:1.4.0")
|
||||
}
|
||||
|
||||
cloudstream {
|
||||
language = "pl"
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
// description = "Lorem Ipsum"
|
||||
authors = listOf("Cloudburst")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 1
|
||||
tvTypes = listOf(
|
||||
"Live"
|
||||
)
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=tvpolan.ml&sz=%size%"
|
||||
}
|
2
TvpolanProvider/src/main/AndroidManifest.xml
Normal file
2
TvpolanProvider/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
|
@ -0,0 +1,79 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import me.xdrop.fuzzywuzzy.FuzzySearch
|
||||
|
||||
open class TvpolanProvider : MainAPI() {
|
||||
override var mainUrl = "http://tvpolan.ml/"
|
||||
override var name = "TV Polan"
|
||||
override var lang = "pl"
|
||||
override val hasMainPage = true
|
||||
override val supportedTypes = setOf(
|
||||
TvType.Live
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
||||
val document = app.get(mainUrl).document
|
||||
val lists = document.select(".channels ul li a[href]").map { it ->
|
||||
return@map LiveSearchResponse(
|
||||
name = it.attr("title"),
|
||||
url = it.attr("href"),
|
||||
apiName = this.name,
|
||||
type = TvType.Live,
|
||||
posterUrl = it.selectFirst("img[src]")?.attr("src")
|
||||
)
|
||||
}
|
||||
return newHomePageResponse(this.name, lists, false)
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val document = app.get(mainUrl).document
|
||||
val lists = document.select(".channels ul li a[href]").map { it ->
|
||||
return@map LiveSearchResponse(
|
||||
name = it.attr("title"),
|
||||
url = it.attr("href"),
|
||||
apiName = this.name,
|
||||
type = TvType.Live,
|
||||
posterUrl = it.selectFirst("img[src]")?.attr("src")
|
||||
)
|
||||
}
|
||||
return lists.sortedBy { -FuzzySearch.ratio(it.name, query) }
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse? {
|
||||
val document = app.get(url).document
|
||||
|
||||
val name = Regex("http://tvpolen\\.ml/(.+)\\.php").find(url)?.groupValues?.get(1) ?: this.name
|
||||
|
||||
val src = document.selectFirst("video source[src]")?.attr("src") ?: return null
|
||||
|
||||
return LiveStreamLoadResponse(
|
||||
name,
|
||||
url,
|
||||
this.name,
|
||||
src,
|
||||
"http://tvpolen.ml/tv/${name}.png"
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
"tvpolen.ml",
|
||||
this.name,
|
||||
data,
|
||||
"",
|
||||
Qualities.Unknown.value,
|
||||
isM3u8 = true
|
||||
)
|
||||
)
|
||||
return true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class TvpolanProviderPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
registerMainAPI(TvpolanProvider())
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
version = 2
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
@ -22,5 +22,5 @@ cloudstream {
|
|||
"Movie",
|
||||
)
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=yomovies.skin&sz=%size%"
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=yomovies.ink&sz=%size%"
|
||||
}
|
|
@ -9,7 +9,7 @@ import com.lagradost.cloudstream3.utils.loadExtractor
|
|||
import org.jsoup.nodes.Element
|
||||
|
||||
class YomoviesProvider : MainAPI() {
|
||||
override var mainUrl = "https://yomovies.skin"
|
||||
override var mainUrl = "https://yomovies.ink"
|
||||
override var name = "Yomovies"
|
||||
override val hasMainPage = true
|
||||
override var lang = "hi"
|
||||
|
|
Loading…
Reference in a new issue