Added OlgplyProvider and disabled the broken providers

This commit is contained in:
Blatzar 2022-05-24 19:54:51 +02:00
parent 49aca9ddf1
commit 54a0913a8e
5 changed files with 57 additions and 10 deletions

View file

@ -122,6 +122,7 @@ object APIHolder {
KuronimeProvider(), KuronimeProvider(),
//MultiAnimeProvider(), //MultiAnimeProvider(),
NginxProvider(), NginxProvider(),
OlgplyProvider(),
) )
} }

View file

@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.uwetrottmann.tmdb2.Tmdb import com.uwetrottmann.tmdb2.Tmdb
import com.uwetrottmann.tmdb2.entities.* import com.uwetrottmann.tmdb2.entities.*
import com.uwetrottmann.tmdb2.enumerations.AppendToResponseItem
import retrofit2.awaitResponse import retrofit2.awaitResponse
import java.util.* import java.util.*
@ -258,7 +259,7 @@ open class TmdbProvider : MainAPI() {
return if (useMetaLoadResponse) { return if (useMetaLoadResponse) {
return if (isTvSeries) { return if (isTvSeries) {
val body = tmdb.tvService().tv(id, "en-US").awaitResponse().body() val body = tmdb.tvService().tv(id, "en-US", AppendToResponse(AppendToResponseItem.EXTERNAL_IDS)).awaitResponse().body()
val response = body?.toLoadResponse() val response = body?.toLoadResponse()
if (response != null) { if (response != null) {
if (response.recommendations.isNullOrEmpty()) if (response.recommendations.isNullOrEmpty())
@ -277,7 +278,7 @@ open class TmdbProvider : MainAPI() {
response response
} else { } else {
val body = tmdb.moviesService().summary(id, "en-US").awaitResponse().body() val body = tmdb.moviesService().summary(id, "en-US", AppendToResponse(AppendToResponseItem.EXTERNAL_IDS)).awaitResponse().body()
val response = body?.toLoadResponse() val response = body?.toLoadResponse()
if (response != null) { if (response != null) {
if (response.recommendations.isNullOrEmpty()) if (response.recommendations.isNullOrEmpty())

View file

@ -0,0 +1,45 @@
package com.lagradost.cloudstream3.movieproviders
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.metaproviders.TmdbLink
import com.lagradost.cloudstream3.metaproviders.TmdbProvider
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
class OlgplyProvider : TmdbProvider() {
override var mainUrl = "https://olgply.com"
override val apiName = "Olgply"
override var name = "Olgply"
override val instantLinkLoading = true
override val useMetaLoadResponse = true
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
val mappedData = parseJson<TmdbLink>(data)
val imdbId = mappedData.imdbID ?: return false
val iframeUrl =
"$mainUrl/api/?imdb=$imdbId${mappedData.season?.let { "&season=$it" } ?: ""}${mappedData.episode?.let { "&episode=$it" } ?: ""}"
val iframeRegex = Regex("""file:.*?"([^"]*)""")
val html = app.get(iframeUrl).text
val link = iframeRegex.find(html)?.groupValues?.getOrNull(1) ?: return false
callback.invoke(
ExtractorLink(
this.name,
this.name,
link,
this.mainUrl + "/",
Qualities.Unknown.value,
headers = mapOf("range" to "bytes=0-")
)
)
return true
}
}

View file

@ -68,7 +68,7 @@
"BflixProvider": { "BflixProvider": {
"language": "en", "language": "en",
"name": "Bflix", "name": "Bflix",
"status": 1, "status": 0,
"url": "https://bflix.ru" "url": "https://bflix.ru"
}, },
"CinecalidadProvider": { "CinecalidadProvider": {
@ -151,7 +151,7 @@
"FmoviesToProvider": { "FmoviesToProvider": {
"language": "en", "language": "en",
"name": "Fmovies.to", "name": "Fmovies.to",
"status": 1, "status": 0,
"url": "https://fmovies.to" "url": "https://fmovies.to"
}, },
"FrenchStreamProvider": { "FrenchStreamProvider": {
@ -253,7 +253,7 @@
"NineAnimeProvider": { "NineAnimeProvider": {
"language": "en", "language": "en",
"name": "9Anime", "name": "9Anime",
"status": 1, "status": 0,
"url": "https://9anime.id" "url": "https://9anime.id"
}, },
"NontonAnimeIDProvider": { "NontonAnimeIDProvider": {
@ -325,7 +325,7 @@
"SflixProProvider": { "SflixProProvider": {
"language": "en", "language": "en",
"name": "Sflix.pro", "name": "Sflix.pro",
"status": 1, "status": 0,
"url": "https://sflix.pro" "url": "https://sflix.pro"
}, },
"SflixProvider": { "SflixProvider": {

View file

@ -52,17 +52,17 @@
"BflixProvider": { "BflixProvider": {
"name": "Bflix", "name": "Bflix",
"url": "https://bflix.ru", "url": "https://bflix.ru",
"status": 1 "status": 0
}, },
"FmoviesToProvider": { "FmoviesToProvider": {
"name": "Fmovies.to", "name": "Fmovies.to",
"url": "https://fmovies.to", "url": "https://fmovies.to",
"status": 1 "status": 0
}, },
"SflixProProvider": { "SflixProProvider": {
"name": "Sflix.pro", "name": "Sflix.pro",
"url": "https://sflix.pro", "url": "https://sflix.pro",
"status": 1 "status": 0
}, },
"CinecalidadProvider": { "CinecalidadProvider": {
"name": "Cinecalidad", "name": "Cinecalidad",
@ -162,7 +162,7 @@
"NineAnimeProvider": { "NineAnimeProvider": {
"name": "9Anime", "name": "9Anime",
"url": "https://9anime.id", "url": "https://9anime.id",
"status": 1 "status": 0
}, },
"PeliSmartProvider": { "PeliSmartProvider": {
"name": "PeliSmart", "name": "PeliSmart",