Skip to content

Commit

Permalink
feat (loadExtractor) : match mirror domains of extractor link (#877)
Browse files Browse the repository at this point in the history
Co-authored-by: coxju <coxju>
  • Loading branch information
coxju committed Jan 17, 2024
1 parent 19145c6 commit 1676094
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 1676094

Please sign in to comment.