mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
970186e653
commit
9b2b59f4fe
1 changed files with 4 additions and 5 deletions
|
@ -24,7 +24,7 @@ class StremioC : MainAPI() {
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse? {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse? {
|
||||||
mainUrl = mainUrl.fixSourceUrl()
|
mainUrl = mainUrl.fixSourceUrl()
|
||||||
val res = tryParseJson<Manifest>(app.get("${mainUrl}/manifest.json").text) ?: return null
|
val res = tryParseJson<Manifest>(request("${mainUrl}/manifest.json").body.string()) ?: return null
|
||||||
val lists = mutableListOf<HomePageList>()
|
val lists = mutableListOf<HomePageList>()
|
||||||
res.catalogs.apmap { catalog ->
|
res.catalogs.apmap { catalog ->
|
||||||
catalog.toHomePageList(this)?.let {
|
catalog.toHomePageList(this)?.let {
|
||||||
|
@ -39,7 +39,7 @@ class StremioC : MainAPI() {
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse>? {
|
override suspend fun search(query: String): List<SearchResponse>? {
|
||||||
mainUrl = mainUrl.fixSourceUrl()
|
mainUrl = mainUrl.fixSourceUrl()
|
||||||
val res = tryParseJson<Manifest>(app.get("${mainUrl}/manifest.json").text) ?: return null
|
val res = tryParseJson<Manifest>(request("${mainUrl}/manifest.json").body.string()) ?: return null
|
||||||
val list = mutableListOf<SearchResponse>()
|
val list = mutableListOf<SearchResponse>()
|
||||||
res.catalogs.apmap { catalog ->
|
res.catalogs.apmap { catalog ->
|
||||||
list.addAll(catalog.search(query, this))
|
list.addAll(catalog.search(query, this))
|
||||||
|
@ -150,8 +150,7 @@ class StremioC : MainAPI() {
|
||||||
suspend fun search(query: String, provider: StremioC): List<SearchResponse> {
|
suspend fun search(query: String, provider: StremioC): List<SearchResponse> {
|
||||||
val entries = mutableListOf<SearchResponse>()
|
val entries = mutableListOf<SearchResponse>()
|
||||||
types.forEach { type ->
|
types.forEach { type ->
|
||||||
val json =
|
val json = request("${provider.mainUrl}/catalog/${type}/${id}/search=${query}.json").body.string()
|
||||||
app.get("${provider.mainUrl}/catalog/${type}/${id}/search=${query}.json").text
|
|
||||||
val res =
|
val res =
|
||||||
tryParseJson<CatalogResponse>(json)
|
tryParseJson<CatalogResponse>(json)
|
||||||
?: return@forEach
|
?: return@forEach
|
||||||
|
@ -165,7 +164,7 @@ class StremioC : MainAPI() {
|
||||||
suspend fun toHomePageList(provider: StremioC): HomePageList? {
|
suspend fun toHomePageList(provider: StremioC): HomePageList? {
|
||||||
val entries = mutableListOf<SearchResponse>()
|
val entries = mutableListOf<SearchResponse>()
|
||||||
types.forEach { type ->
|
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 =
|
val res =
|
||||||
tryParseJson<CatalogResponse>(json)
|
tryParseJson<CatalogResponse>(json)
|
||||||
?: return@forEach
|
?: return@forEach
|
||||||
|
|
Loading…
Reference in a new issue