[Feature] enable nsfw on SuperStream

This commit is contained in:
Jace 2022-08-29 13:31:15 +08:00 committed by Cloudburst
parent 9617444dcc
commit 2d80e39fa8
1 changed files with 4 additions and 6 deletions

View File

@ -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<SearchResponse> {
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":""}"""