diff --git a/src/ja/mangaraw/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/mangaraw/comick/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from src/ja/mangaraw/res/mipmap-hdpi/ic_launcher.png rename to multisrc/overrides/mangaraw/comick/res/mipmap-hdpi/ic_launcher.png diff --git a/src/ja/mangaraw/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/mangaraw/comick/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from src/ja/mangaraw/res/mipmap-mdpi/ic_launcher.png rename to multisrc/overrides/mangaraw/comick/res/mipmap-mdpi/ic_launcher.png diff --git a/src/ja/mangaraw/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/comick/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from src/ja/mangaraw/res/mipmap-xhdpi/ic_launcher.png rename to multisrc/overrides/mangaraw/comick/res/mipmap-xhdpi/ic_launcher.png diff --git a/src/ja/mangaraw/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/comick/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from src/ja/mangaraw/res/mipmap-xxhdpi/ic_launcher.png rename to multisrc/overrides/mangaraw/comick/res/mipmap-xxhdpi/ic_launcher.png diff --git a/src/ja/mangaraw/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/comick/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from src/ja/mangaraw/res/mipmap-xxxhdpi/ic_launcher.png rename to multisrc/overrides/mangaraw/comick/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/src/ja/mangaraw/res/web_hi_res_512.png b/multisrc/overrides/mangaraw/comick/res/web_hi_res_512.png similarity index 100% rename from src/ja/mangaraw/res/web_hi_res_512.png rename to multisrc/overrides/mangaraw/comick/res/web_hi_res_512.png diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/Comick.kt b/multisrc/overrides/mangaraw/comick/src/Comick.kt similarity index 56% rename from src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/Comick.kt rename to multisrc/overrides/mangaraw/comick/src/Comick.kt index 857d5885e..a0d20d583 100644 --- a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/Comick.kt +++ b/multisrc/overrides/mangaraw/comick/src/Comick.kt @@ -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) } diff --git a/multisrc/overrides/mangaraw/manga1001/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/mangaraw/manga1001/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..601d86661 Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/mangaraw/manga1001/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..969acba92 Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..18380c9ca Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7d6b77d4f Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..6c853797b Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/res/web_hi_res_512.png b/multisrc/overrides/mangaraw/manga1001/res/web_hi_res_512.png new file mode 100644 index 000000000..ba73ec67f Binary files /dev/null and b/multisrc/overrides/mangaraw/manga1001/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/mangaraw/manga1001/src/Manga1001.kt b/multisrc/overrides/mangaraw/manga1001/src/Manga1001.kt new file mode 100644 index 000000000..d6c4c6943 --- /dev/null +++ b/multisrc/overrides/mangaraw/manga1001/src/Manga1001.kt @@ -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) +} diff --git a/multisrc/overrides/mangaraw/mangapro/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/mangaraw/mangapro/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..601d86661 Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/mangaraw/mangapro/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..969acba92 Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..18380c9ca Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7d6b77d4f Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..6c853797b Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/res/web_hi_res_512.png b/multisrc/overrides/mangaraw/mangapro/res/web_hi_res_512.png new file mode 100644 index 000000000..ba73ec67f Binary files /dev/null and b/multisrc/overrides/mangaraw/mangapro/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/mangaraw/mangapro/src/MangaPro.kt b/multisrc/overrides/mangaraw/mangapro/src/MangaPro.kt new file mode 100644 index 000000000..9ad6ca42a --- /dev/null +++ b/multisrc/overrides/mangaraw/mangapro/src/MangaPro.kt @@ -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) +} diff --git a/multisrc/overrides/mangaraw/syosetu/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/mangaraw/syosetu/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..601d86661 Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/mangaraw/syosetu/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..969acba92 Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..18380c9ca Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7d6b77d4f Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..6c853797b Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/res/web_hi_res_512.png b/multisrc/overrides/mangaraw/syosetu/res/web_hi_res_512.png new file mode 100644 index 000000000..ba73ec67f Binary files /dev/null and b/multisrc/overrides/mangaraw/syosetu/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/mangaraw/syosetu/src/SyoSetu.kt b/multisrc/overrides/mangaraw/syosetu/src/SyoSetu.kt new file mode 100644 index 000000000..ec67f3c5f --- /dev/null +++ b/multisrc/overrides/mangaraw/syosetu/src/SyoSetu.kt @@ -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) +} diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRaw.kt similarity index 70% rename from src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt rename to multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRaw.kt index 54052f5b1..f5aa853ed 100644 --- a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRaw.kt @@ -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

tag - // So here are some jank way of extracting them - description = document.select("#main > article > div > div > div > div > p").html() - .substringAfterLast("
") - 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() } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRawGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRawGenerator.kt new file mode 100644 index 000000000..1b2f32342 --- /dev/null +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangaraw/MangaRawGenerator.kt @@ -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) { + MangaRawGenerator().createAll() + } + } +} diff --git a/src/ja/mangaraw/AndroidManifest.xml b/src/ja/mangaraw/AndroidManifest.xml deleted file mode 100644 index 30deb7f79..000000000 --- a/src/ja/mangaraw/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/ja/mangaraw/build.gradle b/src/ja/mangaraw/build.gradle deleted file mode 100644 index c9f1e3a12..000000000 --- a/src/ja/mangaraw/build.gradle +++ /dev/null @@ -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" diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRawFactory.kt b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRawFactory.kt deleted file mode 100644 index 4a556b00d..000000000 --- a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRawFactory.kt +++ /dev/null @@ -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 = listOf( - Comick(), - MangaPro() - ) -} diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/MangaPro.kt b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/MangaPro.kt deleted file mode 100644 index d6d56c00a..000000000 --- a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/sources/MangaPro.kt +++ /dev/null @@ -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("").substringBefore("
").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("
") - thumbnail_url = document.select(".wp-block-image img").attr("abs:src") - } -}