New source: ja/RawINU (#1696)
* feat: Create RawINU base * fix: Fix manga details selector * fix: Fix chapter list * fix: Fix page list * chore: Add source icon * chore: Add isNsfw flag
This commit is contained in:
parent
a3ff15c263
commit
46a6e5e7f3
|
@ -0,0 +1,10 @@
|
|||
ext {
|
||||
extName = 'RawINU'
|
||||
extClass = '.RawINU'
|
||||
themePkg = 'fmreader'
|
||||
baseUrl = 'https://rawinu.com'
|
||||
overrideVersionCode = 0
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,57 @@
|
|||
package eu.kanade.tachiyomi.extension.ja.rawinu
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.fmreader.FMReader
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
||||
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.util.asJsoup
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class RawINU : FMReader(
|
||||
"RawINU",
|
||||
"https://rawinu.com",
|
||||
"ja",
|
||||
) {
|
||||
override val client = network.client.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.build()
|
||||
|
||||
private val apiEndpoint = "$baseUrl/app/manga/controllers"
|
||||
|
||||
// =========================== Manga Details ============================
|
||||
override val infoElementSelector = "div.card-body div.row"
|
||||
|
||||
// ============================== Chapters ==============================
|
||||
override fun chapterListRequest(manga: SManga): Request {
|
||||
val slug = manga.url.substringAfter("/manga-").substringBefore(".html")
|
||||
return GET("$apiEndpoint/cont.Listchapter.php?slug=$slug", headers)
|
||||
}
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
val doc = response.asJsoup()
|
||||
doc.setBaseUri(baseUrl) // Fixes chapter URLs
|
||||
return doc.select(chapterListSelector()).map(::chapterFromElement)
|
||||
}
|
||||
|
||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
||||
setUrlWithoutDomain(element.absUrl("href"))
|
||||
name = element.attr(chapterNameAttrSelector).trim()
|
||||
date_upload = element.select(chapterTimeSelector).run { if (hasText()) parseRelativeDate(text()) else 0 }
|
||||
}
|
||||
|
||||
// =============================== Pages ================================
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val id = document.selectFirst("input[name=chapter]#chapter")!!.attr("value")
|
||||
val req = client.newCall(GET("$apiEndpoint/cont.imagesChap.php?cid=$id", headers)).execute()
|
||||
|
||||
return req.asJsoup().select(pageListImageSelector).mapIndexed { i, img ->
|
||||
Page(i, document.location(), getImgAttr(img))
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue