From 9b2b59f4fe1f58db313d4302af9401eef2916aae Mon Sep 17 00:00:00 2001 From: hexated Date: Sun, 16 Apr 2023 06:55:37 +0700 Subject: [PATCH] small fix --- StremioX/src/main/kotlin/com/hexated/StremioC.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/StremioX/src/main/kotlin/com/hexated/StremioC.kt b/StremioX/src/main/kotlin/com/hexated/StremioC.kt index 4c2df753..add4ede6 100644 --- a/StremioX/src/main/kotlin/com/hexated/StremioC.kt +++ b/StremioX/src/main/kotlin/com/hexated/StremioC.kt @@ -24,7 +24,7 @@ class StremioC : MainAPI() { override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse? { mainUrl = mainUrl.fixSourceUrl() - val res = tryParseJson(app.get("${mainUrl}/manifest.json").text) ?: return null + val res = tryParseJson(request("${mainUrl}/manifest.json").body.string()) ?: return null val lists = mutableListOf() res.catalogs.apmap { catalog -> catalog.toHomePageList(this)?.let { @@ -39,7 +39,7 @@ class StremioC : MainAPI() { override suspend fun search(query: String): List? { mainUrl = mainUrl.fixSourceUrl() - val res = tryParseJson(app.get("${mainUrl}/manifest.json").text) ?: return null + val res = tryParseJson(request("${mainUrl}/manifest.json").body.string()) ?: return null val list = mutableListOf() res.catalogs.apmap { catalog -> list.addAll(catalog.search(query, this)) @@ -150,8 +150,7 @@ class StremioC : MainAPI() { suspend fun search(query: String, provider: StremioC): List { val entries = mutableListOf() types.forEach { type -> - val json = - app.get("${provider.mainUrl}/catalog/${type}/${id}/search=${query}.json").text + val json = request("${provider.mainUrl}/catalog/${type}/${id}/search=${query}.json").body.string() val res = tryParseJson(json) ?: return@forEach @@ -165,7 +164,7 @@ class StremioC : MainAPI() { suspend fun toHomePageList(provider: StremioC): HomePageList? { val entries = mutableListOf() types.forEach { type -> - val json = app.get("${provider.mainUrl}/catalog/${type}/${id}.json").text + val json = request("${provider.mainUrl}/catalog/${type}/${id}.json").body.string() val res = tryParseJson(json) ?: return@forEach