feat (loadExtractor) : match mirror domains of extractor link (#877)

Co-authored-by: coxju <coxju>
This commit is contained in:
coxju 2024-01-18 03:02:22 +05:30 committed by GitHub
parent 19145c6cc4
commit 1676094488
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -216,6 +216,7 @@ import com.lagradost.cloudstream3.extractors.Ztreamhub
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
import kotlinx.coroutines.delay
import me.xdrop.fuzzywuzzy.FuzzySearch
import org.jsoup.Jsoup
import java.net.URL
import java.util.UUID
@ -600,6 +601,18 @@ suspend fun loadExtractor(
}
}
// this is to match mirror domains - like example.com, example.net
for (extractor in extractorApis) {
if (FuzzySearch.partialRatio(
extractor.mainUrl,
currentUrl
) > 80
) {
extractor.getSafeUrl(currentUrl, referer, subtitleCallback, callback)
return true
}
}
return false
}