mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Fixed cursor and increased timeout
This commit is contained in:
parent
041f8aa7a2
commit
2759e9c0bb
1 changed files with 4 additions and 1 deletions
|
@ -34,11 +34,14 @@ class SkillShareProvider : MainAPI() { // all providers must be an instance of M
|
||||||
|
|
||||||
private suspend fun queryMovieApi(payload: String): String {
|
private suspend fun queryMovieApi(payload: String): String {
|
||||||
val req = payload.toRequestBody(RequestBodyTypes.JSON.toMediaTypeOrNull())
|
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 {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
val sortAttribute = request.data
|
val sortAttribute = request.data
|
||||||
|
if (page == 1)
|
||||||
|
cursor[sortAttribute] = ""
|
||||||
|
|
||||||
val payload =
|
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" }"""
|
"""{ "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)
|
val responseBody = queryMovieApi(payload)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue