Skip to content

Commit

Permalink
Add MeioNovel and MoreNovel (#82)
Browse files Browse the repository at this point in the history
* add meionovel and more novel

add sources -> meionovel and morenovel

add sources -> meionovel and more novel
add madara-base abstract

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix final

* fix final

* fix final

* fix final x

* fix final x

* fix final x

* using khhtp

* fix typo

* fix typo

* fix typo

* fix khhtp request

* add indowebnovel sakuranuvel

* add indowebnovel sakuranuvel

* add indowebnovel sakuranuvel

* fix typho

fix typho

* fix typho

* fix typho

* fix typho

* fix typho

* add favicon

* add favicon

* fix bg icon color and other code

* fix bg icon color and other code

* fix bg icon color and other code

* fix bg icon color and other code

* fix bg icon color and other code

fix sakurai genre

* fix sakurai genre

* fix wpreader countey querry'

* fix wpreader countey querry'

* fix wpreader countey querry'

* fix wpreader'

* fix wpreader'

* fix wpreader'

* fix wpreader'

* fix wpreader'

* source fixed

* cover fixed
  • Loading branch information
AhmadNaruto authored Jun 2, 2022
1 parent d387bd2 commit a921fa0
Show file tree
Hide file tree
Showing 13 changed files with 517 additions and 2 deletions.
170 changes: 170 additions & 0 deletions app/src/main/java/com/lagradost/quicknovel/MadaraReader.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
package com.lagradost.quicknovel

import java.util.*

abstract class MadaraReader : MainAPI() {
open override val name = ""
open override val mainUrl = ""
open override val iconId = R.drawable.ic_meionovel
open override val lang = "id"
override val hasMainPage = true
open override val iconBackgroundId = R.color.lightItemBackground
open val novelGenre: String = "novel-genre"
open val novelTag: String = "novel-tag"
open val covelAttr: String = "data-src"
open val novelPath: String = "novel"

open override val mainCategories: List<Pair<String, String>> = listOf(
Pair("All", ""),
Pair("Novel Tamat", "tamat"),
Pair("Novel Korea", "novel-korea"),
Pair("Novel China", "novel-china"),
Pair("Novel Jepang", "novel-jepang"),
Pair("Novel HTL (Human Translate)", "htl"),
)

open override val tags: List<Pair<String, String>> = listOf(
Pair("All", ""),
Pair("Action", "action"),
Pair("Adventure", "adventure"),
Pair("Romance", "romance"),
Pair("Comedy", "comedy"),
Pair("Drama", "drama"),
Pair("Shounen", "shounen"),
Pair("School Life", "school-life"),
Pair("Shoujo", "shoujo"),
Pair("Ecchi", "ecchi"),
Pair("Fantasy", "fantasy"),
Pair("Gender Bender", "gender-bender"),
Pair("Harem", "harem"),
Pair("Historical", "historical"),
Pair("Horror", "horror"),
Pair("Josei", "josei"),
Pair("Martial Arts", "martial-arts"),
Pair("Mature", "mature"),
Pair("Mecha", "mecha"),
Pair("Mystery", "mystery"),
Pair("One shot", "one-shot"),
Pair("Psychological", "psychological"),
Pair("Sci-fi", "sci-fi"),
Pair("Seinen", "seinen"),
Pair("Shoujo Ai", "shoujo-ai"),
Pair("Shounen Ai", "shounen-ai"),
Pair("Slice of Life", "slice-of-life"),
Pair("Smut", "smut"),
Pair("Sports", "sports"),
Pair("Supernatural", "supernatural"),
)

open override val orderBys: List<Pair<String, String>> = listOf(
Pair("Nothing", ""),
Pair("New", "new-manga"),
Pair("Most Views", "views"),
Pair("Trending", "trending"),
Pair("Rating", "rating"),
Pair("A-Z", "alphabet"),
Pair("Latest", "latest"),
)

open override fun loadMainPage(
page: Int,
mainCategory: String?,
orderBy: String?,
tag: String?,
): HeadMainPageResponse {
val cek: Set<String?> = setOf(null, "")
val order: String = when {
mainCategory !in cek -> "$novelTag/$mainCategory"
tag !in cek -> "$novelGenre/$tag"
else -> novelPath
}

val url = mainUrl.toUrlBuilderSafe()
?.addPath(order)
.ifCase(page > 1) { addPath("page", page.toString()) }
.ifCase(orderBy !in cek) { add("m_orderby", "$orderBy") }
.toString()

val headers = jConnect(url)?.select("div.page-item-detail")
if (headers == null || headers.size <= 0) {
return HeadMainPageResponse(url, listOf())
}

val returnValue = headers
.mapNotNull {
val imageHeader = it.selectFirst("div.item-thumb > a")
val cName = imageHeader.attr("title")
val cUrl = imageHeader.attr("href") ?: ""
val posterUrl = imageHeader.selectFirst("> img")?.attr(covelAttr) ?: ""
val sum = it.selectFirst("div.item-summary")
val rating = sum.selectFirst("> div.rating > div.post-total-rating > span.score")
?.text()
?.toRate()
val latestChap =
sum.selectFirst("> div.list-chapter > div.chapter-item > span > a").text()
SearchResponse(cName, cUrl, posterUrl, rating, latestChap, this.name)
}

return HeadMainPageResponse(url, returnValue)
}

open override fun loadHtml(url: String): String? {
val res = jConnect(url)!!.selectFirst("div.text-left")
if (res == null || res.html() == "") return null
return res.let { adv ->
adv.select("p:has(a)")?.forEach { it.remove() }
adv.html()
}
}

open override fun search(query: String): List<SearchResponse> {
val headers = jConnect("$mainUrl/?s=$query&post_type=wp-manga")
?.select("div.c-tabs-item__content")
if (headers == null || headers.size <= 0) {
return listOf()
}
return headers
?.mapNotNull {
// val head = it.selectFirst("> div > div.tab-summary")
val title = it.selectFirst("div.post-title > h3 > a")
val name = title.text()
val url = title.attr("href")
val posterUrl = it.selectFirst("div.tab-thumb > a > img")?.attr(covelAttr) ?: ""
val meta = it.selectFirst("div.tab-meta")
val rating =
meta.selectFirst("div.rating > div.post-total-rating > span.total_votes")
.text().toRate()
val latestChapter = meta.selectFirst("div.latest-chap > span.chapter > a").text()
SearchResponse(name, url, posterUrl, rating, latestChapter, this.name)
}
}

open override fun load(url: String): LoadResponse {
val doc = jConnect(url)
return LoadResponse(
url = url,
name = doc?.selectFirst("div.post-title > h1")
?.text()?.clean() ?: "",
author = doc?.selectFirst(".author-content > a")?.text() ?: "",
posterUrl = doc?.select("div.summary_image > a > img")?.attr(covelAttr) ?: "",
tags = doc?.select("div.genres-content > a")?.mapNotNull { it?.text()?.clean() },
synopsis = doc?.select("div.summary__content")?.text()?.synopsis() ?: "",
data = jConnect("${url}ajax/chapters/", method = "POST")
?.select(".wp-manga-chapter > a[href]")
?.mapNotNull {
ChapterData(
name = it?.selectFirst("a")?.text()?.clean() ?: "",
url = it?.selectFirst("a")?.attr("href") ?: "",
dateOfRelease = it.selectFirst("span > i")?.text(),
views = 0
)
}
?.reversed() ?: listOf(),
rating = doc?.selectFirst("span#averagerate")?.text()?.toRate(),
peopleVoted = doc?.selectFirst("span#countrate")?.text()?.toVote(),
views = null,
status = doc?.select(".post-content_item:contains(Status) > .summary-content")
?.text()?.toStatus(),
)
}
}
137 changes: 137 additions & 0 deletions app/src/main/java/com/lagradost/quicknovel/WPReader.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
package com.lagradost.quicknovel

import java.util.*

abstract class WPReader : MainAPI() {
open override val name = ""
open override val mainUrl = ""
open override val lang = "id"
open override val iconId = R.drawable.ic_meionovel
open override val hasMainPage = true
open override val iconBackgroundId = R.color.lightItemBackground
open override val tags = listOf(
Pair("All", ""),
Pair("Action", "action"),
Pair("Adult", "adult"),
Pair("Adventure", "adventure"),
Pair("China", "china"),
Pair("Comedy", "comedy"),
Pair("Drama", "drama"),
Pair("Ecchi", "ecchi"),
Pair("Fantasy", "fantasy"),
Pair("Harem", "harem"),
Pair("Historical", "historical"),
Pair("Horror", "horror"),
Pair("Jepang", "jepang"),
Pair("Josei", "josei"),
Pair("Martial Arts", "martial-arts"),
Pair("Mature", "mature"),
Pair("Mystery", "mystery"),
Pair("Original (Inggris)", "original-inggris"),
Pair("Psychological", "psychological"),
Pair("Romance", "romance"),
Pair("School Life", "school-life"),
Pair("Sci-fi", "sci-fi"),
Pair("Seinen", "seinen"),
Pair("Seinen Xuanhuan", "seinen-xuanhuan"),
Pair("Shounen", "shounen"),
Pair("Slice of Life", "slice-of-life"),
Pair("Smut", "smut"),
Pair("Sports", "sports"),
Pair("Supernatural", "supernatural"),
Pair("Tragedy", "tragedy"),
Pair("Xianxia", "xianxia"),
Pair("Xuanhuan", "xuanhuan"),
)
/*
open override val orderBys: List<Pair<String, String>> = listOf(
Pair("Latest Update", "update"),
Pair("Most Views", "popular"),
Pair("Rating", "rating"),
Pair("A-Z", "title"),
Pair("Latest Add", "latest"),
)
*/
// open val country: List<String> = listOf("jepang", "china", "korea", "unknown",)

open override fun loadMainPage(
page: Int,
mainCategory: String?,
orderBy: String?,
tag: String?,
): HeadMainPageResponse {
val url = mainUrl
.toUrlBuilderSafe()
.ifCase(tag != "") { addPath("genre", "$tag") }
.ifCase(page > 1) { addPath("page", page.toString()) }
.toString()

val res = jConnect(url)
?.select(if (tag == "") ".flexbox3-content > a" else ".flexbox2-content > a")
?.mapNotNull {
SearchResponse(
name = it?.attr("title") ?: "",
url = it?.attr("href") ?: "",
posterUrl = it?.selectFirst("img")?.attr("src") ?: "",
rating = if (tag == "") it?.selectFirst(".score")?.text()?.toRate() else null,
latestChapter = if (tag == "") it?.selectFirst("div.season")?.text()?.toChapters() else null,
apiName = name
)
}

return HeadMainPageResponse(url, res ?: ArrayList())
}

open override fun loadHtml(url: String): String? {
val con = jConnect(url)
var res = con?.selectFirst(".mn-novel-chapter-content-body") ?: con?.selectFirst(".reader-area")
return res?.let { adv ->
adv?.select("p")?.filter { !it.hasText() }?.forEach { it.remove() }
adv.outerHtml()
}
}

open override fun search(query: String): List<SearchResponse> {
val url = mainUrl.toUrlBuilderSafe().add("s" to query)
return jConnect(url = url.toString())
?.select("div.flexbox2-content > a")
?.mapNotNull {
SearchResponse(
name = it?.attr("title") ?: "",
url = it?.attr("href") ?: "",
posterUrl = it?.selectFirst("img")?.attr("src") ?: "",
rating = it?.selectFirst(".score")?.text()?.toRate(),
latestChapter = it?.selectFirst("div.season")?.text()?.toChapters(),
apiName = name
)
} ?: ArrayList()
}

open override fun load(url: String): LoadResponse {
val doc = jConnect(url)
return LoadResponse(
url = url,
name = doc?.selectFirst(".series-titlex > h2")?.text()?.clean() ?: "",
data = doc?.select("div.flexch-infoz > a")
?.mapNotNull { dat ->
ChapterData(
name = dat.attr("title")?.clean() ?: "",
url = dat.attr("href")?.clean() ?: "",
dateOfRelease = dat.selectFirst("span.date")?.text()?.clean() ?: "",
views = 0,
)
}?.reversed() ?: listOf(ChapterData("", "", null, null)),
author = doc?.selectFirst("li:contains(Author)")
?.selectFirst("span")?.text()?.clean() ?: "",
posterUrl = doc?.selectFirst("div.series-thumb img")
?.attr("src") ?: "",
rating = doc?.selectFirst("span[itemprop=ratingValue]")?.text()?.toRate(),
peopleVoted = 0,
views = 0,
synopsis = doc?.selectFirst(".series-synops")?.text()?.synopsis() ?: "",
tags = doc?.selectFirst("div.series-genres")?.select("a")
?.mapNotNull { tag -> tag?.text()?.clean() },
status = doc?.selectFirst("span.status")?.text()?.toStatus(),
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.lagradost.quicknovel.providers

import com.lagradost.quicknovel.*
import java.util.*

class IndoWebNovelProvider : WPReader() {
override val name = "IndoWebNovel"
override val mainUrl = "https://indowebnovel.id"
override val iconId = R.drawable.ic_indowebnovel
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.lagradost.quicknovel.providers

import com.lagradost.quicknovel.*

class MeioNovelProvider : MadaraReader() {
override val name = "MeioNovel"
override val mainUrl = "https://meionovel.id"
override val iconId = R.drawable.ic_meionovel
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.lagradost.quicknovel.providers

import com.lagradost.quicknovel.*

class MoreNovelProvider : MadaraReader() {
override val name = "MoreNovel"
override val mainUrl = "https://morenovel.net"
override val iconId = R.drawable.ic_morenovel
override val mainCategories: List<Pair<String, String>>
get() = listOf(
Pair("All", ""),
Pair("Novel Korea", "korean"),
Pair("Novel China", "chinese"),
Pair("Novel Jepang", "japanese"),
Pair("Novel Philipina", "philippines")
)

override val tags: List<Pair<String, String>>
get() = listOf(
Pair("All", ""),
Pair("Fantasy", "fantasy"),
Pair("Martial Arts", "martial-arts"),
Pair("Xuanhuan", "xuanhuan"),
Pair("Xianxia", "xianxia"),
Pair("Wuxia", "wuxia"),
Pair("Action", "action"),
Pair("Adventure", "adventure"),
Pair("Comedy", "comedy"),
Pair("Drama", "drama"),
Pair("Ecchi", "ecchi"),
Pair("Harem", "harem"),
Pair("Gender Bender", "gender-bender"),
Pair("Historical", "historical"),
Pair("Horror", "horror"),
Pair("Josei", "josei"),
Pair("Mature", "mature"),
Pair("Mecha", "mecha"),
Pair("Mystery", "mystery"),
Pair("Psychological", "psychological"),
Pair("Romance", "romance"),
Pair("Sci-fi", "sci-fi"),
Pair("Seinen", "seinen"),
Pair("School Life", "school-life"),
Pair("Shoujo", "shoujo"),
Pair("Shoujo Ai", "shoujo-ai"),
Pair("Shounen", "shounen"),
Pair("Shounen Ai", "shounen-ai"),
Pair("Slice of Life", "slice-of-life"),
Pair("Sports", "sports"),
Pair("Supernatural", "supernatural"),
Pair("Tragedy", "tragedy"),
Pair("Yaoi", "yaoi"),
Pair("Yuri", "yuri"),
)
}
Loading

0 comments on commit a921fa0

Please sign in to comment.