diff --git a/multisrc/overrides/madara/mangadna/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/madara/mangadna/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..70eefef0d Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/mangadna/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/madara/mangadna/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..bbbcee188 Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/mangadna/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/madara/mangadna/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..8a6a87d7e Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/mangadna/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/madara/mangadna/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..39738a9ec Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/mangadna/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/madara/mangadna/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..27d9cd214 Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/mangadna/res/web_hi_res_512.png b/multisrc/overrides/madara/mangadna/res/web_hi_res_512.png new file mode 100644 index 000000000..c02682756 Binary files /dev/null and b/multisrc/overrides/madara/mangadna/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/madara/mangadna/src/MangaDNA.kt b/multisrc/overrides/madara/mangadna/src/MangaDNA.kt new file mode 100644 index 000000000..17e7cb622 --- /dev/null +++ b/multisrc/overrides/madara/mangadna/src/MangaDNA.kt @@ -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 + } +} diff --git a/multisrc/overrides/madara/xmanga/src/XManga.kt b/multisrc/overrides/madara/xmanga/src/XManga.kt new file mode 100644 index 000000000..a62487631 --- /dev/null +++ b/multisrc/overrides/madara/xmanga/src/XManga.kt @@ -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") diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index d444867ee..fd751c6a1 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -149,8 +149,10 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("MangaBaz", "https://mangabaz.com", "tr"), SingleLang("MangaBob", "https://mangabob.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("MangaEffect", "https://mangaeffect.com", "en", overrideVersionCode = 1), + SingleLang("MangaFort", "https://mangafort.com", "en"), SingleLang("MangaFoxFull", "https://mangafoxfull.com", "en"), SingleLang("MangaGreat", "https://mangagreat.com", "en", overrideVersionCode = 1), 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("WoopRead", "https://woopread.com", "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("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),