From 64549d8fea3c918c8bc6e255a0a48702ecf4ec22 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Sun, 16 Oct 2022 00:57:52 +0200 Subject: [PATCH 1/7] olgply fix --- OlgplyProvider/build.gradle.kts | 2 +- .../src/main/kotlin/com/lagradost/OlgplyProvider.kt | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/OlgplyProvider/build.gradle.kts b/OlgplyProvider/build.gradle.kts index 9099795..5ea82d0 100644 --- a/OlgplyProvider/build.gradle.kts +++ b/OlgplyProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 3 +version = 4 cloudstream { diff --git a/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt b/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt index c2a0636..7eec1c9 100644 --- a/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt +++ b/OlgplyProvider/src/main/kotlin/com/lagradost/OlgplyProvider.kt @@ -2,7 +2,6 @@ package com.lagradost import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.TvType -import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.metaproviders.TmdbLink import com.lagradost.cloudstream3.metaproviders.TmdbProvider import com.lagradost.cloudstream3.network.WebViewResolver @@ -10,9 +9,6 @@ import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.nicehttp.requestCreator -import org.mozilla.javascript.Context -import org.mozilla.javascript.Scriptable -import org.mozilla.javascript.ScriptableObject class OlgplyProvider : TmdbProvider() { override var mainUrl = "https://olgply.com" @@ -31,7 +27,7 @@ class OlgplyProvider : TmdbProvider() { Regex("""\.m3u8|i7njdjvszykaieynzsogaysdgb0hm8u1mzubmush4maopa4wde\.com""") ).resolveUsingWebView( requestCreator( - "GET", url, referer = "https://olgply.xyz/" + "GET", url, referer = "https://olgply.com/" ) ) .first ?: return @@ -39,7 +35,7 @@ class OlgplyProvider : TmdbProvider() { callback.invoke( ExtractorLink( this.name, - "Movies4Discord", + this.name, foundVideo.url.toString(), "", Qualities.Unknown.value, @@ -57,7 +53,7 @@ class OlgplyProvider : TmdbProvider() { ): Boolean { val mappedData = parseJson(data) val tmdbId = mappedData.tmdbID ?: return false - val jsRegex = Regex("""eval\(.*\);""") +// val jsRegex = Regex("""eval\(.*\);""") val apiUrl = "https://olgply.xyz/${tmdbId}${mappedData.season?.let { "/$it" } ?: ""}${mappedData.episode?.let { "/$it" } ?: ""}" From 73062a8041a0eb5023d4ab8376cc637bfc4b2ac8 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Sun, 16 Oct 2022 15:08:45 +0200 Subject: [PATCH 2/7] Disable aniflix --- AniflixProvider/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AniflixProvider/build.gradle.kts b/AniflixProvider/build.gradle.kts index 71e0ff6..6a4d008 100644 --- a/AniflixProvider/build.gradle.kts +++ b/AniflixProvider/build.gradle.kts @@ -16,7 +16,7 @@ cloudstream { * 2: Slow * 3: Beta only * */ - status = 1 // will be 3 if unspecified + status = 0 // will be 3 if unspecified tvTypes = listOf( "Anime", "AnimeMovie", From 4ff296dea592ee5356c0dbe6c8e81d742c7fb711 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Sun, 16 Oct 2022 19:44:52 +0200 Subject: [PATCH 3/7] Add Ask4movie --- Ask4Movie/build.gradle.kts | 27 ++ Ask4Movie/src/main/AndroidManifest.xml | 2 + .../kotlin/com/lagradost/Ask4MoviePlugin.kt | 14 ++ .../kotlin/com/lagradost/Ask4MovieProvider.kt | 237 ++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 Ask4Movie/build.gradle.kts create mode 100644 Ask4Movie/src/main/AndroidManifest.xml create mode 100644 Ask4Movie/src/main/kotlin/com/lagradost/Ask4MoviePlugin.kt create mode 100644 Ask4Movie/src/main/kotlin/com/lagradost/Ask4MovieProvider.kt diff --git a/Ask4Movie/build.gradle.kts b/Ask4Movie/build.gradle.kts new file mode 100644 index 0000000..0315eba --- /dev/null +++ b/Ask4Movie/build.gradle.kts @@ -0,0 +1,27 @@ +// use an integer for version numbers +version = 3 + + +cloudstream { + language = "en" + // All of these properties are optional, you can safely remove them + +// description = "Uses TMDB" + authors = listOf("Blatzar") + + /** + * Status int as the following: + * 0: Down + * 1: Ok + * 2: Slow + * 3: Beta only + * */ + status = 1 // will be 3 if unspecified + tvTypes = listOf( + "TvSeries", + "Movie", + "AnimeMovie" + ) + + iconUrl = "https://www.google.com/s2/favicons?domain=ask4movie.mx&sz=%size%" +} \ No newline at end of file diff --git a/Ask4Movie/src/main/AndroidManifest.xml b/Ask4Movie/src/main/AndroidManifest.xml new file mode 100644 index 0000000..29aec9d --- /dev/null +++ b/Ask4Movie/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MoviePlugin.kt b/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MoviePlugin.kt new file mode 100644 index 0000000..58d5351 --- /dev/null +++ b/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MoviePlugin.kt @@ -0,0 +1,14 @@ + +package com.lagradost + +import com.lagradost.cloudstream3.plugins.CloudstreamPlugin +import com.lagradost.cloudstream3.plugins.Plugin +import android.content.Context + +@CloudstreamPlugin +class Ask4MoviePlugin: Plugin() { + override fun load(context: Context) { + // All providers should be added in this manner. Please don't edit the providers list directly. + registerMainAPI(Ask4MovieProvider()) + } +} \ No newline at end of file diff --git a/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MovieProvider.kt b/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MovieProvider.kt new file mode 100644 index 0000000..05d7870 --- /dev/null +++ b/Ask4Movie/src/main/kotlin/com/lagradost/Ask4MovieProvider.kt @@ -0,0 +1,237 @@ +package com.lagradost + +import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.utils.Coroutines.main +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.loadExtractor +import org.jsoup.Jsoup +import org.jsoup.nodes.Element +import java.net.URI + +class Ask4MovieProvider : MainAPI() { + override var mainUrl = "https://ask4movie.mx" + + override var name = "Ask4Movie" + override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.AnimeMovie) + override val hasMainPage = true + + private fun Element.toSearchResponse(): MovieSearchResponse { + // style="background-image: url(https://ask4movie.me/wp-content/uploads/2022/08/Your-Name.-2016-cover.jpg)" + val posterRegex = Regex("""url\((.*?)\)""") + val poster = posterRegex.find(this.attr("style"))?.groupValues?.get(1) + + val a = this.select("a") + val href = a.attr("href") + val title = a.text().trim() + + // Title (2022) -> 2022 + val year = + Regex("""\((\d{4})\)$""").find(title)?.groupValues?.getOrNull(1)?.toIntOrNull() + + return MovieSearchResponse( + title, + href, + this@Ask4MovieProvider.name, + TvType.Movie, + poster, + year, + null, + null, + null + ) + } + + // Used in movies/single seasons to get recommendations + private fun Element.articleToSearchResponse(): MovieSearchResponse { + val poster = this.select("img").attr("src") + + val a = this.select("a") + val href = a.attr("href") + val title = a.attr("title") + + // Title (2022) -> 2022 + val year = + Regex("""\((\d{4})\)$""").find(title)?.groupValues?.getOrNull(1)?.toIntOrNull() + + return MovieSearchResponse( + title, + href, + this@Ask4MovieProvider.name, + TvType.Movie, + poster, + year, + null, + null, + null + ) + } + + override suspend fun search(query: String): List { + val url = "$mainUrl/?s=$query" + val doc = app.post( + url, +// data = mapOf("np_asl_data" to "customset[]=post&customset[]=ct_channel&customset[]=post&customset[]=post&customset[]=post&customset[]=post&asl_gen[]=title&asl_gen[]=exact&qtranslate_lang=0&filters_initial=1&filters_changed=0") + ).document + return doc.select("div.item").map { + it.toSearchResponse() + } + } + + private fun getIframe(html: String): String? { + val data = Regex("""