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