diff --git a/src/ja/mangaraw/build.gradle b/src/ja/mangaraw/build.gradle new file mode 100644 index 000000000..7ec75c043 --- /dev/null +++ b/src/ja/mangaraw/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + appName = 'Tachiyomi: MangaRaw' + pkgNameSuffix = 'ja.mangaraw' + extClass = '.MangaRawFactory' + extVersionCode = 1 + libVersion = '1.2' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/ja/mangaraw/res/mipmap-hdpi/ic_launcher.png b/src/ja/mangaraw/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..601d86661 Binary files /dev/null and b/src/ja/mangaraw/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/ja/mangaraw/res/mipmap-mdpi/ic_launcher.png b/src/ja/mangaraw/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..969acba92 Binary files /dev/null and b/src/ja/mangaraw/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/ja/mangaraw/res/mipmap-xhdpi/ic_launcher.png b/src/ja/mangaraw/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..18380c9ca Binary files /dev/null and b/src/ja/mangaraw/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/ja/mangaraw/res/mipmap-xxhdpi/ic_launcher.png b/src/ja/mangaraw/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7d6b77d4f Binary files /dev/null and b/src/ja/mangaraw/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/ja/mangaraw/res/mipmap-xxxhdpi/ic_launcher.png b/src/ja/mangaraw/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..6c853797b Binary files /dev/null and b/src/ja/mangaraw/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/ja/mangaraw/res/web_hi_res_512.png b/src/ja/mangaraw/res/web_hi_res_512.png new file mode 100644 index 000000000..ba73ec67f Binary files /dev/null and b/src/ja/mangaraw/res/web_hi_res_512.png differ diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt new file mode 100644 index 000000000..ba5b6dd1c --- /dev/null +++ b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt @@ -0,0 +1,79 @@ +package eu.kanade.tachiyomi.extension.ja.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 eu.kanade.tachiyomi.source.online.ParsedHttpSource +import java.util.Calendar +import okhttp3.OkHttpClient +import okhttp3.Protocol +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element + +abstract class MangaRaw( + override val name: String, + override val baseUrl: String +) : ParsedHttpSource() { + + override val lang = "ja" + + override val supportsLatest = true + + override val client = network.cloudflareClient.newBuilder() + .protocols(listOf(Protocol.HTTP_1_1)) + .build() + + override fun popularMangaRequest(page: Int) = GET("$baseUrl/seachlist/page/$page/?cat=-1", headers) + + override fun popularMangaSelector() = "article" + + override fun popularMangaFromElement(element: Element) = SManga.create().apply { + 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") + } + + override fun popularMangaNextPageSelector() = ".next.page-numbers" + + 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() + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/page/$page/?s=$query", headers) + + override fun searchMangaSelector() = popularMangaSelector() + + override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element) + + override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() + + override fun mangaDetailsParse(document: Document) = SManga.create().apply { + genre = document.select("p.has-text-color:has(strong) a").joinToString { it.text() } + description = document.select("p.has-text-color:not(:has(strong))").first().text() + thumbnail_url = document.select(".wp-block-image img").attr("abs:src") + } + + override fun chapterListSelector() = ".chapList a" + + override fun chapterFromElement(element: Element) = SChapter.create().apply { + setUrlWithoutDomain(element.attr("href")) + name = element.text().trim() + } + + override fun pageListParse(document: Document): List { + return document.select(".wp-block-image > img").mapIndexed { i, element -> + val attribute = if (element.hasAttr("data-src")) "data-src" else "src" + Page(i, "", element.attr(attribute)) + } + } + + override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not Used") + + override fun getFilterList() = FilterList() +} 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 new file mode 100644 index 000000000..b4a4cf4da --- /dev/null +++ b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRawFactory.kt @@ -0,0 +1,14 @@ +package eu.kanade.tachiyomi.extension.ja.mangaraw + +import eu.kanade.tachiyomi.source.Source +import eu.kanade.tachiyomi.source.SourceFactory + +class MangaRawFactory: SourceFactory { + override fun createSources(): List = listOf( + Manga1000(), + Manga1001() + ) +} + +class Manga1000: MangaRaw("Manga1000", "http://manga1000.com") +class Manga1001: MangaRaw("Manga1001", "http://manga1001.com")