fix @Blatzar and change type

This commit is contained in:
Cloudburst 2022-12-24 20:30:01 +01:00 committed by GitHub
parent 71922eaa40
commit 6b9070b9be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 1
version = 2
cloudstream {
@ -18,7 +18,7 @@ cloudstream {
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"TvSeries",
"Others",
)
iconUrl = "https://www.google.com/s2/favicons?domain=skillshare.com&sz=%size%"

View File

@ -20,7 +20,7 @@ class SkillShareProvider : MainAPI() { // all providers must be an instance of M
private val apiUrl = "https://www.skillshare.com/api/graphql"
private val bypassApiUrl = "https://skillshare-api.heckernohecking.repl.co"
override val supportedTypes = setOf(TvType.TvSeries)
override val supportedTypes = setOf(TvType.Others)
override val hasChromecastSupport = true
override var lang = "en"
override val hasMainPage = true
@ -141,7 +141,7 @@ class SkillShareProvider : MainAPI() { // all providers must be an instance of M
}
override suspend fun load(url: String): LoadResponse {
override suspend fun load(url: String): LoadResponse? {
val data = parseJson<Data>(url)
val document = app.get(bypassApiUrl + "/${data.courseId}/0")
.parsedSafe<BypassApiData>() ?: throw ErrorLoadingException("Invalid Json Response")
@ -151,7 +151,7 @@ class SkillShareProvider : MainAPI() { // all providers must be an instance of M
Episode(episode.url ?: "", episode.title, 1, index)
}
return newTvSeriesLoadResponse(title, data.courseId, TvType.TvSeries, episodeList) {
return newTvSeriesLoadResponse(title, data.courseId ?: return null, TvType.TvSeries, episodeList) {
addPoster(poster)
}
}