diff --git a/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt b/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt index 790d6a1ba..51a1631e0 100644 --- a/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt +++ b/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt @@ -147,6 +147,9 @@ abstract class ZeistManga( protected open val mangaDetailsSelector = ".grid.gtc-235fr" protected open val mangaDetailsSelectorDescription = "#synopsis" protected open val mangaDetailsSelectorGenres = "div.mt-15 > a[rel=tag]" + protected open val mangaDetailsSelectorAuthor = "span#author" + protected open val mangaDetailsSelectorArtist = "span#artist" + protected open val mangaDetailsSelectorAltName = "header > p" protected open val mangaDetailsSelectorInfo = ".y6x11p" protected open val mangaDetailsSelectorInfoTitle = "strong" protected open val mangaDetailsSelectorInfoDescription = "span.dt" @@ -156,9 +159,18 @@ abstract class ZeistManga( val profileManga = document.selectFirst(mangaDetailsSelector)!! return SManga.create().apply { thumbnail_url = profileManga.selectFirst("img")!!.attr("abs:src") - description = profileManga.select(mangaDetailsSelectorDescription).text() + description = buildString { + append(profileManga.select(mangaDetailsSelectorDescription).text()) + append("\n\n") + profileManga.selectFirst(mangaDetailsSelectorAltName)?.text()?.takeIf { it.isNotBlank() }?.let { + append("Alternative name(s): ") + append(it) + } + }.trim() genre = profileManga.select(mangaDetailsSelectorGenres) .joinToString { it.text() } + author = profileManga.selectFirst(mangaDetailsSelectorAuthor)?.text() + artist = profileManga.selectFirst(mangaDetailsSelectorArtist)?.text() val infoElement = profileManga.select(mangaDetailsSelectorInfo) infoElement.forEach { element -> @@ -202,7 +214,7 @@ abstract class ZeistManga( protected open val useNewChapterFeed = false protected open val useOldChapterFeed = false - private val chapterFeedRegex = """clwd\.run\('([^']+)'""".toRegex() + private val chapterFeedRegex = """clwd\.run\(["'](.*?)["']\)""".toRegex() private val scriptSelector = "#clwd > script" open fun getChapterFeedUrl(doc: Document): String { diff --git a/src/en/dmcscans/build.gradle b/src/en/dmcscans/build.gradle new file mode 100644 index 000000000..ada18b6bb --- /dev/null +++ b/src/en/dmcscans/build.gradle @@ -0,0 +1,9 @@ +ext { + extName = 'DMC Scans' + extClass = '.DMCScans' + themePkg = 'zeistmanga' + baseUrl = 'https://didascans.blogspot.com' + overrideVersionCode = 0 +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/dmcscans/res/mipmap-hdpi/ic_launcher.png b/src/en/dmcscans/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..0d8845b0f Binary files /dev/null and b/src/en/dmcscans/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/en/dmcscans/res/mipmap-mdpi/ic_launcher.png b/src/en/dmcscans/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..54fb6587c Binary files /dev/null and b/src/en/dmcscans/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/en/dmcscans/res/mipmap-xhdpi/ic_launcher.png b/src/en/dmcscans/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..490f942a1 Binary files /dev/null and b/src/en/dmcscans/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/en/dmcscans/res/mipmap-xxhdpi/ic_launcher.png b/src/en/dmcscans/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..755b71a01 Binary files /dev/null and b/src/en/dmcscans/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/en/dmcscans/res/mipmap-xxxhdpi/ic_launcher.png b/src/en/dmcscans/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..d05335b39 Binary files /dev/null and b/src/en/dmcscans/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/en/dmcscans/src/eu/kanade/tachiyomi/extension/en/dmcscans/DMCScans.kt b/src/en/dmcscans/src/eu/kanade/tachiyomi/extension/en/dmcscans/DMCScans.kt new file mode 100644 index 000000000..0a6a6f078 --- /dev/null +++ b/src/en/dmcscans/src/eu/kanade/tachiyomi/extension/en/dmcscans/DMCScans.kt @@ -0,0 +1,66 @@ +package eu.kanade.tachiyomi.extension.en.dmcscans + +import eu.kanade.tachiyomi.multisrc.zeistmanga.Genre +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga +import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.Response +import org.jsoup.Jsoup + +class DMCScans : ZeistManga("DMC Scans", "https://didascans.blogspot.com", "en") { + override val client = super.client.newBuilder() + .rateLimit(2) + .build() + + // ============================== Popular =============================== + + override val popularMangaSelector = ".PopularPosts > article" + override val popularMangaSelectorTitle = ".post-title a" + override val popularMangaSelectorUrl = ".post-title a" + + // =========================== Manga Details ============================ + + override val mangaDetailsSelectorGenres = "#labels > a[rel=tag]" + override val mangaDetailsSelectorInfo = ".imptdt" + + // =============================== Filters ============================== + + override val hasFilters = true + override val hasTypeFilter = false + override val hasLanguageFilter = false + + override fun getGenreList(): List = listOf( + Genre("Adaptation", "Adaptation"), + Genre("Drama", "Drama"), + Genre("Historical", "Historical"), + Genre("Josei(W)", "Josei(W)"), + Genre("Regression", "Regression"), + Genre("Romance", "Romance"), + Genre("Shojo(G)", "Shojo(G)"), + Genre("Slice of Life", "Slice of Life"), + Genre("Transmigration", "Transmigration"), + ) + + // =============================== Pages ================================ + + override fun pageListParse(response: Response): List { + val document = response.asJsoup() + + val imgData = document.selectFirst("script:containsData(imgTags)") + ?.data() + ?.substringAfter("imgTags") + ?.substringAfter("`") + ?.substringBefore("`") + ?.replace("\\\"", "\"") + ?.replace("\\\\", "\\") + ?.replace("\\/", "/") + ?.replace("\\:", ":") + ?.let(Jsoup::parseBodyFragment) + ?: return super.pageListParse(response) + + return imgData.select("img[src]").mapIndexed { i, img -> + Page(i, imageUrl = img.attr("abs:src")) + } + } +}