diff --git a/src/en/superstream/build.gradle b/src/en/superstream/build.gradle index c4416c7d14..0cd1d7535f 100644 --- a/src/en/superstream/build.gradle +++ b/src/en/superstream/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'SuperStream' pkgNameSuffix = 'en.superstream' extClass = '.SuperStream' - extVersionCode = 9 + extVersionCode = 10 libVersion = '13' } diff --git a/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStream.kt b/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStream.kt index 27bd29bc38..8c713432d1 100644 --- a/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStream.kt +++ b/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStream.kt @@ -27,7 +27,7 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() { override val name = "SuperStream" - override val baseUrl by lazy { preferences.getString("preferred_domain", superStreamAPI.apiUrl)!! } + override val baseUrl = "https://i1.sndcdn.com/artworks-000570872354-fmnvll-t500x500.jpg" override val lang = "en" @@ -137,7 +137,7 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() { override fun searchAnimeParse(response: Response) = throw Exception("not used") override fun fetchAnimeDetails(anime: SAnime): Observable { - val data = superStreamAPI.load(anime.url, true) + val data = superStreamAPI.load(anime.url) val ani = SAnime.create() val (movie, seriesData) = data val (detail, _) = seriesData @@ -192,21 +192,6 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() { override fun animeDetailsParse(response: Response) = throw Exception("not used") override fun setupPreferenceScreen(screen: PreferenceScreen) { - val domainPref = ListPreference(screen.context).apply { - key = "preferred_domain" - title = "Preferred domain (requires app restart)" - entries = arrayOf("Default") - entryValues = arrayOf(superStreamAPI.apiUrl) - setDefaultValue(superStreamAPI.apiUrl) - summary = "%s" - - setOnPreferenceChangeListener { _, newValue -> - val selected = newValue as String - val index = findIndexOfValue(selected) - val entry = entryValues[index] as String - preferences.edit().putString(key, entry).commit() - } - } val videoQualityPref = ListPreference(screen.context).apply { key = "preferred_quality" title = "Preferred quality" @@ -222,7 +207,6 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() { preferences.edit().putString(key, entry).commit() } } - screen.addPreference(domainPref) screen.addPreference(videoQualityPref) } diff --git a/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStreamAPI.kt b/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStreamAPI.kt index f8c1d79f85..c97dba0c9b 100644 --- a/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStreamAPI.kt +++ b/src/en/superstream/src/eu/kanade/tachiyomi/animeextension/en/superstream/SuperStreamAPI.kt @@ -686,7 +686,6 @@ import eu.kanade.tachiyomi.animesource.model.SAnime import eu.kanade.tachiyomi.animesource.model.Track import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.network.POST -import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.jsonPrimitive @@ -815,7 +814,7 @@ class SuperStreamAPI(val json: Json) { } } - private fun queryApi(query: String, altApi: Boolean = false): Response { + private fun queryApi(query: String): Response { val encryptedQuery = CipherUtils.encrypt(query, key, iv)!! val appKeyHash = CipherUtils.md5(appKey)!! val newBody = @@ -837,15 +836,14 @@ class SuperStreamAPI(val json: Json) { .add("medium", "Website&token$token") .build() try { - val url = if (altApi) secondApiUrl else thirdApiUrl - return client.newCall(POST(url, headers = headers, body = formData)).execute() + return client.newCall(POST(apiUrl, headers = headers, body = formData)).execute() } catch (e: Exception) { throw Exception("Query Failed\n$e") } } - private inline fun queryApiParsed(query: String, altApi: Boolean = false): T { - return parseJson(queryApi(query, altApi).body.string()) + private inline fun queryApiParsed(query: String): T { + return parseJson(queryApi(query).body.string()) } private val unixTime: Long @@ -864,13 +862,7 @@ class SuperStreamAPI(val json: Json) { // Free Tibet, The Tienanmen Square protests of 1989 private val iv = base64Decode("d0VpcGhUbiE=") private val key = base64Decode("MTIzZDZjZWRmNjI2ZHk1NDIzM2FhMXc2") - private val ip = base64Decode("aHR0cHM6Ly8xNTIuMzIuMTQ5LjE2MA==") - val apiUrl = "$ip${base64Decode("L2FwaS9hcGlfY2xpZW50L2luZGV4Lw==")}" - - // Thanks @Blatzar and his dream from cloudstream for the secondurl - private val secondApiUrl = - base64Decode("aHR0cHM6Ly9tYnBhcGkuc2hlZ3UubmV0L2FwaS9hcGlfY2xpZW50L2luZGV4Lw==") - private val thirdApiUrl = base64Decode("aHR0cHM6Ly9zaG93Ym94LnNoZWd1Lm5ldC9hcGkvYXBpX2NsaWVudC9pbmRleC8=") + private val apiUrl = base64Decode("aHR0cHM6Ly9zaG93Ym94LnNoZWd1Lm5ldC9hcGkvYXBpX2NsaWVudC9pbmRleC8=") private val appKey = base64Decode("bW92aWVib3g=") private val appId = base64Decode("Y29tLnRkby5zaG93Ym94") @@ -940,13 +932,13 @@ class SuperStreamAPI(val json: Json) { val apiQuery = // Originally 8 pagelimit """{"childmode":"$hideNsfw","app_version":"11.5","appid":"$appId","module":"Search3","channel":"Website","page":"$page","lang":"en","type":"all","keyword":"$query","pagelimit":"20","expired_date":"${getExpiryDate()}","platform":"android"}""" - val searchResponse = parseJson(queryApi(apiQuery, true).body.string()).data.mapNotNull { + val searchResponse = parseJson(queryApi(apiQuery).body.string()).data.mapNotNull { it.toSearchResponse() } return searchResponse } - fun load(url: String, altApi: Boolean = false): Pair?>> { + fun load(url: String): Pair?>> { val loadData = parseJson(url) // val module = if(type === "TvType.Movie") "Movie_detail" else "*tv series module*" @@ -955,14 +947,14 @@ class SuperStreamAPI(val json: Json) { 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":""}""" - val data = queryApiParsed(apiQuery, altApi).data + val data = queryApiParsed(apiQuery).data ?: throw RuntimeException("API error") return Pair(data, Pair(null, null)) } else { // 2 Series val apiQuery = """{"childmode":"$hideNsfw","uid":"","app_version":"11.5","appid":"$appId","module":"TV_detail_1","display_all":"1","channel":"Website","lang":"en","expired_date":"${getExpiryDate()}","platform":"android","tid":"${loadData.id}"}""" - val data = queryApiParsed(apiQuery, altApi).data + val data = queryApiParsed(apiQuery).data ?: throw RuntimeException("API error") val episodes = data.season.mapNotNull {