mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
hotfix: added check if class exist for v4.3.0
This commit is contained in:
parent
d540c0702c
commit
2d7673c71f
1 changed files with 22 additions and 1 deletions
|
@ -7,6 +7,15 @@ import android.content.Context
|
||||||
|
|
||||||
@CloudstreamPlugin
|
@CloudstreamPlugin
|
||||||
class SoraStreamPlugin: Plugin() {
|
class SoraStreamPlugin: Plugin() {
|
||||||
|
private fun classExist(className: String) : Boolean {
|
||||||
|
try {
|
||||||
|
Class.forName(className, false, ClassLoader.getSystemClassLoader())
|
||||||
|
} catch (e: ClassNotFoundException) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
override fun load(context: Context) {
|
override fun load(context: Context) {
|
||||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||||
registerMainAPI(SoraStream())
|
registerMainAPI(SoraStream())
|
||||||
|
@ -19,7 +28,19 @@ class SoraStreamPlugin: Plugin() {
|
||||||
registerExtractorAPI(TravelR())
|
registerExtractorAPI(TravelR())
|
||||||
registerExtractorAPI(Playm4u())
|
registerExtractorAPI(Playm4u())
|
||||||
registerExtractorAPI(VCloud())
|
registerExtractorAPI(VCloud())
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check if class exists before load
|
||||||
|
v.4.3.0 released 20231209
|
||||||
|
Class added on 20231231
|
||||||
|
|
||||||
|
2cfdab54 (Extractor: added some extractors (#833), 2023-12-31)
|
||||||
|
app/src/main/java/com/lagradost/cloudstream3/extractors/PixelDrainExtractor.kt
|
||||||
|
*/
|
||||||
|
if (classExist("com.lagradost.cloudstream3.extractors.PixelDrain")) {
|
||||||
registerExtractorAPI(Pixeldra())
|
registerExtractorAPI(Pixeldra())
|
||||||
|
}
|
||||||
|
|
||||||
registerExtractorAPI(M4ufree())
|
registerExtractorAPI(M4ufree())
|
||||||
registerExtractorAPI(Streamruby())
|
registerExtractorAPI(Streamruby())
|
||||||
registerExtractorAPI(Streamwish())
|
registerExtractorAPI(Streamwish())
|
||||||
|
|
Loading…
Reference in a new issue