From 2d80e39fa850443eb32cb4ca443be0655f7652a3 Mon Sep 17 00:00:00 2001 From: Jace <54625750+Jacekun@users.noreply.github.com> Date: Mon, 29 Aug 2022 13:31:15 +0800 Subject: [PATCH] [Feature] enable nsfw on SuperStream --- .../src/main/kotlin/com/lagradost/SuperStream.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SuperStream/src/main/kotlin/com/lagradost/SuperStream.kt b/SuperStream/src/main/kotlin/com/lagradost/SuperStream.kt index 4fb0202..b1041a8 100644 --- a/SuperStream/src/main/kotlin/com/lagradost/SuperStream.kt +++ b/SuperStream/src/main/kotlin/com/lagradost/SuperStream.kt @@ -35,12 +35,9 @@ class SuperStream : MainAPI() { TvType.AnimeMovie, ) - // 0 to get nsfw - private val hideNsfw = 1 - override val instantLinkLoading = true - val headers = mapOf( + private val headers = mapOf( "Platform" to "android", "Accept" to "charset=utf-8", ) @@ -217,6 +214,7 @@ class SuperStream : MainAPI() { private val appId = base64Decode("Y29tLnRkby5zaG93Ym94") override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { + val hideNsfw = if (settingsForProvider.enableAdult) 0 else 1 val json = queryApi( """{"childmode":"$hideNsfw","app_version":"11.5","appid":"$appId","module":"Home_list_type_v2","channel":"Website","page":"$page","lang":"en","type":"all","pagelimit":"10","expired_date":"${getExpiryDate()}","platform":"android"} """.trimIndent() @@ -262,7 +260,7 @@ class SuperStream : MainAPI() { ) override suspend fun search(query: String): List { - + val hideNsfw = if (settingsForProvider.enableAdult) 0 else 1 val apiQuery = // Originally 8 pagelimit """{"childmode":"$hideNsfw","app_version":"11.5","appid":"$appId","module":"Search3","channel":"Website","page":"1","lang":"en","type":"all","keyword":"$query","pagelimit":"20","expired_date":"${getExpiryDate()}","platform":"android"}""" @@ -453,7 +451,7 @@ class SuperStream : MainAPI() { // val module = if(type === "TvType.Movie") "Movie_detail" else "*tv series module*" val isMovie = loadData.type == TYPE_MOVIES - + val hideNsfw = if (settingsForProvider.enableAdult) 0 else 1 if (isMovie) { // 1 = Movie val apiQuery = """{"childmode":"$hideNsfw","uid":"","app_version":"11.5","appid":"$appId","module":"Movie_detail","channel":"Website","mid":"${loadData.id}","lang":"en","expired_date":"${getExpiryDate()}","platform":"android","oss":"","group":""}"""