parent
17fc1acd6c
commit
dc64c90e7e
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'CosplayTele'
|
extName = 'CosplayTele'
|
||||||
extClass = '.CosplayTele'
|
extClass = '.CosplayTele'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,17 +66,17 @@ class CosplayTele : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val popularPageLimit = 20
|
private val popularPageLimit = 20
|
||||||
override fun popularMangaRequest(page: Int) = GET("$baseUrl/wp-json/wordpress-popular-posts/v1/popular-posts?offset=${page * popularPageLimit}&limit=$popularPageLimit&range=last7days")
|
|
||||||
|
override fun popularMangaRequest(page: Int) = GET("$baseUrl/wp-json/wordpress-popular-posts/v1/popular-posts?offset=${page * popularPageLimit}&limit=$popularPageLimit&range=last7days&embed=true&_embed=wp:featuredmedia&_fields=title,link,_embedded,_links.wp:featuredmedia")
|
||||||
override fun popularMangaSelector(): String = ""
|
override fun popularMangaSelector(): String = ""
|
||||||
|
|
||||||
override fun popularMangaParse(response: Response): MangasPage {
|
override fun popularMangaParse(response: Response): MangasPage {
|
||||||
val jsonObject = json.decodeFromString<JsonArray>(response.body.string())
|
val respObject = json.decodeFromString<JsonArray>(response.body.string())
|
||||||
val mangas = jsonObject.map { item ->
|
val mangas = respObject.map { item ->
|
||||||
val head = item.jsonObject["yoast_head_json"]!!.jsonObject
|
|
||||||
SManga.create().apply {
|
SManga.create().apply {
|
||||||
title = head["og_title"]!!.jsonPrimitive.content
|
title = item.jsonObject!!["title"]!!.jsonObject!!["rendered"]!!.jsonPrimitive.content
|
||||||
thumbnail_url = head["og_image"]!!.jsonArray[0].jsonObject["url"]!!.jsonPrimitive.content
|
thumbnail_url = item.jsonObject!!["_embedded"]!!.jsonObject!!["wp:featuredmedia"]!!.jsonArray[0]!!.jsonObject["source_url"]!!.jsonPrimitive.content
|
||||||
setUrlWithoutDomain(head["og_url"]!!.jsonPrimitive.content)
|
setUrlWithoutDomain(item.jsonObject!!["link"]!!.jsonPrimitive.content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return MangasPage(mangas, mangas.size >= popularPageLimit)
|
return MangasPage(mangas, mangas.size >= popularPageLimit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user