package com.lagradost.cloudstream3.extractors import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.ExtractorLink open class Tantifilm : ExtractorApi() { override var name = "Tantifilm" override var mainUrl = "https://cercafilm.net" override val requiresReferer = false data class TantifilmJsonData ( @JsonProperty("success") val success : Boolean, @JsonProperty("data") val data : List, @JsonProperty("captions")val captions : List, @JsonProperty("is_vr") val is_vr : Boolean ) data class TantifilmData ( @JsonProperty("file") val file : String, @JsonProperty("label") val label : String, @JsonProperty("type") val type : String ) override suspend fun getUrl(url: String, referer: String?): List? { val link = "$mainUrl/api/source/${url.substringAfterLast("/")}" val response = app.post(link).text.replace("""\""","") val jsonvideodata = parseJson(response) return jsonvideodata.data.map { ExtractorLink( this.name, this.name, it.file+".${it.type}", mainUrl, it.label.filter{ it.isDigit() }.toInt(), false ) } } }