diff --git a/src/en/collectedcurios/AndroidManifest.xml b/src/en/collectedcurios/AndroidManifest.xml new file mode 100644 index 000000000..8072ee00d --- /dev/null +++ b/src/en/collectedcurios/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/src/en/collectedcurios/build.gradle b/src/en/collectedcurios/build.gradle new file mode 100644 index 000000000..fee1c12a4 --- /dev/null +++ b/src/en/collectedcurios/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlinx-serialization' + +ext { + extName = 'Collected Curios' + pkgNameSuffix = 'en.collectedcurios' + extClass = '.Collectedcurios' + extVersionCode = 1 +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/collectedcurios/res/mipmap-hdpi/ic_launcher.png b/src/en/collectedcurios/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..1f05e5105 Binary files /dev/null and b/src/en/collectedcurios/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/en/collectedcurios/res/mipmap-mdpi/ic_launcher.png b/src/en/collectedcurios/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..d98bb875a Binary files /dev/null and b/src/en/collectedcurios/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/en/collectedcurios/res/mipmap-xhdpi/ic_launcher.png b/src/en/collectedcurios/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..8a9f7dbdf Binary files /dev/null and b/src/en/collectedcurios/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/en/collectedcurios/res/mipmap-xxhdpi/ic_launcher.png b/src/en/collectedcurios/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..8614ea601 Binary files /dev/null and b/src/en/collectedcurios/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/en/collectedcurios/res/mipmap-xxxhdpi/ic_launcher.png b/src/en/collectedcurios/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..7a2893734 Binary files /dev/null and b/src/en/collectedcurios/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/en/collectedcurios/res/web_hi_res_512.png b/src/en/collectedcurios/res/web_hi_res_512.png new file mode 100644 index 000000000..dd8a67415 Binary files /dev/null and b/src/en/collectedcurios/res/web_hi_res_512.png differ diff --git a/src/en/collectedcurios/src/eu/kanade/tachiyomi/extension/en/collectedcurios/Collectedcurios.kt b/src/en/collectedcurios/src/eu/kanade/tachiyomi/extension/en/collectedcurios/Collectedcurios.kt new file mode 100644 index 000000000..fac6bf873 --- /dev/null +++ b/src/en/collectedcurios/src/eu/kanade/tachiyomi/extension/en/collectedcurios/Collectedcurios.kt @@ -0,0 +1,153 @@ +package eu.kanade.tachiyomi.extension.en.collectedcurios + +import android.util.Log +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.Request +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import rx.Observable + +class Collectedcurios : ParsedHttpSource() { + + override val name = "Collected Curios" + + override val baseUrl = "https://www.collectedcurios.com" + + override val lang = "en" + + override val supportsLatest = false + + override fun fetchPopularManga(page: Int): Observable { + return Observable.just( + MangasPage( + arrayListOf( + SManga.create().apply { + title = "Sequential Art" + artist = "Jolly Jack aka Phillip M Jackson" + author = "Jolly Jack aka Phillip M Jackson" + status = SManga.ONGOING + url = "/sequentialart.php" + description = "Sequential Art webcomic." + thumbnail_url = "https://www.collectedcurios.com/images/CC_2011_Sequential_Art_Button.jpg" + }, + + SManga.create().apply { + title = "Battle Bunnies" + artist = "Jolly Jack aka Phillip M Jackson" + author = "Jolly Jack aka Phillip M Jackson" + status = SManga.ONGOING + url = "/battlebunnies.php" + description = "Battle Bunnies webcomic." + thumbnail_url = "https://www.collectedcurios.com/images/CC_2011_Battle_Bunnies_Button.jpg" + }, + + /* + SManga.create().apply { + title = "Spider and Scorpion" + artist = "Jolly Jack aka Phillip M Jackson" + author = "Jolly Jack aka Phillip M Jackson" + status = SManga.ONGOING + url = "/spiderandscorpion.php" + description = "Spider and Scorpion webcomic." + thumbnail_url = "https://www.collectedcurios.com/images/CC_2011_Spider_And_Scorpion_Button.jpg" + }, + */ + ), + false, + ), + ) + } + + override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable { + return fetchPopularManga(1) + } + + override fun fetchMangaDetails(manga: SManga): Observable { + return Observable.just(manga) + } + + override fun chapterListParse(response: Response): List { + val responseJs = response.asJsoup() + + val chapters = + if (responseJs.selectFirst("img[title=Last]") == null) { + responseJs.selectFirst("input[title=Jump to number]") + ?.attr("value")?.toInt() + } else { + responseJs.selectFirst("img[title=Last]")?.parent() + ?.attr("href")?.substringAfter("=")?.toInt() + } + + var chapterList = mutableListOf() + + for (i in chapters?.downTo(1)!!) { + chapterList.add( + SChapter.create().apply { + url = "${response.request.url}?s=$i" + name = "Chapter - $i" + chapter_number = i.toFloat() + date_upload = 0L + }, + ) + } + return chapterList + } + + override fun chapterListSelector() = throw Exception("Not used") + + override fun chapterFromElement(element: Element) = SChapter.create().apply { + name = element.selectFirst(".w3-round")?.attr("value") ?: "Chapter" + } + + override fun pageListParse(document: Document): List = throw Exception("Not used") + + override fun fetchPageList(chapter: SChapter) = Observable.just(listOf(Page(0, chapter.url)))!! + + override fun imageUrlParse(response: Response): String { + val url = response.request.url.toString() + val document = response.asJsoup() + + return when { + url.contains("sequentialart") -> + document.selectFirst(".w3-image")!!.absUrl("src") + url.contains("battlebunnies") || url.contains("spiderandscorpion") -> + document.selectFirst("#strip")!!.absUrl("src") + else -> throw Exception("Could not find the image") + } + } + + override fun imageUrlParse(document: Document) = throw Exception("Not used") + + override fun popularMangaSelector(): String = throw Exception("Not used") + + override fun searchMangaFromElement(element: Element): SManga = throw Exception("Not used") + + override fun searchMangaNextPageSelector(): String? = throw Exception("Not used") + + override fun searchMangaSelector(): String = throw Exception("Not used") + + override fun popularMangaRequest(page: Int): Request = throw Exception("Not used") + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = throw Exception("Not used") + + override fun popularMangaNextPageSelector(): String? = throw Exception("Not used") + + override fun popularMangaFromElement(element: Element): SManga = throw Exception("Not used") + + override fun mangaDetailsParse(document: Document): SManga = throw Exception("Not used") + + override fun latestUpdatesNextPageSelector(): String? = throw Exception("Not used") + + override fun latestUpdatesFromElement(element: Element): SManga = throw Exception("Not used") + + override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used") + + override fun latestUpdatesSelector(): String = throw Exception("Not used") +}