SuperStream: Fix search pagination (#1036)

* SuperStream: Fix search pagination
also increase read timeout to 70 seconds

* SuperStream: Fix search pagination
also increase read timeout to 70 seconds
This commit is contained in:
Samfun75
2022-11-22 11:52:46 +03:00
committed by GitHub
parent 8cd1140aba
commit 17ec32dec1
3 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'SuperStream' extName = 'SuperStream'
pkgNameSuffix = 'en.superstream' pkgNameSuffix = 'en.superstream'
extClass = '.SuperStream' extClass = '.SuperStream'
extVersionCode = 4 extVersionCode = 5
libVersion = '13' libVersion = '13'
} }

View File

@ -129,7 +129,7 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() {
filters: AnimeFilterList filters: AnimeFilterList
): Observable<AnimesPage> { ): Observable<AnimesPage> {
val searchResult = superStreamAPI.search(page, query) val searchResult = superStreamAPI.search(page, query)
return Observable.just(AnimesPage(searchResult, page < 8)) return Observable.just(AnimesPage(searchResult, searchResult.size == 20))
} }
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList) = throw Exception("not used") override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList) = throw Exception("not used")

View File

@ -700,6 +700,7 @@ import java.security.MessageDigest
import java.security.NoSuchAlgorithmException import java.security.NoSuchAlgorithmException
import java.security.SecureRandom import java.security.SecureRandom
import java.security.cert.X509Certificate import java.security.cert.X509Certificate
import java.util.concurrent.TimeUnit
import javax.crypto.Cipher import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec import javax.crypto.spec.SecretKeySpec
@ -823,7 +824,7 @@ class SuperStreamAPI(val json: Json) {
key key
) )
}","encrypt_data":"$encryptedQuery"}""" }","encrypt_data":"$encryptedQuery"}"""
val base64Body = String(Base64.encode(newBody.toByteArray(), Base64.DEFAULT)) val base64Body = String(Base64.encode(newBody.toByteArray(), Base64.NO_WRAP))
val formData: RequestBody = FormBody.Builder() val formData: RequestBody = FormBody.Builder()
.add("data", base64Body) .add("data", base64Body)
@ -1091,6 +1092,7 @@ private fun configureToIgnoreCertificate(): OkHttpClient {
return OkHttpClient.Builder() return OkHttpClient.Builder()
.sslSocketFactory(sslSocketFactory, trustAllCerts[0] as X509TrustManager) .sslSocketFactory(sslSocketFactory, trustAllCerts[0] as X509TrustManager)
.hostnameVerifier { _, _ -> true } .hostnameVerifier { _, _ -> true }
.readTimeout(70, TimeUnit.SECONDS)
.build() .build()
} catch (e: Exception) { } catch (e: Exception) {
throw Exception("Exception while configuring IgnoreSslCertificate: $e") throw Exception("Exception while configuring IgnoreSslCertificate: $e")