Update some extensions (#15350)

This commit is contained in:
seew3l 2023-02-14 08:20:18 -05:00 committed by GitHub
parent d43b2d2239
commit 692e46e309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 17 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'LectorManga' extName = 'LectorManga'
pkgNameSuffix = 'es.lectormanga' pkgNameSuffix = 'es.lectormanga'
extClass = '.LectorManga' extClass = '.LectorManga'
extVersionCode = 26 extVersionCode = 27
isNsfw = true isNsfw = true
} }

View File

@ -210,15 +210,14 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
// Regular list of chapters // Regular list of chapters
val chapterNames = document.select("#chapters h4.text-truncate") val chapterNames = document.select("#chapters h4.text-truncate")
val chapterNumbers = chapterNames.map { it.text().substringAfter("Capítulo").substringBefore("|").trim().toFloat() }
val chapterInfos = document.select("#chapters .chapter-list") val chapterInfos = document.select("#chapters .chapter-list")
chapterNames.forEachIndexed { index, _ -> chapterNames.forEachIndexed { index, _ ->
val scanlator = chapterInfos[index].select("li") val scanlator = chapterInfos[index].select("li")
if (getScanlatorPref()) { if (getScanlatorPref()) {
scanlator.forEach { add(regularChapterFromElement(chapterNames[index].text(), it, chapterNumbers[index])) } scanlator.forEach { add(regularChapterFromElement(chapterNames[index].text(), it)) }
} else { } else {
scanlator.last { add(regularChapterFromElement(chapterNames[index].text(), it, chapterNumbers[index])) } scanlator.last { add(regularChapterFromElement(chapterNames[index].text(), it)) }
} }
} }
} }
@ -237,14 +236,13 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
?: 0 ?: 0
} }
private fun regularChapterFromElement(chapterName: String, info: Element, number: Float) = SChapter.create().apply { private fun regularChapterFromElement(chapterName: String, info: Element) = SChapter.create().apply {
url = info.select("div.row > .text-right > a").attr("href") url = info.select("div.row > .text-right > a").attr("href")
name = chapterName name = chapterName
scanlator = info.select("div.col-12.col-sm-12.col-md-4.text-truncate span").text() scanlator = info.select("div.col-12.col-sm-12.col-md-4.text-truncate span").text()
date_upload = info.select("span.badge.badge-primary.p-2").first()?.text()?.let { date_upload = info.select("span.badge.badge-primary.p-2").first()?.text()?.let {
parseChapterDate(it) parseChapterDate(it)
} ?: 0 } ?: 0
chapter_number = number
} }
private fun parseChapterDate(date: String): Long { private fun parseChapterDate(date: String): Long {

View File

@ -5,7 +5,7 @@ ext {
extName = 'Manhwas.net' extName = 'Manhwas.net'
pkgNameSuffix = 'es.manhwasnet' pkgNameSuffix = 'es.manhwasnet'
extClass = '.ManhwasNet' extClass = '.ManhwasNet'
extVersionCode = 4 extVersionCode = 5
isNsfw = true isNsfw = true
} }

View File

@ -65,10 +65,7 @@ class ManhwasNet : HttpSource() {
override fun pageListParse(response: Response): List<Page> { override fun pageListParse(response: Response): List<Page> {
val document = response.asJsoup() val document = response.asJsoup()
return document.select("#chapter_imgs img").mapIndexed { i, img -> return document.select("#chapter_imgs img").mapIndexed { i, img ->
var url = img.attr("src") val url = img.attr("abs:src")
if (url.toString() == "/discord.jpg") {
url = "$baseUrl/discord.jpg"
}
Page(i, imageUrl = url) Page(i, imageUrl = url)
} }
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'TMOHentai' extName = 'TMOHentai'
pkgNameSuffix = 'es.tmohentai' pkgNameSuffix = 'es.tmohentai'
extClass = '.TMOHentai' extClass = '.TMOHentai'
extVersionCode = 6 extVersionCode = 7
isNsfw = true isNsfw = true
} }

View File

@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.UpdateStrategy
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request import okhttp3.Request
@ -43,6 +44,7 @@ class TMOHentai : ConfigurableSource, ParsedHttpSource() {
title = it.attr("data-title") title = it.attr("data-title")
thumbnail_url = it.attr("data-content").substringAfter("src=\"").substringBeforeLast("\"") thumbnail_url = it.attr("data-content").substringAfter("src=\"").substringBeforeLast("\"")
setUrlWithoutDomain(it.select("td.text-left > a").attr("href")) setUrlWithoutDomain(it.select("td.text-left > a").attr("href"))
update_strategy = UpdateStrategy.ONLY_FETCH_ONCE
} }
} }
@ -106,7 +108,7 @@ class TMOHentai : ConfigurableSource, ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply { override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
if (getPageMethodPref() == "cascade") { if (getPageMethodPref() == "cascade") {
document.select("div#content-images img.content-image").forEach { document.select("div#content-images img.content-image").forEach {
add(Page(size, "", it.attr("data-original"))) add(Page(size, "", it.attr("abs:data-original")))
} }
} else { } else {
val pageList = document.select("select#select-page").first()!!.select("option").map { it.attr("value").toInt() } val pageList = document.select("select#select-page").first()!!.select("option").map { it.attr("value").toInt() }
@ -118,9 +120,7 @@ class TMOHentai : ConfigurableSource, ParsedHttpSource() {
} }
} }
override fun imageUrlParse(document: Document): String = document.select("div#content-images img.content-image").attr("data-original") override fun imageUrlParse(document: Document): String = document.select("div#content-images img.content-image").attr("abs:data-original")
override fun imageRequest(page: Page) = GET("$baseUrl${page.imageUrl!!}", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = "$baseUrl/section/all?view=list".toHttpUrlOrNull()!!.newBuilder() val url = "$baseUrl/section/all?view=list".toHttpUrlOrNull()!!.newBuilder()
@ -232,7 +232,7 @@ class TMOHentai : ConfigurableSource, ParsedHttpSource() {
) )
/** /**
* Last check: 17/02/2021 * Last check: 13/02/2023
* https://tmohentai.com/section/hentai * https://tmohentai.com/section/hentai
* *
* Array.from(document.querySelectorAll('#advancedSearch .list-group .list-group-item')) * Array.from(document.querySelectorAll('#advancedSearch .list-group .list-group-item'))