Update some domain (#7359)
* YuriNeko Update domain and rewrite to overwrite correct domain * TruyenVN update domain * HentaiVNPlus update domain * YuriNeko Use wholeText() * TeamLanhLung update domain * LxHentai update domain * Yurineko Revert code and apply suggestion * LxHentai use wholeText()
This commit is contained in:
parent
3a8b7c697e
commit
b9c2949bf6
|
@ -2,8 +2,8 @@ ext {
|
|||
extName = 'HentaiVN.plus'
|
||||
extClass = '.HentaiVNPlus'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://hentaivn.li'
|
||||
overrideVersionCode = 6
|
||||
baseUrl = 'https://hentaivn.tech'
|
||||
overrideVersionCode = 7
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Locale
|
|||
class HentaiVNPlus :
|
||||
Madara(
|
||||
"HentaiVN.plus",
|
||||
"https://hentaivn.li",
|
||||
"https://hentaivn.tech",
|
||||
"vi",
|
||||
dateFormat = SimpleDateFormat("MM/dd/yyyy", Locale.ROOT),
|
||||
),
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="lxmanga.info"
|
||||
android:host="lxmanga.cloud"
|
||||
android:pathPattern="/truyen/..*"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'LXHentai'
|
||||
extClass = '.LxHentai'
|
||||
extVersionCode = 14
|
||||
extVersionCode = 15
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import okhttp3.OkHttpClient
|
|||
import okhttp3.Request
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.jsoup.select.Evaluator
|
||||
import rx.Observable
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -30,7 +29,7 @@ class LxHentai : ParsedHttpSource(), ConfigurableSource {
|
|||
|
||||
override val name = "LXHentai"
|
||||
|
||||
private val defaultBaseUrl = "https://lxmanga.info"
|
||||
private val defaultBaseUrl = "https://lxmanga.cloud"
|
||||
|
||||
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||
|
||||
|
@ -129,13 +128,7 @@ class LxHentai : ParsedHttpSource(), ConfigurableSource {
|
|||
genre = document.selectFirst("div.grow div.mt-2 > span:contains(Thể loại:) + span")!!
|
||||
.select("a")
|
||||
.joinToString { it.text().trim(',', ' ') }
|
||||
description = document.select("p:contains(Tóm tắt) ~ p").joinToString("\n") {
|
||||
it.run {
|
||||
select(Evaluator.Tag("br")).prepend("\\n")
|
||||
this.text().replace("\\n", "\n").replace("\n ", "\n")
|
||||
}
|
||||
}.trim()
|
||||
|
||||
description = document.select("p:contains(Tóm tắt) ~ p").joinToString("\n") { it.wholeText() }.trim()
|
||||
thumbnail_url = document.selectFirst(".cover")?.attr("style")?.let {
|
||||
IMAGE_REGEX.find(it)?.groups?.get(1)?.value
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ ext {
|
|||
extName = 'Team Lanh Lung'
|
||||
extClass = '.TeamLanhLung'
|
||||
themePkg = 'a3manga'
|
||||
baseUrl = 'https://teamlanhlungday.shop'
|
||||
overrideVersionCode = 15
|
||||
baseUrl = 'https://teamlanhlung1.shop'
|
||||
overrideVersionCode = 16
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ package eu.kanade.tachiyomi.extension.vi.teamlanhlung
|
|||
|
||||
import eu.kanade.tachiyomi.multisrc.a3manga.A3Manga
|
||||
|
||||
class TeamLanhLung : A3Manga("Team Lạnh Lùng", "https://teamlanhlungday.shop", "vi")
|
||||
class TeamLanhLung : A3Manga("Team Lạnh Lùng", "https://teamlanhlung1.shop", "vi")
|
||||
|
|
|
@ -2,8 +2,8 @@ ext {
|
|||
extName = 'TruyenVN'
|
||||
extClass = '.TruyenVN'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://truyenvn.la'
|
||||
overrideVersionCode = 10
|
||||
baseUrl = 'https://truyenvn.li'
|
||||
overrideVersionCode = 11
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Locale
|
|||
class TruyenVN :
|
||||
Madara(
|
||||
"TruyenVN",
|
||||
"https://truyenvn.la",
|
||||
"https://truyenvn.li",
|
||||
"vi",
|
||||
dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ROOT),
|
||||
),
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:host="yurineko.click"
|
||||
<data android:host="yurineko.site"
|
||||
android:scheme="https" />
|
||||
|
||||
<data android:pathPattern="/manga/..*" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'YuriNeko'
|
||||
extClass = '.YuriNeko'
|
||||
extVersionCode = 6
|
||||
extVersionCode = 7
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class YuriNeko : HttpSource(), ConfigurableSource {
|
|||
|
||||
override val name = "YuriNeko"
|
||||
|
||||
private val defaultDomain = "yurineko.click"
|
||||
private val defaultDomain = "yurineko.site"
|
||||
|
||||
override val baseUrl by lazy { "https://${getPrefDomain()}" }
|
||||
|
||||
|
@ -50,6 +50,8 @@ class YuriNeko : HttpSource(), ConfigurableSource {
|
|||
|
||||
private val apiUrl by lazy { "https://api.${getPrefDomain()}" }
|
||||
|
||||
private val storageUrl by lazy { "https://storage.${getPrefDomain()}" }
|
||||
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimit(3, 1, TimeUnit.SECONDS)
|
||||
.addInterceptor(::authIntercept)
|
||||
|
@ -98,7 +100,7 @@ class YuriNeko : HttpSource(), ConfigurableSource {
|
|||
override fun popularMangaParse(response: Response): MangasPage {
|
||||
val mangaListDto = response.parseAs<MangaListDto>()
|
||||
val currentPage = response.request.url.queryParameter("page")!!.toFloat()
|
||||
return mangaListDto.toMangasPage(currentPage)
|
||||
return mangaListDto.toMangasPage(currentPage, storageUrl)
|
||||
}
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request = throw UnsupportedOperationException()
|
||||
|
@ -188,7 +190,7 @@ class YuriNeko : HttpSource(), ConfigurableSource {
|
|||
override fun mangaDetailsRequest(manga: SManga): Request = GET("$baseUrl${manga.url}")
|
||||
|
||||
override fun mangaDetailsParse(response: Response): SManga =
|
||||
response.parseAs<MangaDto>().toSManga()
|
||||
response.parseAs<MangaDto>().toSManga(storageUrl)
|
||||
|
||||
override fun chapterListRequest(manga: SManga): Request = GET("$apiUrl${manga.url}")
|
||||
|
||||
|
@ -201,7 +203,7 @@ class YuriNeko : HttpSource(), ConfigurableSource {
|
|||
override fun pageListRequest(chapter: SChapter): Request = GET("$apiUrl${chapter.url}")
|
||||
|
||||
override fun pageListParse(response: Response): List<Page> =
|
||||
response.parseAs<ReadResponseDto>().toPageList()
|
||||
response.parseAs<ReadResponseDto>().toPageList(storageUrl)
|
||||
|
||||
override fun imageUrlParse(response: Response): String = throw UnsupportedOperationException()
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ data class ReadResponseDto(
|
|||
val chapterInfo: ChapterDto,
|
||||
val url: List<String>,
|
||||
) {
|
||||
fun toPageList(): List<Page> = this@ReadResponseDto
|
||||
fun toPageList(storageUrl: String): List<Page> = this@ReadResponseDto
|
||||
.url
|
||||
.mapIndexed { index, url -> Page(index, imageUrl = "https://storage.yurineko.my" + url) }
|
||||
.mapIndexed { index, url -> Page(index, imageUrl = storageUrl + url) }
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import eu.kanade.tachiyomi.source.model.MangasPage
|
|||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import kotlinx.serialization.Serializable
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.select.Evaluator
|
||||
import kotlin.math.ceil
|
||||
|
||||
@Serializable
|
||||
|
@ -28,26 +27,17 @@ data class MangaDto(
|
|||
val lastChapter: ChapterDto? = null,
|
||||
val chapters: List<ChapterDto>? = null,
|
||||
) {
|
||||
fun toSManga(): SManga = SManga.create().apply {
|
||||
fun toSManga(storageUrl: String): SManga = SManga.create().apply {
|
||||
val dto = this@MangaDto
|
||||
url = "/manga/${dto.id}"
|
||||
title = dto.originalName
|
||||
author = dto.author.joinToString(", ") { author -> author.name }
|
||||
|
||||
val descElem = Jsoup.parseBodyFragment(dto.description)
|
||||
description = if (descElem.select("p").any()) {
|
||||
Jsoup.parse(dto.description).select("p").joinToString("\n") {
|
||||
it.run {
|
||||
select(Evaluator.Tag("br")).prepend("\\n")
|
||||
this.text().replace("\\n", "\n").replace("\n ", "\n")
|
||||
}
|
||||
}.trim()
|
||||
val descElem = Jsoup.parseBodyFragment(dto.description).select("p")
|
||||
.joinToString("\n") { it.wholeText() }.trim()
|
||||
description = if (dto.otherName.isNotEmpty()) {
|
||||
"Tên khác: ${dto.otherName}\n\n" + descElem
|
||||
} else {
|
||||
dto.description
|
||||
}
|
||||
|
||||
if (dto.otherName.isNotEmpty()) {
|
||||
description = "Tên khác: ${dto.otherName}\n\n" + description
|
||||
descElem
|
||||
}
|
||||
|
||||
genre = dto.tag.joinToString(", ") { tag -> tag.name }
|
||||
|
@ -61,7 +51,7 @@ data class MangaDto(
|
|||
7 -> SManga.CANCELLED // "Ngừng xuất bản" -> No more publications
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
thumbnail_url = "https://storage.yurineko.my/" + dto.thumbnail
|
||||
thumbnail_url = "$storageUrl/" + dto.thumbnail
|
||||
initialized = true
|
||||
}
|
||||
}
|
||||
|
@ -71,10 +61,10 @@ data class MangaListDto(
|
|||
val result: List<MangaDto>,
|
||||
val resultCount: Int,
|
||||
) {
|
||||
fun toMangasPage(currentPage: Float = 1f): MangasPage {
|
||||
fun toMangasPage(currentPage: Float = 1f, storageUrl: String): MangasPage {
|
||||
val dto = this@MangaListDto
|
||||
return MangasPage(
|
||||
dto.result.map { it.toSManga() },
|
||||
dto.result.map { it.toSManga(storageUrl) },
|
||||
currentPage + 1f <= ceil(dto.resultCount.toFloat() / 20f),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue