mirror of
https://github.com/recloudstream/plugin-template.git
synced 2024-08-15 03:16:05 +00:00
initial commit
This commit is contained in:
commit
5bf4201ead
15 changed files with 530 additions and 0 deletions
19
ExampleProvider/build.gradle.kts
Normal file
19
ExampleProvider/build.gradle.kts
Normal file
|
@ -0,0 +1,19 @@
|
|||
version = "1.0.0"
|
||||
|
||||
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = "Lorem Ipsum"
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 1
|
||||
|
||||
// Set to true to get an 18+ symbol next to the plugin
|
||||
// isAdult = false // TODO: fix
|
||||
|
2
ExampleProvider/src/main/AndroidManifest.xml
Normal file
2
ExampleProvider/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.example"/>
|
14
ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt
Normal file
14
ExampleProvider/src/main/kotlin/com/example/ExamplePlugin.kt
Normal file
|
@ -0,0 +1,14 @@
|
|||
package com.example
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import com.lagradost.cloudstream3.APIHolder
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class TestPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner
|
||||
APIHolder.allProviders.add(ExampleProvider())
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.example
|
||||
|
||||
import com.lagradost.cloudstream3.TvType
|
||||
import com.lagradost.cloudstream3.MainAPI
|
||||
import com.lagradost.cloudstream3.SearchResponse
|
||||
|
||||
class ExampleProvider : MainAPI() { // all providers must be an intstance of MainAPI
|
||||
override var mainUrl = "https://example.com/"
|
||||
override var name = "Example provider"
|
||||
override val supportedTypes = setOf(TvType.Movie)
|
||||
|
||||
override var lang = "en"
|
||||
|
||||
// enable this when your provider has a main page
|
||||
override val hasMainPage = true
|
||||
|
||||
// this function gets called when you search for something
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
return listOf<SearchResponse>()
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue