Add Kings Of Darkness (#8884)

This commit is contained in:
ObserverOfTime 2021-08-30 15:04:02 +03:00 committed by GitHub
parent e7369b1b38
commit 7d67b98943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.kanade.tachiyomi.extension" />

View File

@ -0,0 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'Kings Of Darkness'
pkgNameSuffix = 'es.kingsofdarkness'
extClass = '.KingsOfDarkness'
extVersionCode = 1
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

View File

@ -0,0 +1,99 @@
package eu.kanade.tachiyomi.extension.es.kingsofdarkness
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 org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class KingsOfDarkness : ParsedHttpSource() {
override val name = "Kings Of Darkness"
override val baseUrl = "https://kings-of-darkness.wixsite.com/0000"
override val lang = "es"
override val supportsLatest = false
override fun popularMangaSelector() = "#SITE_PAGES div[title]"
override fun popularMangaRequest(page: Int) =
GET("$baseUrl/proyectos", headers)
override fun popularMangaFromElement(element: Element) =
SManga.create().apply {
url = element.child(0).attr("href")
title = element.nextElementSibling().text()
thumbnail_url = element.selectFirst("img").image
}
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
fetchPopularManga(page).map { mp ->
mp.copy(mp.mangas.filter { it.title.contains(query, true) })
}!!
override fun mangaDetailsRequest(manga: SManga) =
GET(manga.url, headers)
override fun mangaDetailsParse(document: Document) =
SManga.create().apply {
url = document.location()
title = document.selectFirst("#SITE_PAGES h2").text()
thumbnail_url = document.selectFirst("#SITE_PAGES img").image
document.select("#SITE_PAGES p:last-of-type").let { el ->
description = el[0].text().trim()
genre = el[1].select("a").joinToString { it.text() }
}
}
override fun chapterListSelector() = "#SITE_PAGES a[target=_self]"
override fun chapterListRequest(manga: SManga) =
GET(manga.url, headers)
override fun chapterFromElement(element: Element) =
SChapter.create().apply {
url = element.attr("href")
name = element.child(0).text()
chapter_number = name.substring(3).toFloat()
}
override fun pageListRequest(chapter: SChapter) =
GET(chapter.url, headers)
override fun pageListParse(document: Document) =
document.select("#SITE_PAGES img").mapIndexed { idx, el ->
Page(idx, "", el.image)
}
private inline val Element.image: String
get() = attr("src").substringBefore("/v1/fill")
override fun latestUpdatesSelector() = ""
override fun latestUpdatesNextPageSelector(): String? = null
override fun latestUpdatesRequest(page: Int) =
throw UnsupportedOperationException("Not used!")
override fun latestUpdatesFromElement(element: Element) =
throw UnsupportedOperationException("Not used!")
override fun popularMangaNextPageSelector(): String? = null
override fun searchMangaSelector() = ""
override fun searchMangaNextPageSelector(): String? = null
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) =
throw UnsupportedOperationException("Not used!")
override fun searchMangaFromElement(element: Element) =
throw UnsupportedOperationException("Not used!")
override fun imageUrlParse(document: Document) =
throw UnsupportedOperationException("Not used!")
}