mirror of
https://github.com/Jacekun/cs3xxx-repo.git
synced 2024-08-14 23:57:09 +00:00
Add example template
This commit is contained in:
parent
ca5ed299dc
commit
8a1039db8e
4 changed files with 86 additions and 0 deletions
26
Example/build.gradle.kts
Normal file
26
Example/build.gradle.kts
Normal file
|
@ -0,0 +1,26 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
|
||||
|
||||
cloudstream {
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = ""
|
||||
authors = listOf("Jace")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 1 // will be 3 if unspecified
|
||||
|
||||
// List of video source types. Users are able to filter for extensions in a given category.
|
||||
// You can find a list of avaliable types here:
|
||||
// https://recloudstream.github.io/cloudstream/html/app/com.lagradost.cloudstream3/-tv-type/index.html
|
||||
tvTypes = listOf("NSFW")
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=javfree.sh&sz=%size%"
|
||||
}
|
2
Example/src/main/AndroidManifest.xml
Normal file
2
Example/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
45
Example/src/main/kotlin/com/jacekun/Example.kt
Normal file
45
Example/src/main/kotlin/com/jacekun/Example.kt
Normal file
|
@ -0,0 +1,45 @@
|
|||
package com.jacekun
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.mvvm.logError
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
class Example : MainAPI() {
|
||||
private val globalTvType = TvType.Movie
|
||||
override var name = "Example"
|
||||
override var mainUrl = "https://"
|
||||
override val supportedTypes: Set<TvType> get() = setOf(TvType.NSFW)
|
||||
override val hasDownloadSupport: Boolean get() = false
|
||||
override val hasMainPage: Boolean get() = true
|
||||
override val hasQuickSearch: Boolean get() = false
|
||||
|
||||
override suspend fun getMainPage(
|
||||
page: Int,
|
||||
request: MainPageRequest
|
||||
): HomePageResponse {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
|
||||
throw NotImplementedError()
|
||||
}
|
||||
}
|
13
Example/src/main/kotlin/com/jacekun/ExamplePlugin.kt
Normal file
13
Example/src/main/kotlin/com/jacekun/ExamplePlugin.kt
Normal file
|
@ -0,0 +1,13 @@
|
|||
package com.jacekun
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class ExamplePlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(Example())
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue