mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	Added OlgplyProvider and disabled the broken providers
This commit is contained in:
		
							parent
							
								
									49aca9ddf1
								
							
						
					
					
						commit
						54a0913a8e
					
				
					 5 changed files with 57 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -122,6 +122,7 @@ object APIHolder {
 | 
			
		|||
            KuronimeProvider(),
 | 
			
		||||
            //MultiAnimeProvider(),
 | 
			
		||||
	        NginxProvider(),
 | 
			
		||||
            OlgplyProvider(),
 | 
			
		||||
        )
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue