Change mangapro to manga1001 and fix cover image (#11308)

* fix mangaraw cover image

* change mangatop to manga1001

* mangaRaw multisrc

* add manga1001, mangapro, comick and syosetu to MangaRaw multisrc

* fix cover issues

* change common parser, disable unusable latest update page
This commit is contained in:
KoSChicken 2022-04-07 16:53:04 +08:00 committed by GitHub
parent 7a66dcf3ce
commit 3484716479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 85 additions and 60 deletions

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: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -1,15 +1,17 @@
package eu.kanade.tachiyomi.extension.ja.mangaraw.sources
package eu.kanade.tachiyomi.extension.ja.comick
import eu.kanade.tachiyomi.extension.ja.mangaraw.MangaRaw
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 =
"#main > article > div > div > div.entry-content > center > p > img"
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)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -0,0 +1,12 @@
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)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -0,0 +1,13 @@
package eu.kanade.tachiyomi.extension.ja.syosetu
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRaw
import eu.kanade.tachiyomi.network.GET
import okhttp3.Request
class SyoSetu : MangaRaw("SyoSetu", "https://syosetu.top") {
// syosetu.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

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.extension.ja.mangaraw
package eu.kanade.tachiyomi.multisrc.mangaraw
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
@ -11,6 +11,9 @@ import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
/**
* Common parsers of mangaraw sites, follow manga1001.top by default.
*/
abstract class MangaRaw(
override val name: String,
override val baseUrl: String,
@ -26,26 +29,31 @@ abstract class MangaRaw(
return super.headersBuilder().add("Referer", baseUrl)
}
// manga1001 and mangapro support rank by catalog + year/week. all catalog + week by default.
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/seachlist/page/$page/?cat=-1", headers)
GET("$baseUrl/seachlist/page/$page/?cat=-1&stime=1", headers)
override fun popularMangaSelector() = "article"
override fun popularMangaFromElement(element: Element) = SManga.create().apply {
// FIXME: when manga has different domain, such as manga on '新刊コミック' page, this manga will cause "Too many follow-up requests: 21"
setUrlWithoutDomain(element.select("a:has(img)").attr("href"))
title = element.select("img").attr("alt").substringBefore("(RAW Free)").trim()
thumbnail_url = element.select("img").attr("abs:src")
title = element.select("img").attr("alt").substringBefore("(RAW").trim()
thumbnail_url = element.select("img").attr("data-src")
}
override fun popularMangaNextPageSelector() = ".next.page-numbers"
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/page/$page", headers)
// manga101 and mangapro have a '新刊コミック' page, but all manga under syosetu.top.
// 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 latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
// there's no next page button on latest manga page
override fun latestUpdatesNextPageSelector(): String? { return null }
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) =
GET("$baseUrl/page/$page/?s=$query", headers)
@ -58,16 +66,13 @@ abstract class MangaRaw(
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
// All manga details are located in the same <p> tag
// So here are some jank way of extracting them
description = document.select("#main > article > div > div > div > div > p").html()
.substringAfterLast("<br>")
thumbnail_url = document.select(".wp-block-image img").attr("abs:src")
description = document.select(".entry-content > p").text()
}
override fun chapterListSelector() = ".chapList a"
override fun chapterListSelector() = ".chaplist a"
override fun chapterFromElement(element: Element) = SChapter.create().apply {
setUrlWithoutDomain(element.attr("href"))
url = element.attr("href")
name = element.text().trim()
}

View File

@ -0,0 +1,26 @@
package eu.kanade.tachiyomi.multisrc.mangaraw
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class MangaRawGenerator : ThemeSourceGenerator {
override val themeClass = "MangaRaw"
override val themePkg = "mangaraw"
override val baseVersionCode: Int = 1
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("MangaPro", "https://mangapro.top", "ja", isNsfw = false, overrideVersionCode = 1),
SingleLang("SyoSetu", "https://syosetu.top", "ja", isNsfw = false, overrideVersionCode = 1),
)
companion object {
@JvmStatic
fun main(args: Array<String>) {
MangaRawGenerator().createAll()
}
}
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.kanade.tachiyomi.extension" />

View File

@ -1,11 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'MangaRaw'
pkgNameSuffix = 'ja.mangaraw'
extClass = '.MangaRawFactory'
extVersionCode = 5
}
apply from: "$rootDir/common.gradle"

View File

@ -1,13 +0,0 @@
package eu.kanade.tachiyomi.extension.ja.mangaraw
import eu.kanade.tachiyomi.extension.ja.mangaraw.sources.Comick
import eu.kanade.tachiyomi.extension.ja.mangaraw.sources.MangaPro
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class MangaRawFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
Comick(),
MangaPro()
)
}

View File

@ -1,18 +0,0 @@
package eu.kanade.tachiyomi.extension.ja.mangaraw.sources
import eu.kanade.tachiyomi.extension.ja.mangaraw.MangaRaw
import eu.kanade.tachiyomi.source.model.SManga
import org.jsoup.nodes.Document
class MangaPro : MangaRaw("MangaPro", "https://mangapro.top") {
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
// Extract the author, take out the colon and quotes
author = document.select("#main > article > div > div > div > div > p").html()
.substringAfter("</strong>").substringBefore("<br>").drop(1)
genre = document.select("#main > article > div > div > div > div > p > a")
.joinToString(separator = ", ", transform = { it.text() })
description = document.select("#main > article > div > div > div > div > p").html()
.substringAfterLast("<br>")
thumbnail_url = document.select(".wp-block-image img").attr("abs:src")
}
}