add three new sources to madara (#7905)
* Create MangaDNA.kt * Update MangaDNA.kt * add icon * Create XManga.kt * add three new sources to madara * Update MangaDNA.kt
This commit is contained in:
parent
72fd4cc564
commit
198ab904e8
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -0,0 +1,100 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.en.mangadna
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.annotations.Nsfw
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.network.POST
|
||||||
|
import eu.kanade.tachiyomi.network.asObservable
|
||||||
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
|
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||||
|
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 eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import okhttp3.CacheControl
|
||||||
|
import okhttp3.FormBody
|
||||||
|
import okhttp3.Headers
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
|
import okhttp3.Response
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import rx.Observable
|
||||||
|
import java.text.ParseException
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
import kotlin.math.absoluteValue
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
|
@Nsfw
|
||||||
|
class MangaDNA : Madara("MangaDNA", "https://mangadna.com", "en", dateFormat = SimpleDateFormat("dd MMM yyyy", Locale.US)) {
|
||||||
|
|
||||||
|
override fun chapterListSelector() = "li.a-h, .row-content-chapter li"
|
||||||
|
|
||||||
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
|
val manga = SManga.create()
|
||||||
|
with(document) {
|
||||||
|
select("div.post-title h1").first()?.let {
|
||||||
|
manga.title = it.ownText()
|
||||||
|
}
|
||||||
|
select("div.author-content").first()?.let {
|
||||||
|
if (it.text().notUpdating()) manga.author = it.text()
|
||||||
|
}
|
||||||
|
select("div.artist-content").first()?.let {
|
||||||
|
if (it.text().notUpdating()) manga.artist = it.text()
|
||||||
|
}
|
||||||
|
select("div.panel-story-description").let {
|
||||||
|
manga.description = it.select("div.dsct").text()
|
||||||
|
}
|
||||||
|
select("div.summary_image img").first()?.let {
|
||||||
|
manga.thumbnail_url = imageFromElement(it)
|
||||||
|
}
|
||||||
|
select("div.summary-content").last()?.let {
|
||||||
|
manga.status = when (it.text()) {
|
||||||
|
// I don't know what's the corresponding for COMPLETED and LICENSED
|
||||||
|
// There's no support for "Canceled" or "On Hold"
|
||||||
|
"Completed", "Completo", "Concluído", "Concluido", "Terminé" -> SManga.COMPLETED
|
||||||
|
"OnGoing", "Продолжается", "Updating", "Em Lançamento", "Em andamento", "Em Andamento", "En cours", "Ativo", "Lançando" -> SManga.ONGOING
|
||||||
|
else -> SManga.UNKNOWN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val genres = select("div.genres-content a")
|
||||||
|
.map { element -> element.text().toLowerCase(Locale.ROOT) }
|
||||||
|
.toMutableSet()
|
||||||
|
|
||||||
|
// add tag(s) to genre
|
||||||
|
select("div.tags-content a").forEach { element ->
|
||||||
|
if (genres.contains(element.text()).not()) {
|
||||||
|
genres.add(element.text().toLowerCase(Locale.ROOT))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add manga/manhwa/manhua thinggy to genre
|
||||||
|
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
|
||||||
|
if (it.isEmpty().not() && it.notUpdating() && it != "-" && genres.contains(it).not()) {
|
||||||
|
genres.add(it.toLowerCase(Locale.ROOT))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
manga.genre = genres.toList().joinToString(", ") { it.capitalize(Locale.ROOT) }
|
||||||
|
|
||||||
|
// add alternative name to manga description
|
||||||
|
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||||
|
if (it.isEmpty().not() && it.notUpdating()) {
|
||||||
|
manga.description += when {
|
||||||
|
manga.description.isNullOrEmpty() -> altName + it
|
||||||
|
else -> "\n\n$altName" + it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return manga
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.en.xmanga
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.annotations.Nsfw
|
||||||
|
|
||||||
|
@Nsfw
|
||||||
|
class XManga : Madara("XManga", "https://xmanga.io", "en")
|
|
@ -149,8 +149,10 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("MangaBaz", "https://mangabaz.com", "tr"),
|
SingleLang("MangaBaz", "https://mangabaz.com", "tr"),
|
||||||
SingleLang("MangaBob", "https://mangabob.com", "en", overrideVersionCode = 1),
|
SingleLang("MangaBob", "https://mangabob.com", "en", overrideVersionCode = 1),
|
||||||
SingleLang("MangaCultivator", "https://mangacultivator.com", "en", overrideVersionCode = 1),
|
SingleLang("MangaCultivator", "https://mangacultivator.com", "en", overrideVersionCode = 1),
|
||||||
|
SingleLang("MangaDNA", "https://mangadna.com", "en", isNsfw = true),
|
||||||
SingleLang("MangaDods", "https://www.mangadods.com", "en", overrideVersionCode = 2),
|
SingleLang("MangaDods", "https://www.mangadods.com", "en", overrideVersionCode = 2),
|
||||||
SingleLang("MangaEffect", "https://mangaeffect.com", "en", overrideVersionCode = 1),
|
SingleLang("MangaEffect", "https://mangaeffect.com", "en", overrideVersionCode = 1),
|
||||||
|
SingleLang("MangaFort", "https://mangafort.com", "en"),
|
||||||
SingleLang("MangaFoxFull", "https://mangafoxfull.com", "en"),
|
SingleLang("MangaFoxFull", "https://mangafoxfull.com", "en"),
|
||||||
SingleLang("MangaGreat", "https://mangagreat.com", "en", overrideVersionCode = 1),
|
SingleLang("MangaGreat", "https://mangagreat.com", "en", overrideVersionCode = 1),
|
||||||
SingleLang("MangaKitsune", "https://mangakitsune.com", "en", isNsfw = true, overrideVersionCode = 3),
|
SingleLang("MangaKitsune", "https://mangakitsune.com", "en", isNsfw = true, overrideVersionCode = 3),
|
||||||
|
@ -292,6 +294,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Wonderland", "https://landwebtoons.site", "pt-BR", overrideVersionCode = 2),
|
SingleLang("Wonderland", "https://landwebtoons.site", "pt-BR", overrideVersionCode = 2),
|
||||||
SingleLang("WoopRead", "https://woopread.com", "en", overrideVersionCode = 1),
|
SingleLang("WoopRead", "https://woopread.com", "en", overrideVersionCode = 1),
|
||||||
SingleLang("WuxiaWorld", "https://wuxiaworld.site", "en", overrideVersionCode = 1),
|
SingleLang("WuxiaWorld", "https://wuxiaworld.site", "en", overrideVersionCode = 1),
|
||||||
|
SingleLang("XManga", "https://xmanga.io", "en", isNsfw = true),
|
||||||
SingleLang("XuN Scans", "https://xunscans.xyz", "en", overrideVersionCode = 2),
|
SingleLang("XuN Scans", "https://xunscans.xyz", "en", overrideVersionCode = 2),
|
||||||
SingleLang("Yaoi Fan Clube", "https://yaoifanclube.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 1),
|
SingleLang("Yaoi Fan Clube", "https://yaoifanclube.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 1),
|
||||||
SingleLang("Yaoi.mobi", "https://yaoi.mobi", "en", isNsfw = true, className = "YaoiManga", pkgName = "yaoimanga", overrideVersionCode = 3),
|
SingleLang("Yaoi.mobi", "https://yaoi.mobi", "en", isNsfw = true, className = "YaoiManga", pkgName = "yaoimanga", overrideVersionCode = 3),
|
||||||
|
|
Loading…
Reference in New Issue