diff --git a/src/en/nuxscans/build.gradle b/src/en/nuxscans/build.gradle new file mode 100644 index 000000000..a3a71e39f --- /dev/null +++ b/src/en/nuxscans/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'Nux Scans' + pkgNameSuffix = 'en.nuxscans' + extClass = '.NuxScans' + extVersionCode = 1 + libVersion = '1.2' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/nuxscans/res/mipmap-hdpi/ic_launcher.png b/src/en/nuxscans/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..1da8ef62a Binary files /dev/null and b/src/en/nuxscans/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/en/nuxscans/res/mipmap-mdpi/ic_launcher.png b/src/en/nuxscans/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..5d44e0437 Binary files /dev/null and b/src/en/nuxscans/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/en/nuxscans/res/mipmap-xhdpi/ic_launcher.png b/src/en/nuxscans/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..38fa8c74f Binary files /dev/null and b/src/en/nuxscans/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/en/nuxscans/res/mipmap-xxhdpi/ic_launcher.png b/src/en/nuxscans/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..b404d6028 Binary files /dev/null and b/src/en/nuxscans/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/en/nuxscans/res/mipmap-xxxhdpi/ic_launcher.png b/src/en/nuxscans/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..3a93452a3 Binary files /dev/null and b/src/en/nuxscans/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/en/nuxscans/res/web_hi_res_512.png b/src/en/nuxscans/res/web_hi_res_512.png new file mode 100644 index 000000000..02ec3d4d7 Binary files /dev/null and b/src/en/nuxscans/res/web_hi_res_512.png differ diff --git a/src/en/nuxscans/src/eu/kanade/tachiyomi/extension/en/nuxscans/NuxScans.kt b/src/en/nuxscans/src/eu/kanade/tachiyomi/extension/en/nuxscans/NuxScans.kt new file mode 100644 index 000000000..bdce0adf7 --- /dev/null +++ b/src/en/nuxscans/src/eu/kanade/tachiyomi/extension/en/nuxscans/NuxScans.kt @@ -0,0 +1,110 @@ +package eu.kanade.tachiyomi.extension.en.nuxscans + +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.FilterList +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 okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element + +class NuxScans : ParsedHttpSource() { + + override val name = "Nux Scans" + override val baseUrl = "https://nuxscans.blogspot.com" + val baseUrl2 = "https://nuxscans-comics.blogspot.com" + override val lang = "en" + override val supportsLatest = false + override val client: OkHttpClient = network.cloudflareClient + + // popular + override fun popularMangaRequest(page: Int): Request { + return GET(baseUrl2) + } + + override fun popularMangaSelector() = "#Blog1 .hfeed .hentry .post-content" + + override fun popularMangaFromElement(element: Element): SManga { + val manga = SManga.create() + manga.thumbnail_url = element.select(".post-image-link img").attr("src") + manga.url = element.select(".post-info .post-title a").attr("href").substringAfter(baseUrl2) + manga.title = element.select(".post-info .post-tag").text() + return manga + } + + override fun popularMangaNextPageSelector(): String? = null + + // latest + override fun latestUpdatesRequest(page: Int): Request = throw UnsupportedOperationException() + + override fun latestUpdatesSelector(): String = throw UnsupportedOperationException() + + override fun latestUpdatesFromElement(element: Element): SManga = throw UnsupportedOperationException() + + override fun latestUpdatesNextPageSelector(): String? = throw UnsupportedOperationException() + + // search + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = throw UnsupportedOperationException() + + override fun searchMangaSelector(): String = throw UnsupportedOperationException() + + override fun searchMangaFromElement(element: Element): SManga = throw UnsupportedOperationException() + + override fun searchMangaNextPageSelector(): String? = throw UnsupportedOperationException() + + // manga details + override fun mangaDetailsRequest(manga: SManga): Request { + return GET(baseUrl2 + manga.url) + } + + override fun mangaDetailsParse(document: Document) = SManga.create().apply { + thumbnail_url = document.select("a#unclick").attr("href") + title = document.select("div.post-header .post-tag").text() + description = document.select(".gridnux .column1 .text-overflow").joinToString("\n") { it.text() } + } + + private fun parseStatus(element: String): Int = when { + element.toLowerCase().contains("ongoing") -> SManga.ONGOING + element.toLowerCase().contains("completed") -> SManga.COMPLETED + else -> SManga.UNKNOWN + } + + // chapters + override fun chapterListRequest(manga: SManga): Request { + return GET(baseUrl2 + manga.url) + } + + override fun chapterListSelector() = ".column1 .text-truncate a" + + override fun chapterListParse(response: Response): List { + return super.chapterListParse(response).reversed() + } + + override fun chapterFromElement(element: Element): SChapter { + val urlElement = element.select("a").first() + val chapter = SChapter.create() + chapter.setUrlWithoutDomain(urlElement.attr("href")) + chapter.name = element.select("p").text() + return chapter + } + + // pages + override fun pageListParse(document: Document): List { + val pages = mutableListOf() + var i = 0 + document.select(".post-content .separator a img").forEach { element -> + val url = element.attr("src") + i++ + if (url.isNotEmpty()) { + pages.add(Page(i, "", url)) + } + } + return pages + } + + override fun imageUrlParse(document: Document) = "" +}