[MangaRaw] merge MangaPro and Comick into new Manga9Co (#12571)

This commit is contained in:
KoSChicken 2022-07-14 20:46:34 +08:00 committed by GitHub
parent 2e8e4b1916
commit 33f1c80fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 46 additions and 43 deletions

View File

@ -1,17 +0,0 @@
package eu.kanade.tachiyomi.extension.ja.comick
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw
import eu.kanade.tachiyomi.network.GET
import okhttp3.Request
// Comick has a slightly different layout in html, even though it looks exactly the same to MangaRaw visually
class Comick : MangaRaw("Comick", "https://comick.top") {
override val imageSelector = ".entry-content img"
// comick.top doesn't have a popular manga page
// redirect to latest manga request
override fun popularMangaRequest(page: Int): Request = latestUpdatesRequest(page)
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
}

View File

@ -3,9 +3,5 @@ package eu.kanade.tachiyomi.extension.ja.manga1001
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
class Manga1001 : MangaRaw("Manga1001", "https://manga1001.top/") { class Manga1001 : MangaRaw("Manga1001", "https://manga1001.top") {
override fun latestUpdatesNextPageSelector(): String? {
return null
}
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
} }

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -0,0 +1,42 @@
package eu.kanade.tachiyomi.extension.ja.manga9co
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw
import eu.kanade.tachiyomi.network.GET
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 okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class Manga9co : MangaRaw("Manga9co", "https://manga9.co/") {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/top/?page=$page", headers)
override fun popularMangaSelector() = ".col-sm-4.my-2"
override fun popularMangaNextPageSelector() = "nextpostslink"
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) =
GET("$baseUrl/?s=$query&page=$page", headers)
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
description = document.select("strong").last().text().trim()
}
override fun chapterListSelector() = ".list-scoll a"
override fun chapterFromElement(element: Element) = SChapter.create().apply {
url = element.attr("href").replace(baseUrl, "")
name = element.text().trim()
}
override val imageSelector = ".card-wrap > img"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

View File

@ -1,12 +0,0 @@
package eu.kanade.tachiyomi.extension.ja.mangapro
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw
import eu.kanade.tachiyomi.network.GET
class MangaPro : MangaRaw("MangaPro", "https://mangapro.top") {
override fun latestUpdatesNextPageSelector(): String? {
return null
}
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
}

View File

@ -5,9 +5,6 @@ import eu.kanade.tachiyomi.network.GET
import okhttp3.Request import okhttp3.Request
class SyoSetu : MangaRaw("SyoSetu", "https://syosetu.top") { class SyoSetu : MangaRaw("SyoSetu", "https://syosetu.top") {
// syosetu.top doesn't have a popular manga page // syosetu.top doesn't have a popular manga page redirect to latest manga request
// redirect to latest manga request
override fun popularMangaRequest(page: Int): Request = latestUpdatesRequest(page) override fun popularMangaRequest(page: Int): Request = latestUpdatesRequest(page)
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
} }

View File

@ -44,9 +44,7 @@ abstract class MangaRaw(
override fun popularMangaNextPageSelector() = ".next.page-numbers" override fun popularMangaNextPageSelector() = ".next.page-numbers"
// manga101 and mangapro have a '新刊コミック' page, but all manga under syosetu.top. override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
// visit these manga will cause "Too many follow-up requests: 21" and this make latest update complete unusable
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/newmanga/page/$page", headers)
override fun latestUpdatesSelector() = popularMangaSelector() override fun latestUpdatesSelector() = popularMangaSelector()

View File

@ -11,10 +11,9 @@ class MangaRawGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 1 override val baseVersionCode: Int = 1
override val sources = listOf( override val sources = listOf(
SingleLang("Comick", "https://comick.top", "ja", isNsfw = false, overrideVersionCode = 1),
SingleLang("Manga1001", "https://manga1001.top", "ja", isNsfw = false, overrideVersionCode = 1), SingleLang("Manga1001", "https://manga1001.top", "ja", isNsfw = false, overrideVersionCode = 1),
SingleLang("MangaPro", "https://mangapro.top", "ja", isNsfw = false, overrideVersionCode = 1),
SingleLang("SyoSetu", "https://syosetu.top", "ja", isNsfw = false, overrideVersionCode = 1), SingleLang("SyoSetu", "https://syosetu.top", "ja", isNsfw = false, overrideVersionCode = 1),
SingleLang("Manga9co", "https://manga9.co", "ja", isNsfw = false, overrideVersionCode = 1),
) )
companion object { companion object {