mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
feat (loadExtractor) : match mirror domains of extractor link (#877)
Co-authored-by: coxju <coxju>
This commit is contained in:
parent
19145c6cc4
commit
1676094488
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue