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(),
//MultiAnimeProvider(),
NginxProvider(),
OlgplyProvider(),
)
}

View file

@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.uwetrottmann.tmdb2.Tmdb
import com.uwetrottmann.tmdb2.entities.*
import com.uwetrottmann.tmdb2.enumerations.AppendToResponseItem
import retrofit2.awaitResponse
import java.util.*
@ -258,7 +259,7 @@ open class TmdbProvider : MainAPI() {
return if (useMetaLoadResponse) {
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()
if (response != null) {
if (response.recommendations.isNullOrEmpty())
@ -277,7 +278,7 @@ open class TmdbProvider : MainAPI() {
response
} 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()
if (response != null) {
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": {
"language": "en",
"name": "Bflix",
"status": 1,
"status": 0,
"url": "https://bflix.ru"
},
"CinecalidadProvider": {
@ -151,7 +151,7 @@
"FmoviesToProvider": {
"language": "en",
"name": "Fmovies.to",
"status": 1,
"status": 0,
"url": "https://fmovies.to"
},
"FrenchStreamProvider": {
@ -253,7 +253,7 @@
"NineAnimeProvider": {
"language": "en",
"name": "9Anime",
"status": 1,
"status": 0,
"url": "https://9anime.id"
},
"NontonAnimeIDProvider": {
@ -325,7 +325,7 @@
"SflixProProvider": {
"language": "en",
"name": "Sflix.pro",
"status": 1,
"status": 0,
"url": "https://sflix.pro"
},
"SflixProvider": {

View file

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