From e1bb9037167b083a9f5efcd2a724d6be46ee7e6a Mon Sep 17 00:00:00 2001 From: hexated Date: Wed, 19 Oct 2022 02:03:40 +0700 Subject: [PATCH] small fix --- GoodPorn/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/GoodPorn.kt | 35 +++---------------- .../main/kotlin/com/hexated/SoraExtractor.kt | 1 - 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/GoodPorn/build.gradle.kts b/GoodPorn/build.gradle.kts index dde74c18..ab96da41 100644 --- a/GoodPorn/build.gradle.kts +++ b/GoodPorn/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 6 +version = 7 cloudstream { diff --git a/GoodPorn/src/main/kotlin/com/hexated/GoodPorn.kt b/GoodPorn/src/main/kotlin/com/hexated/GoodPorn.kt index ea32f31d..9ed8cb62 100644 --- a/GoodPorn/src/main/kotlin/com/hexated/GoodPorn.kt +++ b/GoodPorn/src/main/kotlin/com/hexated/GoodPorn.kt @@ -3,8 +3,6 @@ package com.hexated import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.utils.* -import com.lagradost.cloudstream3.utils.AppUtils.parseJson -import com.lagradost.cloudstream3.utils.AppUtils.toJson import org.jsoup.nodes.Element import java.util.* @@ -52,8 +50,7 @@ class GoodPorn : MainAPI() { val title = this.selectFirst("strong.title")?.text() ?: return null val href = fixUrl(this.selectFirst("a")!!.attr("href")) val posterUrl = fixUrlNull(this.select("div.img > img").attr("data-original")) - val previewUrl = fixUrlNull(this.select("div.img > img").attr("data-preview")) - return newMovieSearchResponse(title, LoadData(href, previewUrl).toJson(), TvType.Movie) { + return newMovieSearchResponse(title, href, TvType.Movie) { this.posterUrl = posterUrl } @@ -79,8 +76,7 @@ class GoodPorn : MainAPI() { } override suspend fun load(url: String): LoadResponse { - val res = parseJson(url) - val document = app.get(res.url.toString()).document + val document = app.get(url).document val title = document.selectFirst("div.headline > h1")?.text()?.trim().toString() val poster = @@ -93,19 +89,12 @@ class GoodPorn : MainAPI() { it.toSearchResult() } - return newMovieLoadResponse(title, url, TvType.NSFW, LoadData(res.url, res.trailer).toJson()) { + return newMovieLoadResponse(title, url, TvType.NSFW, url) { this.posterUrl = poster this.plot = description this.tags = tags addActors(actors) this.recommendations = recommendations - this.trailers = mutableListOf( - TrailerData( - res.trailer.toString(), - referer = "$mainUrl/", - raw = true - ) - ) } } @@ -115,8 +104,7 @@ class GoodPorn : MainAPI() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ): Boolean { - val res = parseJson(data) - val document = app.get(res.url.toString()).document + val document = app.get(data).document document.select("div.info div:last-child a").map { res -> callback.invoke( ExtractorLink( @@ -132,22 +120,7 @@ class GoodPorn : MainAPI() { ) } - callback.invoke( - ExtractorLink( - "Preview", - "Preview", - res.trailer.toString(), - referer = data, - quality = Qualities.Unknown.value, - headers = mapOf("Range" to "bytes=0-"), - ) - ) - return true } - data class LoadData( - val url: String? = null, - val trailer: String? = null, - ) } \ No newline at end of file diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 22cafd3f..0efbdb5b 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -2,7 +2,6 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.extractors.XStreamCdn import com.lagradost.cloudstream3.network.WebViewResolver import com.lagradost.cloudstream3.utils.* import com.lagradost.nicehttp.requestCreator