mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d542b2a177
6 changed files with 218 additions and 41 deletions
|
@ -1,7 +1,6 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
language = "it"
|
language = "it"
|
||||||
// All of these properties are optional, you can safely remove them
|
// All of these properties are optional, you can safely remove them
|
||||||
|
|
|
@ -5,7 +5,9 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
|
import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||||
|
import okhttp3.FormBody
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class EurostreamingProvider : MainAPI() {
|
class EurostreamingProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
|
@ -13,62 +15,58 @@ class EurostreamingProvider : MainAPI() {
|
||||||
override var name = "Eurostreaming"
|
override var name = "Eurostreaming"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
private val interceptor = CloudflareKiller()
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.TvSeries
|
TvType.TvSeries
|
||||||
)
|
)
|
||||||
|
|
||||||
override val mainPage = mainPageOf(
|
override val mainPage = mainPageOf(
|
||||||
Pair("$mainUrl/serie-tv-archive/page/", "Ultime serie Tv"),
|
"$mainUrl/serie-tv-archive/page/" to "Ultime serie Tv",
|
||||||
Pair("$mainUrl/animazione/page/", "Ultime serie Animazione"),
|
"$mainUrl/animazione/page/" to "Ultime serie Animazione",
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
val url = request.data + page
|
val url = request.data + page
|
||||||
|
|
||||||
val soup = app.get(url).document
|
val soup = app.get(url, interceptor = interceptor).document
|
||||||
val home = soup.select("div.post-thumb").map {
|
val home = soup.select("div.post-thumb").mapNotNull {
|
||||||
val title = it.selectFirst("img")!!.attr("alt")
|
it.toSearchResult()
|
||||||
val link = it.selectFirst("a")!!.attr("href")
|
}
|
||||||
val image = fixUrl(it.selectFirst("img")!!.attr("src"))
|
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true)
|
||||||
|
}
|
||||||
MovieSearchResponse(
|
|
||||||
title,
|
private fun Element.toSearchResult(): SearchResponse? {
|
||||||
link,
|
val title = this.selectFirst("a")?.attr("title") ?: return null
|
||||||
this.name,
|
val link = this.selectFirst("a")?.attr("href") ?: return null
|
||||||
TvType.Movie,
|
val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim())
|
||||||
image
|
|
||||||
)
|
return newTvSeriesSearchResponse(title, link, TvType.TvSeries){
|
||||||
|
this.posterUrl = image
|
||||||
|
this.posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
|
||||||
}
|
}
|
||||||
return newHomePageResponse(request.name, home)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val doc = app.post(
|
val body = FormBody.Builder()
|
||||||
"$mainUrl/index.php", data = mapOf(
|
.addEncoded("do", "search")
|
||||||
"do" to "search",
|
.addEncoded("subaction", "search")
|
||||||
"subaction" to "search",
|
.addEncoded("story", query)
|
||||||
"story" to query,
|
.addEncoded("sortby", "news_read")
|
||||||
"sortby" to "news_read"
|
.build()
|
||||||
)
|
|
||||||
).document
|
|
||||||
return doc.select("div.post-thumb").map {
|
|
||||||
val title = it.selectFirst("img")!!.attr("alt")
|
|
||||||
val link = it.selectFirst("a")!!.attr("href")
|
|
||||||
val image = mainUrl + it.selectFirst("img")!!.attr("src")
|
|
||||||
|
|
||||||
MovieSearchResponse(
|
val doc = app.post(
|
||||||
title,
|
"$mainUrl/index.php",
|
||||||
link,
|
requestBody = body,
|
||||||
this.name,
|
interceptor = interceptor
|
||||||
TvType.Movie,
|
).document
|
||||||
image
|
|
||||||
)
|
return doc.select("div.post-thumb").mapNotNull {
|
||||||
|
it?.toSearchResult()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val page = app.get(url)
|
val page = app.get(url, interceptor = interceptor)
|
||||||
val document = page.document
|
val document = page.document
|
||||||
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
|
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
|
||||||
val style = document.selectFirst("div.entry-cover")!!.attr("style")
|
val style = document.selectFirst("div.entry-cover")!!.attr("style")
|
||||||
|
@ -93,7 +91,8 @@ class EurostreamingProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
|
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
|
||||||
posterUrl = poster
|
this.posterUrl = poster
|
||||||
|
this.posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
12
NineGoalProvider/build.gradle.kts
Normal file
12
NineGoalProvider/build.gradle.kts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
cloudstream {
|
||||||
|
description = ""
|
||||||
|
authors = listOf( "ImZaw" )
|
||||||
|
|
||||||
|
status = 1
|
||||||
|
|
||||||
|
tvTypes = listOf( "Live" )
|
||||||
|
|
||||||
|
iconUrl = "https://media.discordapp.net/attachments/1027568249900109875/1046110428402561025/JK8J1KX.png?width=%size%&height=%size%"
|
||||||
|
}
|
2
NineGoalProvider/src/main/AndroidManifest.xml
Normal file
2
NineGoalProvider/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="com.ninegoal"/>
|
12
NineGoalProvider/src/main/kotlin/com/ninegoal/9GoalPlugin.kt
Normal file
12
NineGoalProvider/src/main/kotlin/com/ninegoal/9GoalPlugin.kt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package com.ninegoal
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||||
|
import com.lagradost.cloudstream3.plugins.Plugin
|
||||||
|
import android.content.Context
|
||||||
|
|
||||||
|
@CloudstreamPlugin
|
||||||
|
class NineGoalPlugin: Plugin() {
|
||||||
|
override fun load(context: Context) {
|
||||||
|
registerMainAPI(NineGoal())
|
||||||
|
}
|
||||||
|
}
|
153
NineGoalProvider/src/main/kotlin/com/ninegoal/9GoalProvider.kt
Normal file
153
NineGoalProvider/src/main/kotlin/com/ninegoal/9GoalProvider.kt
Normal file
|
@ -0,0 +1,153 @@
|
||||||
|
package com.ninegoal
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||||
|
import com.lagradost.cloudstream3.utils.Qualities
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
data class Data (
|
||||||
|
@JsonProperty("id" ) var id : String? = null,
|
||||||
|
@JsonProperty("name" ) var name : String? = null,
|
||||||
|
@JsonProperty("slug" ) var slug : String? = null,
|
||||||
|
@JsonProperty("home" ) var home : Home? = Home(),
|
||||||
|
@JsonProperty("away" ) var away : Away? = Away(),
|
||||||
|
@JsonProperty("scores" ) var scores : Scores? = Scores(),
|
||||||
|
@JsonProperty("is_live" ) var isLive : Boolean? = null
|
||||||
|
)
|
||||||
|
data class Home (
|
||||||
|
@JsonProperty("model_id" ) var modelId : String? = null,
|
||||||
|
@JsonProperty("name" ) var name : String? = null,
|
||||||
|
@JsonProperty("slug" ) var slug : String? = null,
|
||||||
|
@JsonProperty("logo" ) var logo : String? = null
|
||||||
|
)
|
||||||
|
data class Away (
|
||||||
|
@JsonProperty("model_id" ) var modelId : String? = null,
|
||||||
|
@JsonProperty("name" ) var name : String? = null,
|
||||||
|
@JsonProperty("slug" ) var slug : String? = null,
|
||||||
|
@JsonProperty("logo" ) var logo : String? = null
|
||||||
|
)
|
||||||
|
data class Scores (
|
||||||
|
@JsonProperty("home" ) var home : Int? = null,
|
||||||
|
@JsonProperty("away" ) var away : Int? = null
|
||||||
|
)
|
||||||
|
data class matchesJSON (
|
||||||
|
@JsonProperty("data" ) var data : ArrayList<Data> = arrayListOf()
|
||||||
|
)
|
||||||
|
data class oneMatch (
|
||||||
|
@JsonProperty("data" ) var data : Data? = Data()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
data class PlayUrls (
|
||||||
|
@JsonProperty("name" ) var name : String? = null,
|
||||||
|
@JsonProperty("cdn" ) var cdn : String? = null,
|
||||||
|
@JsonProperty("slug" ) var slug : String? = null,
|
||||||
|
@JsonProperty("url" ) var url : String? = null,
|
||||||
|
@JsonProperty("role" ) var role : String? = null
|
||||||
|
)
|
||||||
|
data class sourceData (
|
||||||
|
@JsonProperty("id" ) var id : String? = null,
|
||||||
|
@JsonProperty("name" ) var name : String? = null,
|
||||||
|
@JsonProperty("slug" ) var slug : String? = null,
|
||||||
|
@JsonProperty("has_lineup" ) var hasLineup : Boolean? = null,
|
||||||
|
@JsonProperty("has_tracker" ) var hasTracker : Boolean? = null,
|
||||||
|
@JsonProperty("play_urls" ) var playUrls : ArrayList<PlayUrls> = arrayListOf()
|
||||||
|
)
|
||||||
|
data class sourcesJSON (
|
||||||
|
@JsonProperty("data" ) var data : sourceData? = sourceData()
|
||||||
|
)
|
||||||
|
class NineGoal : MainAPI() {
|
||||||
|
override var mainUrl = "https://9goaltv.to"
|
||||||
|
override var name = "9Goal"
|
||||||
|
override var lang = "en"
|
||||||
|
override val hasDownloadSupport = false
|
||||||
|
override val hasMainPage = true
|
||||||
|
override val supportedTypes = setOf(
|
||||||
|
TvType.Live
|
||||||
|
)
|
||||||
|
|
||||||
|
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
||||||
|
val doc = app.get(mainUrl).document
|
||||||
|
val apiUrl = doc.select("head > script").first()?.html()?.substringAfter("window.api_base_url = \"")?.substringBefore("\";")
|
||||||
|
val matchesData = parseJson<matchesJSON>(app.get("$apiUrl/v1/match/featured").text)
|
||||||
|
val liveHomePageList = matchesData.data.filter { it.isLive == true }.map {
|
||||||
|
LiveSearchResponse(
|
||||||
|
it.name.toString(),
|
||||||
|
apiUrl + "/v1/match/" + it.id,
|
||||||
|
this@NineGoal.name,
|
||||||
|
TvType.Live,
|
||||||
|
"https://img.zr5.repl.co/vs?title=${it.name}&home=${it.home?.logo}&away=${it.away?.logo}&live=true",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val featuredHomePageList = matchesData.data.filter { it.isLive == false }.map {
|
||||||
|
LiveSearchResponse(
|
||||||
|
it.name.toString(),
|
||||||
|
apiUrl + "/v1/match/" + it.id,
|
||||||
|
this@NineGoal.name,
|
||||||
|
TvType.Live,
|
||||||
|
"https://img.zr5.repl.co/vs?title=${it.name}&home=${it.home?.logo}&away=${it.away?.logo}",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return HomePageResponse(
|
||||||
|
arrayListOf(
|
||||||
|
HomePageList("Live", liveHomePageList, isHorizontalImages = true),
|
||||||
|
HomePageList("Featured", featuredHomePageList, isHorizontalImages = true)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse {
|
||||||
|
val json = parseJson<oneMatch>(app.get(url).text).data
|
||||||
|
return LiveStreamLoadResponse(
|
||||||
|
json?.name.toString(),
|
||||||
|
url,
|
||||||
|
this.name,
|
||||||
|
"$url/stream",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
override suspend fun loadLinks(
|
||||||
|
data: String,
|
||||||
|
isCasting: Boolean,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
): Boolean {
|
||||||
|
val sourcesData = parseJson<sourcesJSON>(app.get(data).text).data
|
||||||
|
sourcesData?.playUrls?.apmap {
|
||||||
|
val brokenDomain = "canyou.letmestreamyou.net"
|
||||||
|
if(it.url.toString().startsWith("https://$brokenDomain")) {
|
||||||
|
mapOf(
|
||||||
|
"smoothlikebutterstream" to "playing.smoothlikebutterstream.com",
|
||||||
|
"tunnelcdnsw" to "playing.tunnelcdnsw.net",
|
||||||
|
"goforfreedomwme" to "playing.goforfreedomwme.net",
|
||||||
|
"gameon" to "turnthe.gameon.tel",
|
||||||
|
"whydontyoustreamwme" to "playing.whydontyoustreamwme.com"
|
||||||
|
).apmap { (name, value) ->
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
this.name,
|
||||||
|
"${this.name} ${it.name} - ${name}",
|
||||||
|
it.url.toString().replace(brokenDomain, value),
|
||||||
|
"$mainUrl/",
|
||||||
|
Qualities.Unknown.value,
|
||||||
|
isM3u8 = true,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
this.name,
|
||||||
|
"${this.name} ${it.name} - ${sourcesData.name}",
|
||||||
|
it.url.toString(),
|
||||||
|
"$mainUrl/",
|
||||||
|
Qualities.Unknown.value,
|
||||||
|
isM3u8 = true,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue