mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Fixes and removed interceptor in main page
This commit is contained in:
parent
453fbd6ea0
commit
44885f5256
1 changed files with 110 additions and 101 deletions
|
@ -1,5 +1,6 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addRating
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addRating
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
|
@ -17,7 +18,7 @@ import org.jsoup.nodes.Element
|
||||||
class IlGenioDelloStreamingProvider : MainAPI() {
|
class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://ilgeniodellostreaming.hair"
|
override var mainUrl = "https://ilgeniodellostreaming.hair"
|
||||||
override var name = "IlGenioDelloStreaming"
|
override var name = "IlGenioDelloStreaming-t"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
override var sequentialMainPage = true
|
override var sequentialMainPage = true
|
||||||
|
@ -36,7 +37,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
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, interceptor = interceptor, referer = mainUrl).document
|
val soup = app.get(url, referer = mainUrl).document
|
||||||
val home = soup.select("div.items > article.item").mapNotNull { it.toMainPageResult() }
|
val home = soup.select("div.items > article.item").mapNotNull { it.toMainPageResult() }
|
||||||
val hasNext = home.isNotEmpty()
|
val hasNext = home.isNotEmpty()
|
||||||
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = hasNext)
|
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = hasNext)
|
||||||
|
@ -46,6 +47,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
val title =
|
val title =
|
||||||
this.selectFirst("div.data>h3")
|
this.selectFirst("div.data>h3")
|
||||||
?.text()
|
?.text()
|
||||||
|
?.trim()
|
||||||
?.replace("[HD]", "")
|
?.replace("[HD]", "")
|
||||||
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
||||||
?: "No title"
|
?: "No title"
|
||||||
|
@ -58,19 +60,15 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
val quality = this.selectFirst("div.poster>span.quality")?.text()
|
val quality = this.selectFirst("div.poster>span.quality")?.text()
|
||||||
val posterUrl = this.selectFirst("div.poster>a>img")?.attr("src")
|
val posterUrl = this.selectFirst("div.poster>a>img")?.attr("src")
|
||||||
|
|
||||||
if (isMovie) {
|
return if (isMovie) {
|
||||||
return newMovieSearchResponse(title, link, TvType.Movie) {
|
newMovieSearchResponse(title, link, TvType.Movie) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
quality?.let { addQuality(it) }
|
||||||
addQuality(quality)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
quality?.let { addQuality(it) }
|
||||||
addQuality(quality)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +84,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
val title =
|
val title =
|
||||||
this.selectFirst("div.title>a")
|
this.selectFirst("div.title>a")
|
||||||
?.text()
|
?.text()
|
||||||
|
?.trim()
|
||||||
?.replace("[HD]", "")
|
?.replace("[HD]", "")
|
||||||
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
||||||
?: "No title"
|
?: "No title"
|
||||||
|
@ -99,15 +98,15 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
this.selectFirst("div.title>a")?.text()?.substringAfter("[")?.substringBefore("]")
|
this.selectFirst("div.title>a")?.text()?.substringAfter("[")?.substringBefore("]")
|
||||||
val posterUrl = this.selectFirst("a>img")?.attr("src")
|
val posterUrl = this.selectFirst("a>img")?.attr("src")
|
||||||
|
|
||||||
if (isMovie) {
|
return if (isMovie) {
|
||||||
return newMovieSearchResponse(title, link, TvType.Movie) {
|
newMovieSearchResponse(title, link, TvType.Movie) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
if (quality != null) {
|
||||||
addQuality(quality)
|
addQuality(quality)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
if (quality != null) {
|
||||||
addQuality(quality)
|
addQuality(quality)
|
||||||
|
@ -117,7 +116,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val document = app.get(url).document
|
val document = app.get(url, referer = mainUrl).document
|
||||||
val type =
|
val type =
|
||||||
if (document.select("div.seasons-wraper").isNotEmpty()) TvType.TvSeries
|
if (document.select("div.seasons-wraper").isNotEmpty()) TvType.TvSeries
|
||||||
else TvType.Movie
|
else TvType.Movie
|
||||||
|
@ -125,6 +124,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
val title =
|
val title =
|
||||||
document.selectFirst("div.data > h1")
|
document.selectFirst("div.data > h1")
|
||||||
?.text()
|
?.text()
|
||||||
|
?.trim()
|
||||||
?.substringBefore("Streaming")
|
?.substringBefore("Streaming")
|
||||||
?.replace("[HD]", "")
|
?.replace("[HD]", "")
|
||||||
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
||||||
|
@ -197,6 +197,7 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
val title =
|
val title =
|
||||||
this.selectFirst("div.data>h3")
|
this.selectFirst("div.data>h3")
|
||||||
?.text()
|
?.text()
|
||||||
|
?.trim()
|
||||||
?.replace("[HD]", "")
|
?.replace("[HD]", "")
|
||||||
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
?.replace("\\(\\d{4}\\)".toRegex(), "")
|
||||||
?: "No title"
|
?: "No title"
|
||||||
|
@ -209,15 +210,15 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
this.selectFirst("div.data>h3")?.text()?.substringAfter("[")?.substringBefore("]")
|
this.selectFirst("div.data>h3")?.text()?.substringAfter("[")?.substringBefore("]")
|
||||||
val posterUrl = this.selectFirst("div.image>img")?.attr("src")
|
val posterUrl = this.selectFirst("div.image>img")?.attr("src")
|
||||||
|
|
||||||
if (isMovie) {
|
return if (isMovie) {
|
||||||
return newMovieSearchResponse(title, link, TvType.Movie) {
|
newMovieSearchResponse(title, link, TvType.Movie) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
if (quality != null) {
|
||||||
addQuality(quality)
|
addQuality(quality)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
newTvSeriesSearchResponse(title, link, TvType.TvSeries) {
|
||||||
addPoster(posterUrl)
|
addPoster(posterUrl)
|
||||||
if (quality != null) {
|
if (quality != null) {
|
||||||
addQuality(quality)
|
addQuality(quality)
|
||||||
|
@ -231,10 +232,18 @@ class IlGenioDelloStreamingProvider : MainAPI() {
|
||||||
this.select("div.fix-table>table>tbody>tr>td>a[target=_blank]") // buckler.link
|
this.select("div.fix-table>table>tbody>tr>td>a[target=_blank]") // buckler.link
|
||||||
.map { it.attr("href") }
|
.map { it.attr("href") }
|
||||||
.toJson()
|
.toJson()
|
||||||
val epTitle = this.selectFirst("li.other_link>a")?.text() ?: "No Ep. Title 0"
|
val epNum =
|
||||||
val epNum = epTitle.substringAfter("Episodio ").toInt()
|
this.selectFirst("li.season-no")
|
||||||
|
?.text()
|
||||||
|
?.substringAfter("x")
|
||||||
|
?.substringBefore(" ")
|
||||||
|
|
||||||
|
val epTitle =
|
||||||
|
this.selectFirst("li.other_link>a")?.text().orEmpty().ifBlank {
|
||||||
|
"Episodio $epNum"
|
||||||
|
}
|
||||||
val posterUrl = this.selectFirst("img")?.attr("src")
|
val posterUrl = this.selectFirst("img")?.attr("src")
|
||||||
return Episode(data, epTitle, season, epNum, posterUrl = posterUrl)
|
return Episode(data, epTitle, season, epNum?.toInt(), posterUrl = posterUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun loadLinks(
|
override suspend fun loadLinks(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue