Update Mangakawaii (#2309)

Update Mangakawaii
This commit is contained in:
happywillow0 2020-02-28 13:59:58 -05:00 committed by GitHub
parent 506a56a4a3
commit 3c2baf3525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 12 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mangakawaii'
pkgNameSuffix = 'fr.mangakawaii'
extClass = '.MangaKawaii'
extVersionCode = 3
extVersionCode = 4
libVersion = '1.2'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

@ -3,7 +3,10 @@ package eu.kanade.tachiyomi.extension.fr.mangakawaii
import android.net.Uri
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
@ -18,22 +21,22 @@ import java.util.*
class MangaKawaii : ParsedHttpSource() {
override val name = "Mangakawaii"
override val baseUrl = "https://www.mangakawaii.to"
override val baseUrl = "https://www.mangakawaii.com"
override val lang = "fr"
override val supportsLatest = false
override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient
override fun popularMangaSelector() = "a.manga-block-item__content"
override fun latestUpdatesSelector() = throw Exception("Not Used")
override fun latestUpdatesSelector() = ".manga-list li div.updates__left"
override fun searchMangaSelector() = "h1 + ul a[href*=manga]"
override fun chapterListSelector() = "div.chapter-item.volume-0, div.chapter-item.volume-"
override fun popularMangaNextPageSelector() = "a[rel=next]"
override fun latestUpdatesNextPageSelector() = throw Exception("Not Used")
override fun latestUpdatesNextPageSelector(): String? = null
override fun searchMangaNextPageSelector() = "no selector"
override fun popularMangaRequest(page: Int) = GET("$baseUrl/filterLists?page=$page&sortBy=views&asc=false", headers)
override fun latestUpdatesRequest(page: Int) = throw Exception("Not Used")
override fun latestUpdatesRequest(page: Int) = GET(baseUrl, headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val uri = Uri.parse("$baseUrl/search").buildUpon()
.appendQueryParameter("query", query)
@ -47,8 +50,11 @@ class MangaKawaii : ParsedHttpSource() {
manga.thumbnail_url = element.select("a").attr("abs:data-background-image")
return manga
}
override fun latestUpdatesFromElement(element: Element) = throw Exception("Not Used")
override fun latestUpdatesFromElement(element: Element): SManga = SManga.create().apply {
title = element.select(" a").attr("title")
setUrlWithoutDomain(element.select("a").attr("href"))
thumbnail_url = element.select("img").attr("data-src")
}
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.url = element.select("a").attr("href")
@ -90,7 +96,7 @@ class MangaKawaii : ParsedHttpSource() {
val body = response.asJsoup()
val element = body.select("script:containsData(Imagesrc)").toString()
val regex = "(data-src).*[\"]".toRegex()
val match = regex.findAll(element)!!.map { it.value.substringAfter("data-src\", \" ").substringBefore("\"").trim() }
val match = regex.findAll(element).map { it.value.substringAfter("data-src\", \" ").substringBefore("\"").trim() }
//throw Exception(match.elementAt(1))
val pages = mutableListOf<Page>()
for (i in 0 until match.count()) {