From 2759e9c0bb2763de920b0536a7210d306dd00ad8 Mon Sep 17 00:00:00 2001 From: contusionglory <102427829+contusionglory@users.noreply.github.com> Date: Sat, 24 Dec 2022 10:42:59 +0000 Subject: [PATCH] Fixed cursor and increased timeout --- .../src/main/kotlin/com/lagradost/SkillShareProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SkillShareProvider/src/main/kotlin/com/lagradost/SkillShareProvider.kt b/SkillShareProvider/src/main/kotlin/com/lagradost/SkillShareProvider.kt index 1e43dab..cae07af 100644 --- a/SkillShareProvider/src/main/kotlin/com/lagradost/SkillShareProvider.kt +++ b/SkillShareProvider/src/main/kotlin/com/lagradost/SkillShareProvider.kt @@ -34,11 +34,14 @@ class SkillShareProvider : MainAPI() { // all providers must be an instance of M private suspend fun queryMovieApi(payload: String): String { val req = payload.toRequestBody(RequestBodyTypes.JSON.toMediaTypeOrNull()) - return app.post(apiUrl, requestBody = req, referer = "$mainUrl/").text + return app.post(apiUrl, requestBody = req, referer = "$mainUrl/", timeout = 30).text } override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { val sortAttribute = request.data + if (page == 1) + cursor[sortAttribute] = "" + val payload = """{ "query": "query GetClassesByType(${'$'}filter: ClassFilters!, ${'$'}pageSize: Int, ${'$'}cursor: String, ${'$'}type: ClassListType!, ${'$'}sortAttribute: ClassListByTypeSortAttribute) { classListByType(type: ${'$'}type, where: ${'$'}filter, first: ${'$'}pageSize, after: ${'$'}cursor, sortAttribute: ${'$'}sortAttribute) { nodes { id title url sku smallCoverUrl largeCoverUrl } } }", "variables": { "type": "TRENDING_CLASSES", "filter": { "subCategory": "", "classLength": [] }, "pageSize": 30, "cursor": "${cursor[sortAttribute]}", "sortAttribute": "$sortAttribute" }, "operationName": "GetClassesByType" }""" val responseBody = queryMovieApi(payload)