From c9af13410fd39ef47d222d100df1fa1d886befca Mon Sep 17 00:00:00 2001 From: are-are-are <62763969+dejavui@users.noreply.github.com> Date: Wed, 15 Jan 2025 19:47:34 +0700 Subject: [PATCH] Update some domain (#7137) * VlogTruyen update domain * TruyenVN update domain * Yurineko Update domain and add override URL * NetTruyenCO update domain * Fecomic update domain * DuaLeoTruyen Update domain * CoManhua Update domain * HentaiVNPlus update domain * Update src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> --------- Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> --- src/vi/comanhua/build.gradle | 4 +- .../extension/vi/comanhua/CoManhua.kt | 2 +- src/vi/dualeotruyen/build.gradle | 2 +- .../extension/vi/dualeotruyen/DuaLeoTruyen.kt | 2 +- src/vi/fecomic/build.gradle | 4 +- .../tachiyomi/extension/vi/fecomic/Fecomic.kt | 2 +- src/vi/hentaivnplus/build.gradle | 4 +- .../extension/vi/hentaivnplus/HentaiVNPlus.kt | 2 +- src/vi/nettruyenco/build.gradle | 4 +- .../extension/vi/nettruyenco/NetTruyenCO.kt | 2 +- src/vi/truyenvn/build.gradle | 4 +- .../extension/vi/truyenvn/TruyenVN.kt | 2 +- src/vi/vlogtruyen/build.gradle | 2 +- .../extension/vi/vlogtruyen/VlogTruyen.kt | 2 +- src/vi/yurineko/AndroidManifest.xml | 2 +- src/vi/yurineko/build.gradle | 2 +- .../extension/vi/yurineko/YuriNeko.kt | 52 +++++++++++++++++-- 17 files changed, 70 insertions(+), 24 deletions(-) diff --git a/src/vi/comanhua/build.gradle b/src/vi/comanhua/build.gradle index 625b2b6be..5ed47cef9 100644 --- a/src/vi/comanhua/build.gradle +++ b/src/vi/comanhua/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'CoManhua' extClass = '.CoManhua' themePkg = 'wpcomics' - baseUrl = 'https://comanhuaw.com' - overrideVersionCode = 1 + baseUrl = 'https://comanhuaa.com' + overrideVersionCode = 2 isNsfw = false } diff --git a/src/vi/comanhua/src/eu/kanade/tachiyomi/extension/vi/comanhua/CoManhua.kt b/src/vi/comanhua/src/eu/kanade/tachiyomi/extension/vi/comanhua/CoManhua.kt index 7a4a02404..4729ba3a5 100644 --- a/src/vi/comanhua/src/eu/kanade/tachiyomi/extension/vi/comanhua/CoManhua.kt +++ b/src/vi/comanhua/src/eu/kanade/tachiyomi/extension/vi/comanhua/CoManhua.kt @@ -19,7 +19,7 @@ import java.util.TimeZone class CoManhua : WPComics( "CoManhua", - "https://comanhuaw.com", + "https://comanhuaa.com", "vi", gmtOffset = null, ) { diff --git a/src/vi/dualeotruyen/build.gradle b/src/vi/dualeotruyen/build.gradle index 602eaba2c..b1ed344fa 100644 --- a/src/vi/dualeotruyen/build.gradle +++ b/src/vi/dualeotruyen/build.gradle @@ -1,7 +1,7 @@ ext { extName = "Dua Leo Truyen" extClass = ".DuaLeoTruyen" - extVersionCode = 6 + extVersionCode = 7 isNsfw = true } diff --git a/src/vi/dualeotruyen/src/eu/kanade/tachiyomi/extension/vi/dualeotruyen/DuaLeoTruyen.kt b/src/vi/dualeotruyen/src/eu/kanade/tachiyomi/extension/vi/dualeotruyen/DuaLeoTruyen.kt index c7b0592dc..532b27c24 100644 --- a/src/vi/dualeotruyen/src/eu/kanade/tachiyomi/extension/vi/dualeotruyen/DuaLeoTruyen.kt +++ b/src/vi/dualeotruyen/src/eu/kanade/tachiyomi/extension/vi/dualeotruyen/DuaLeoTruyen.kt @@ -22,7 +22,7 @@ class DuaLeoTruyen : ParsedHttpSource() { override val name = "Dưa Leo Truyện" - override val baseUrl = "https://dualeotruyenman.com" + override val baseUrl = "https://dualeotruyenbeta.com" override val lang = "vi" diff --git a/src/vi/fecomic/build.gradle b/src/vi/fecomic/build.gradle index 46f81c125..5c63997e1 100644 --- a/src/vi/fecomic/build.gradle +++ b/src/vi/fecomic/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'Fecomic' extClass = '.Fecomic' themePkg = 'madara' - baseUrl = 'https://fecomicc.xyz' - overrideVersionCode = 0 + baseUrl = 'https://mangasup.net' + overrideVersionCode = 1 isNsfw = true } diff --git a/src/vi/fecomic/src/eu/kanade/tachiyomi/extension/vi/fecomic/Fecomic.kt b/src/vi/fecomic/src/eu/kanade/tachiyomi/extension/vi/fecomic/Fecomic.kt index fefa90e9a..cc63a7203 100644 --- a/src/vi/fecomic/src/eu/kanade/tachiyomi/extension/vi/fecomic/Fecomic.kt +++ b/src/vi/fecomic/src/eu/kanade/tachiyomi/extension/vi/fecomic/Fecomic.kt @@ -10,7 +10,7 @@ import java.util.Locale class Fecomic : Madara( "Fecomic", - "https://fecomicc.xyz", + "https://mangasup.net", "vi", dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ROOT), ) { diff --git a/src/vi/hentaivnplus/build.gradle b/src/vi/hentaivnplus/build.gradle index 2e8c777f6..c9bf81dd7 100644 --- a/src/vi/hentaivnplus/build.gradle +++ b/src/vi/hentaivnplus/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'HentaiVN.plus' extClass = '.HentaiVNPlus' themePkg = 'madara' - baseUrl = 'https://hentaivn.now' - overrideVersionCode = 5 + baseUrl = 'https://hentaivn.li' + overrideVersionCode = 6 isNsfw = true } diff --git a/src/vi/hentaivnplus/src/eu/kanade/tachiyomi/extension/vi/hentaivnplus/HentaiVNPlus.kt b/src/vi/hentaivnplus/src/eu/kanade/tachiyomi/extension/vi/hentaivnplus/HentaiVNPlus.kt index b864cead0..37003d1ba 100644 --- a/src/vi/hentaivnplus/src/eu/kanade/tachiyomi/extension/vi/hentaivnplus/HentaiVNPlus.kt +++ b/src/vi/hentaivnplus/src/eu/kanade/tachiyomi/extension/vi/hentaivnplus/HentaiVNPlus.kt @@ -14,7 +14,7 @@ import java.util.Locale class HentaiVNPlus : Madara( "HentaiVN.plus", - "https://hentaivn.now", + "https://hentaivn.li", "vi", dateFormat = SimpleDateFormat("MM/dd/yyyy", Locale.ROOT), ), diff --git a/src/vi/nettruyenco/build.gradle b/src/vi/nettruyenco/build.gradle index b75abd4f4..60f6fafb5 100644 --- a/src/vi/nettruyenco/build.gradle +++ b/src/vi/nettruyenco/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'NetTruyenCO (unoriginal)' extClass = '.NetTruyenCO' themePkg = 'wpcomics' - baseUrl = 'https://nettruyenww.com' - overrideVersionCode = 3 + baseUrl = 'https://nettruyenrr.com' + overrideVersionCode = 4 isNsfw = false } diff --git a/src/vi/nettruyenco/src/eu/kanade/tachiyomi/extension/vi/nettruyenco/NetTruyenCO.kt b/src/vi/nettruyenco/src/eu/kanade/tachiyomi/extension/vi/nettruyenco/NetTruyenCO.kt index a92cdc4a3..27c71037e 100644 --- a/src/vi/nettruyenco/src/eu/kanade/tachiyomi/extension/vi/nettruyenco/NetTruyenCO.kt +++ b/src/vi/nettruyenco/src/eu/kanade/tachiyomi/extension/vi/nettruyenco/NetTruyenCO.kt @@ -8,7 +8,7 @@ import java.util.Locale class NetTruyenCO : WPComics( "NetTruyenCO (unoriginal)", - "https://nettruyenww.com", + "https://nettruyenrr.com", "vi", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.getDefault()), gmtOffset = null, diff --git a/src/vi/truyenvn/build.gradle b/src/vi/truyenvn/build.gradle index 6a99fa3ac..96fd793aa 100644 --- a/src/vi/truyenvn/build.gradle +++ b/src/vi/truyenvn/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'TruyenVN' extClass = '.TruyenVN' themePkg = 'madara' - baseUrl = 'https://truyenvn.live' - overrideVersionCode = 9 + baseUrl = 'https://truyenvn.la' + overrideVersionCode = 10 isNsfw = true } diff --git a/src/vi/truyenvn/src/eu/kanade/tachiyomi/extension/vi/truyenvn/TruyenVN.kt b/src/vi/truyenvn/src/eu/kanade/tachiyomi/extension/vi/truyenvn/TruyenVN.kt index 629801a5c..01a9fb010 100644 --- a/src/vi/truyenvn/src/eu/kanade/tachiyomi/extension/vi/truyenvn/TruyenVN.kt +++ b/src/vi/truyenvn/src/eu/kanade/tachiyomi/extension/vi/truyenvn/TruyenVN.kt @@ -14,7 +14,7 @@ import java.util.Locale class TruyenVN : Madara( "TruyenVN", - "https://truyenvn.live", + "https://truyenvn.la", "vi", dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ROOT), ), diff --git a/src/vi/vlogtruyen/build.gradle b/src/vi/vlogtruyen/build.gradle index a5052a731..1022ab4c4 100644 --- a/src/vi/vlogtruyen/build.gradle +++ b/src/vi/vlogtruyen/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'VlogTruyen' extClass = '.VlogTruyen' - extVersionCode = 3 + extVersionCode = 4 isNsfw = true } diff --git a/src/vi/vlogtruyen/src/eu/kanade/tachiyomi/extension/vi/vlogtruyen/VlogTruyen.kt b/src/vi/vlogtruyen/src/eu/kanade/tachiyomi/extension/vi/vlogtruyen/VlogTruyen.kt index d1fcc192f..57ca955a0 100644 --- a/src/vi/vlogtruyen/src/eu/kanade/tachiyomi/extension/vi/vlogtruyen/VlogTruyen.kt +++ b/src/vi/vlogtruyen/src/eu/kanade/tachiyomi/extension/vi/vlogtruyen/VlogTruyen.kt @@ -41,7 +41,7 @@ class VlogTruyen : ParsedHttpSource(), ConfigurableSource { override val supportsLatest = true - private val defaultBaseUrl = "https://vlogtruyen35.com" + private val defaultBaseUrl = "https://vlogtruyen36.com" override val baseUrl by lazy { getPrefBaseUrl() } diff --git a/src/vi/yurineko/AndroidManifest.xml b/src/vi/yurineko/AndroidManifest.xml index 74f94ca7c..b2fb696d5 100644 --- a/src/vi/yurineko/AndroidManifest.xml +++ b/src/vi/yurineko/AndroidManifest.xml @@ -12,7 +12,7 @@ - diff --git a/src/vi/yurineko/build.gradle b/src/vi/yurineko/build.gradle index 744a1d3ef..034321ea5 100644 --- a/src/vi/yurineko/build.gradle +++ b/src/vi/yurineko/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'YuriNeko' extClass = '.YuriNeko' - extVersionCode = 5 + extVersionCode = 6 isNsfw = true } diff --git a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt index 167748cbd..2b7bf387c 100644 --- a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt +++ b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt @@ -1,5 +1,10 @@ package eu.kanade.tachiyomi.extension.vi.yurineko +import android.app.Application +import android.content.SharedPreferences +import android.widget.Toast +import androidx.preference.EditTextPreference +import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.extension.vi.yurineko.dto.ErrorResponseDto import eu.kanade.tachiyomi.extension.vi.yurineko.dto.MangaDto import eu.kanade.tachiyomi.extension.vi.yurineko.dto.MangaListDto @@ -8,6 +13,7 @@ import eu.kanade.tachiyomi.extension.vi.yurineko.dto.UserDto import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage @@ -24,21 +30,25 @@ import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response import rx.Observable +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get import java.io.IOException import java.net.URLDecoder import java.util.concurrent.TimeUnit -class YuriNeko : HttpSource() { +class YuriNeko : HttpSource(), ConfigurableSource { override val name = "YuriNeko" - override val baseUrl = "https://yurineko.my" + private val defaultDomain = "yurineko.click" + + override val baseUrl by lazy { "https://${getPrefDomain()}" } override val lang = "vi" override val supportsLatest = false - private val apiUrl = "https://api.yurineko.my" + private val apiUrl by lazy { "https://api.${getPrefDomain()}" } override val client = network.cloudflareClient.newBuilder() .rateLimit(3, 1, TimeUnit.SECONDS) @@ -396,6 +406,36 @@ class YuriNeko : HttpSource() { private inline fun Response.parseAs(): T = use { json.decodeFromString(body.string()) } + private val preferences: SharedPreferences = + Injekt.get().getSharedPreferences("source_$id", 0x0000) + + init { + preferences.getString(DEFAULT_DOMAIN_PREF, null).let { prefDefaultDomain -> + if (prefDefaultDomain != defaultDomain) { + preferences.edit() + .putString(BASE_DOMAIN_PREF, defaultDomain) + .putString(DEFAULT_DOMAIN_PREF, defaultDomain) + .apply() + } + } + } + override fun setupPreferenceScreen(screen: PreferenceScreen) { + EditTextPreference(screen.context).apply { + key = BASE_DOMAIN_PREF + title = BASE_DOMAIN_PREF_TITLE + summary = BASE_DOMAIN_PREF_SUMMARY + setDefaultValue(defaultDomain) + dialogTitle = BASE_DOMAIN_PREF_TITLE + dialogMessage = "Default: $defaultDomain" + + setOnPreferenceChangeListener { _, _ -> + Toast.makeText(screen.context, RESTART_APP, Toast.LENGTH_LONG).show() + true + } + }.let(screen::addPreference) + } + + private fun getPrefDomain(): String = preferences.getString(BASE_DOMAIN_PREF, defaultDomain)!! companion object { const val PREFIX_ID_SEARCH = "id:" @@ -404,5 +444,11 @@ class YuriNeko : HttpSource() { const val PREFIX_AUTHOR_SEARCH = "author:" const val PREFIX_DOUJIN_SEARCH = "origin:" const val PREFIX_COUPLE_SEARCH = "couple:" + private const val DEFAULT_DOMAIN_PREF = "defaultDomain" + private const val RESTART_APP = "Khởi chạy lại ứng dụng để áp dụng thay đổi." + private const val BASE_DOMAIN_PREF_TITLE = "Ghi đè URL cơ sở" + private const val BASE_DOMAIN_PREF = "overrideDomain" + private const val BASE_DOMAIN_PREF_SUMMARY = + "Dành cho sử dụng tạm thời, cập nhật tiện ích sẽ xóa cài đặt." } }