mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Fix CalcioStreaming, Starlive and Domain changes (#77)
Co-authored-by: contusionglory <102427829+contusionglory@users.noreply.github.com>
This commit is contained in:
parent
e9ff7909ff
commit
e9247d553f
12 changed files with 118 additions and 101 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.lagradost
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
|
||||||
class CalcioStreamingProvider : MainAPI() {
|
class CalcioStreamingProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
|
@ -58,12 +58,21 @@ class CalcioStreamingProvider : MainAPI() {
|
||||||
poster,
|
poster,
|
||||||
plot = Matchstart
|
plot = Matchstart
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun matchFound(document: Document) : Boolean {
|
||||||
|
return Regex(""""((.|\n)*?).";""").containsMatchIn(
|
||||||
|
getAndUnpack(
|
||||||
|
document.toString()
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getUrl(document: Document):String{
|
||||||
|
return Regex(""""((.|\n)*?).";""").find(
|
||||||
|
getAndUnpack(
|
||||||
|
document.toString()
|
||||||
|
))!!.value.replace("""src="""", "").replace(""""""", "").replace(";", "")
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun extractVideoLinks(
|
private suspend fun extractVideoLinks(
|
||||||
url: String,
|
url: String,
|
||||||
|
@ -71,27 +80,30 @@ class CalcioStreamingProvider : MainAPI() {
|
||||||
) {
|
) {
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
document.select("button.btn").forEach { button ->
|
document.select("button.btn").forEach { button ->
|
||||||
val link1 = button.attr("data-link")
|
var link = button.attr("data-link")
|
||||||
val doc2 = app.get(link1).document
|
var oldLink = link
|
||||||
val truelink = doc2.selectFirst("iframe")!!.attr("src")
|
var videoNotFound = true
|
||||||
val newpage = app.get(truelink, referer = link1).document
|
while (videoNotFound) {
|
||||||
val streamurl = Regex(""""((.|\n)*?).";""").find(
|
val doc = app.get(link).document
|
||||||
getAndUnpack(
|
link = doc.selectFirst("iframe")?.attr("src") ?: break
|
||||||
newpage.select("script")[6].childNode(0).toString()
|
val newpage = app.get(fixUrl(link), referer = oldLink).document
|
||||||
))!!.value.replace("""src="""", "").replace(""""""", "").replace(";", "")
|
oldLink = link
|
||||||
|
if (newpage.select("script").size >= 6 && matchFound(newpage)){
|
||||||
|
videoNotFound = false
|
||||||
callback(
|
callback(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
this.name,
|
this.name,
|
||||||
button.text(),
|
button.text(),
|
||||||
streamurl,
|
getUrl(newpage),
|
||||||
truelink,
|
fixUrl(link),
|
||||||
quality = 0,
|
quality = 0,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override suspend fun loadLinks(
|
override suspend fun loadLinks(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class CineBlog01Provider : MainAPI() {
|
class CineBlog01Provider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://www.cineblog01.moe"
|
override var mainUrl = "https://www.cineblog01.mom"
|
||||||
override var name = "CineBlog01"
|
override var name = "CineBlog01"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
language = "it"
|
language = "it"
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class EurostreamingProvider : MainAPI() {
|
class EurostreamingProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://eurostreaming.taxi"
|
override var mainUrl = "https://eurostreaming.expert"
|
||||||
override var name = "Eurostreaming"
|
override var name = "Eurostreaming"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||||
|
|
||||||
class FilmpertuttiProvider : MainAPI() {
|
class FilmpertuttiProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://filmpertutti.skin"
|
override var mainUrl = "https://filmpertutti.tips"
|
||||||
override var name = "FilmPerTutti"
|
override var name = "FilmPerTutti"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -2,9 +2,11 @@ package com.lagradost
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class StarLiveProvider : MainAPI() {
|
class StarLiveProvider : MainAPI() {
|
||||||
override var mainUrl = "https://starlive.xyz"
|
override var mainUrl = "https://starlive.xyz"
|
||||||
|
@ -13,73 +15,52 @@ class StarLiveProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
override val supportedTypes = setOf(TvType.Live)
|
override val supportedTypes = setOf(TvType.Live)
|
||||||
|
private val interceptor = CloudflareKiller()
|
||||||
private data class LinkParser(
|
|
||||||
@JsonProperty("link") val link: String,
|
|
||||||
@JsonProperty("lang") val language: String,
|
|
||||||
@JsonProperty("name") val name: String
|
|
||||||
)
|
|
||||||
|
|
||||||
private data class MatchDataParser(
|
|
||||||
@JsonProperty("time") val time: String,
|
|
||||||
@JsonProperty("poster") val poster: String
|
|
||||||
)
|
|
||||||
|
|
||||||
private data class MatchParser(
|
|
||||||
@JsonProperty("linkData") val linkData: List<LinkParser>,
|
|
||||||
@JsonProperty("matchData") val MatchData: MatchDataParser
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
val document = app.get(mainUrl).document
|
val document = app.get(mainUrl, interceptor = interceptor).document
|
||||||
val sections = document.select("div.panel")
|
val sections = document.select("div.panel").groupBy { it.selectFirst("h4 b")?.text() }.values
|
||||||
if (sections.isEmpty()) throw ErrorLoadingException()
|
if (sections.isEmpty()) throw ErrorLoadingException()
|
||||||
|
val prova = sections.map {elements ->
|
||||||
|
val home = elements.mapNotNull { it.toMainPageResult() }
|
||||||
|
HomePageList(elements.first()?.selectFirst("h4 b")?.text()?:"Altro", home)
|
||||||
|
}
|
||||||
|
return HomePageResponse(prova)
|
||||||
|
}
|
||||||
|
|
||||||
return HomePageResponse(sections.mapNotNull { sport ->
|
private fun Element.toMainPageResult() : LiveSearchResponse {
|
||||||
val dayMatch = sport.previousElementSiblings().toList().first { it.`is`("h3") }.text()
|
val name = this.selectFirst("b")?.text()?:"Altro"
|
||||||
val categoryName = sport.selectFirst("h4")?.text() ?: "Other"
|
val links = this.select("tr")
|
||||||
|
.toList()
|
||||||
|
.filter { it.hasAttr("class") && it.attr("class") !in listOf("", "audio") }
|
||||||
|
.map { LinkParser(
|
||||||
|
fixUrl(it.selectFirst("a")?.attr("href")?:""),
|
||||||
|
it.attr("class"),
|
||||||
|
it.selectFirst("span")?.text()?:""
|
||||||
|
) }
|
||||||
|
val dayMatch = this.previousElementSiblings().toList().firstOrNull() { it.`is`("h3") }?.text()
|
||||||
|
|
||||||
val showsList = sport.select("tr").takeWhile { it.text().contains("Player").not() }
|
val matchData = MatchDataParser(
|
||||||
.filter { it.hasAttr("class") }.drop(1)
|
dayMatch?.plus(" - ".plus(this.selectFirst("#evento")?.text()?.substringBefore(" ")))?:"no data",
|
||||||
|
fixUrl(
|
||||||
val shows = showsList.groupBy { it.text().substringBeforeLast(" ") }.map { matchs ->
|
this.selectFirst("h4")?.attr("style")
|
||||||
val posterUrl = fixUrl(
|
|
||||||
sport.selectFirst("h4")?.attr("style")
|
|
||||||
?.substringAfter("(")?.substringBefore(")") ?: ""
|
?.substringAfter("(")?.substringBefore(")") ?: ""
|
||||||
|
),
|
||||||
|
this.selectFirst("#evento")?.text()?.substringAfter(" ")?:"Match in $name || $dayMatch"
|
||||||
)
|
)
|
||||||
val hasDate = matchs.key.contains(":")
|
val href = MatchParser(links, matchData)
|
||||||
val matchName = if (hasDate) { matchs.key.substringAfter(" ")}
|
return LiveSearchResponse(
|
||||||
else { matchs.key }
|
this.selectFirst("#evento")?.text()?.substringAfter(" ")?:"Match in $name",
|
||||||
|
href.toJson(),
|
||||||
val href = matchs.value.map { match ->
|
|
||||||
val linkUrl = fixUrl(match.selectFirst("a")?.attr("href") ?: return@mapNotNull null)
|
|
||||||
val lang = match.attr("class")
|
|
||||||
LinkParser(linkUrl, lang, matchName)
|
|
||||||
}
|
|
||||||
|
|
||||||
val date = if (hasDate) {
|
|
||||||
dayMatch + " - " + matchs.key.substringBefore(" ")
|
|
||||||
} else {
|
|
||||||
dayMatch
|
|
||||||
}
|
|
||||||
|
|
||||||
LiveSearchResponse(
|
|
||||||
matchName,
|
|
||||||
MatchParser(href, MatchDataParser(date, posterUrl)).toJson(),
|
|
||||||
this@StarLiveProvider.name,
|
this@StarLiveProvider.name,
|
||||||
TvType.Live,
|
TvType.Live,
|
||||||
posterUrl,
|
fixUrl(
|
||||||
|
this.selectFirst("h4")?.attr("style")
|
||||||
|
?.substringAfter("(")?.substringBefore(")") ?: ""
|
||||||
|
),
|
||||||
|
posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
HomePageList(
|
|
||||||
categoryName,
|
|
||||||
shows
|
|
||||||
)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val matchdata = tryParseJson<MatchParser>(url)
|
val matchdata = tryParseJson<MatchParser>(url)
|
||||||
|
@ -88,10 +69,11 @@ class StarLiveProvider : MainAPI() {
|
||||||
return LiveStreamLoadResponse(
|
return LiveStreamLoadResponse(
|
||||||
dataUrl = url,
|
dataUrl = url,
|
||||||
url = matchdata?.linkData?.firstOrNull()?.link ?: mainUrl,
|
url = matchdata?.linkData?.firstOrNull()?.link ?: mainUrl,
|
||||||
name = matchdata?.linkData?.firstOrNull()?.name ?: "No name",
|
name = matchdata?.MatchData?.name ?: "No name",
|
||||||
posterUrl = poster,
|
posterUrl = poster,
|
||||||
plot = matchstart,
|
plot = matchstart,
|
||||||
apiName = this@StarLiveProvider.name
|
apiName = this@StarLiveProvider.name,
|
||||||
|
posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +81,10 @@ class StarLiveProvider : MainAPI() {
|
||||||
data: LinkParser,
|
data: LinkParser,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val linktoStream = fixUrl(app.get(data.link).document.selectFirst("iframe")!!.attr("src"))
|
val linktoStream = fixUrl(app.get(data.link, interceptor = interceptor).document.selectFirst("iframe")!!.attr("src"))
|
||||||
|
|
||||||
val referrerLink = if (linktoStream.contains("starlive")) {
|
val referrerLink = if (linktoStream.contains("starlive")) {
|
||||||
app.get(linktoStream, referer = data.link).document.selectFirst("iframe")?.attr("src")
|
app.get(linktoStream, referer = data.link, interceptor = interceptor).document.selectFirst("iframe")?.attr("src")
|
||||||
?: return
|
?: linktoStream
|
||||||
} else {
|
} else {
|
||||||
linktoStream
|
linktoStream
|
||||||
}
|
}
|
||||||
|
@ -115,7 +96,13 @@ class StarLiveProvider : MainAPI() {
|
||||||
false -> app.get(linktoStream, referer = data.link).document.select("script")
|
false -> app.get(linktoStream, referer = data.link).document.select("script")
|
||||||
.select("script").toString()
|
.select("script").toString()
|
||||||
}
|
}
|
||||||
val streamUrl = getAndUnpack(packed).substringAfter("var src=\"").substringBefore("\"")
|
var streamUrl = getAndUnpack(packed).substringAfter("var src=\"").substringBefore("\"")
|
||||||
|
if (streamUrl.contains("allowedDomains")){streamUrl = packed.substringAfter("source:'").substringBefore("'")}
|
||||||
|
if (!streamUrl.contains("m3u8")){
|
||||||
|
val script = app.get(linktoStream, referer = data.link, interceptor = interceptor).document.selectFirst("body")?.selectFirst("script").toString()
|
||||||
|
streamUrl = Regex("source: [\\\"'](.*?)[\\\"']").find(script)?.groupValues?.last()?:""
|
||||||
|
}
|
||||||
|
|
||||||
callback(
|
callback(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
source = this.name,
|
source = this.name,
|
||||||
|
@ -142,4 +129,22 @@ class StarLiveProvider : MainAPI() {
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class LinkParser(
|
||||||
|
@JsonProperty("link") val link: String,
|
||||||
|
@JsonProperty("lang") val language: String,
|
||||||
|
@JsonProperty("name") val name: String
|
||||||
|
)
|
||||||
|
|
||||||
|
private data class MatchDataParser(
|
||||||
|
@JsonProperty("time") val time: String,
|
||||||
|
@JsonProperty("poster") val poster: String,
|
||||||
|
@JsonProperty("name") val name: String
|
||||||
|
)
|
||||||
|
|
||||||
|
private data class MatchParser(
|
||||||
|
@JsonProperty("linkData") val linkData: List<LinkParser>,
|
||||||
|
@JsonProperty("matchData") val MatchData: MatchDataParser
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||||
|
|
||||||
class TantifilmProvider : MainAPI() {
|
class TantifilmProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://tantifilm.mobi"
|
override var mainUrl = "https://tantifilm.recipes"
|
||||||
override var name = "Tantifilm"
|
override var name = "Tantifilm"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
|
Loading…
Reference in a new issue