Add ExistentialComics source (#2211)

This commit is contained in:
dawidsowa 2020-02-08 00:49:58 +01:00 committed by GitHub
parent fbcabbc15a
commit 65c185f977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: Existential Comics'
pkgNameSuffix = 'en.existentialcomics'
extClass = '.ExistentialComics'
extVersionCode = 1
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -0,0 +1,88 @@
package eu.kanade.tachiyomi.extension.en.existentialcomics
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
class ExistentialComics : ParsedHttpSource() {
override val name = "Existential Comics"
override val baseUrl = "https://existentialcomics.com"
override val lang = "en"
override val supportsLatest = false
override fun fetchPopularManga(page: Int): Observable<MangasPage> {
val manga = SManga.create().apply {
title = "Existential Comics"
artist = "Corey Mohler"
author = "Corey Mohler"
status = SManga.ONGOING
url = "/archive/byDate"
description = "A philosophy comic about the inevitable anguish of living a brief life in an absurd world. Also Jokes."
thumbnail_url = "https://i.ibb.co/pykMVYM/existential-comics.png"
}
return Observable.just(MangasPage(arrayListOf(manga), false))
}
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> = Observable.empty()
override fun fetchMangaDetails(manga: SManga) = Observable.just(manga)
override fun chapterListParse(response: Response): List<SChapter> {
return super.chapterListParse(response).distinct().reversed()
}
override fun chapterListSelector() = "div#date-comics ul li a:eq(0)"
override fun chapterFromElement(element: Element): SChapter {
val urlregex = "http://existentialcomics.com/comic/(.*)".toRegex()
val chapterUrl = element.attr("href")
val number = urlregex.find(chapterUrl)!!.groupValues[1]
val chapter = SChapter.create()
chapter.url = "/comic/$number"
chapter.name = element.text()
chapter.chapter_number = number.toFloat()
return chapter
}
override fun pageListParse(document: Document) = document.select(".comicImg").mapIndexed { i, element -> Page(i, "", "http:" + element.attr("src").substring(1)) }
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")
}