[RU]Grouple domain switcher (#17937)

* [RU]GroupLe domain switcher all sources

* https://readmanga.live

* imports

* rollback broken functional domain

* rollback GroupLeGenerator

* isNsfw

* autoclean
This commit is contained in:
Eshlender 2023-09-15 23:56:31 +05:00 committed by GitHub
parent ee2f86cb6e
commit 01b37a751b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 158 additions and 6 deletions

View File

@ -13,7 +13,7 @@ import okhttp3.Request
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class AllHentai : GroupLe("AllHentai", "https://2023.allhen.online", "ru") {
class AllHentai : GroupLe("AllHentai", "https://z.allhen.online", "ru") {
override val id: Long = 1809051393403180443
@ -292,6 +292,6 @@ class AllHentai : GroupLe("AllHentai", "https://2023.allhen.online", "ru") {
companion object {
private const val DOMAIN_TITLE = "Домен"
private const val DOMAIN_DEFAULT = "https://2023.allhen.online"
private const val DOMAIN_DEFAULT = "https://z.allhen.online"
}
}

View File

@ -1,16 +1,28 @@
package eu.kanade.tachiyomi.extension.ru.mintmanga
import android.app.Application
import android.content.SharedPreferences
import android.widget.Toast
import androidx.preference.EditTextPreference
import eu.kanade.tachiyomi.multisrc.grouple.GroupLe
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class MintManga : GroupLe("MintManga", "https://mintmanga.live", "ru") {
class MintManga : GroupLe("MintManga", "https://mintmanga.com", "ru") {
override val id: Long = 6
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}
private var domain: String = preferences.getString(DOMAIN_TITLE, DOMAIN_DEFAULT)!!
override val baseUrl: String = domain
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
@ -160,4 +172,30 @@ class MintManga : GroupLe("MintManga", "https://mintmanga.live", "ru") {
Genre("юри", "el_1315"),
Genre("яой", "el_1336"),
)
override fun setupPreferenceScreen(screen: androidx.preference.PreferenceScreen) {
super.setupPreferenceScreen(screen)
EditTextPreference(screen.context).apply {
key = DOMAIN_TITLE
this.title = DOMAIN_TITLE
summary = domain
this.setDefaultValue(DOMAIN_DEFAULT)
dialogTitle = DOMAIN_TITLE
setOnPreferenceChangeListener { _, newValue ->
try {
val res = preferences.edit().putString(DOMAIN_TITLE, newValue as String).commit()
Toast.makeText(screen.context, "Для смены домена необходимо перезапустить приложение с полной остановкой.", Toast.LENGTH_LONG).show()
res
} catch (e: Exception) {
e.printStackTrace()
false
}
}
}.let(screen::addPreference)
}
companion object {
private const val DOMAIN_TITLE = "Домен"
private const val DOMAIN_DEFAULT = "https://mintmanga.com"
}
}

View File

@ -1,16 +1,28 @@
package eu.kanade.tachiyomi.extension.ru.readmanga
import android.app.Application
import android.content.SharedPreferences
import android.widget.Toast
import androidx.preference.EditTextPreference
import eu.kanade.tachiyomi.multisrc.grouple.GroupLe
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class ReadManga : GroupLe("ReadManga", "https://readmanga.live", "ru") {
override val id: Long = 5
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}
private var domain: String = preferences.getString(DOMAIN_TITLE, DOMAIN_DEFAULT)!!
override val baseUrl: String = domain
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
@ -157,4 +169,29 @@ class ReadManga : GroupLe("ReadManga", "https://readmanga.live", "ru") {
Genre("школа", "el_2127"),
Genre("этти", "el_2149"),
)
override fun setupPreferenceScreen(screen: androidx.preference.PreferenceScreen) {
super.setupPreferenceScreen(screen)
EditTextPreference(screen.context).apply {
key = DOMAIN_TITLE
this.title = DOMAIN_TITLE
summary = domain
this.setDefaultValue(DOMAIN_DEFAULT)
dialogTitle = DOMAIN_TITLE
setOnPreferenceChangeListener { _, newValue ->
try {
val res = preferences.edit().putString(DOMAIN_TITLE, newValue as String).commit()
Toast.makeText(screen.context, "Для смены домена необходимо перезапустить приложение с полной остановкой.", Toast.LENGTH_LONG).show()
res
} catch (e: Exception) {
e.printStackTrace()
false
}
}
}.let(screen::addPreference)
}
companion object {
private const val DOMAIN_TITLE = "Домен"
private const val DOMAIN_DEFAULT = "https://readmanga.live"
}
}

View File

@ -1,14 +1,27 @@
package eu.kanade.tachiyomi.extension.ru.rumix
import android.app.Application
import android.content.SharedPreferences
import android.widget.Toast
import androidx.preference.EditTextPreference
import eu.kanade.tachiyomi.multisrc.grouple.GroupLe
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class RuMIX : GroupLe("RuMIX", "https://rumix.me", "ru") {
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}
private var domain: String = preferences.getString(DOMAIN_TITLE, DOMAIN_DEFAULT)!!
override val baseUrl: String = domain
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
@ -39,4 +52,30 @@ class RuMIX : GroupLe("RuMIX", "https://rumix.me", "ru") {
override fun getFilterList() = FilterList(
OrderBy(),
)
override fun setupPreferenceScreen(screen: androidx.preference.PreferenceScreen) {
super.setupPreferenceScreen(screen)
EditTextPreference(screen.context).apply {
key = DOMAIN_TITLE
this.title = DOMAIN_TITLE
summary = domain
this.setDefaultValue(DOMAIN_DEFAULT)
dialogTitle = DOMAIN_TITLE
setOnPreferenceChangeListener { _, newValue ->
try {
val res = preferences.edit().putString(DOMAIN_TITLE, newValue as String).commit()
Toast.makeText(screen.context, "Для смены домена необходимо перезапустить приложение с полной остановкой.", Toast.LENGTH_LONG).show()
res
} catch (e: Exception) {
e.printStackTrace()
false
}
}
}.let(screen::addPreference)
}
companion object {
private const val DOMAIN_TITLE = "Домен"
private const val DOMAIN_DEFAULT = "https://rumix.me"
}
}

View File

@ -1,16 +1,29 @@
package eu.kanade.tachiyomi.extension.ru.selfmanga
import android.app.Application
import android.content.SharedPreferences
import android.widget.Toast
import androidx.preference.EditTextPreference
import eu.kanade.tachiyomi.multisrc.grouple.GroupLe
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class SelfManga : GroupLe("SelfManga", "https://selfmanga.live", "ru") {
override val id: Long = 5227602742162454547
private val preferences: SharedPreferences by lazy {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}
private var domain: String = preferences.getString(DOMAIN_TITLE, DOMAIN_DEFAULT)!!
override val baseUrl: String = domain
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
@ -103,4 +116,29 @@ class SelfManga : GroupLe("SelfManga", "https://selfmanga.live", "ru") {
Genre("школа", "el_2127"),
Genre("этти", "el_4982"),
)
override fun setupPreferenceScreen(screen: androidx.preference.PreferenceScreen) {
super.setupPreferenceScreen(screen)
EditTextPreference(screen.context).apply {
key = DOMAIN_TITLE
this.title = DOMAIN_TITLE
summary = domain
this.setDefaultValue(DOMAIN_DEFAULT)
dialogTitle = DOMAIN_TITLE
setOnPreferenceChangeListener { _, newValue ->
try {
val res = preferences.edit().putString(DOMAIN_TITLE, newValue as String).commit()
Toast.makeText(screen.context, "Для смены домена необходимо перезапустить приложение с полной остановкой.", Toast.LENGTH_LONG).show()
res
} catch (e: Exception) {
e.printStackTrace()
false
}
}
}.let(screen::addPreference)
}
companion object {
private const val DOMAIN_TITLE = "Домен"
private const val DOMAIN_DEFAULT = "https://selfmanga.live"
}
}

View File

@ -9,12 +9,12 @@ class GroupLeGenerator : ThemeSourceGenerator {
override val themeClass = "GroupLe"
override val baseVersionCode = 19
override val baseVersionCode = 20
override val sources = listOf(
SingleLang("ReadManga", "https://readmanga.live", "ru", overrideVersionCode = 46),
SingleLang("MintManga", "https://mintmanga.live", "ru", overrideVersionCode = 46),
SingleLang("AllHentai", "https://2023.allhen.online", "ru", isNsfw = true, overrideVersionCode = 22),
SingleLang("MintManga", "https://mintmanga.com", "ru", isNsfw = true, overrideVersionCode = 46),
SingleLang("AllHentai", "https://z.allhen.online", "ru", isNsfw = true, overrideVersionCode = 22),
SingleLang("SelfManga", "https://selfmanga.live", "ru", overrideVersionCode = 22),
SingleLang("RuMIX", "https://rumix.me", "ru", overrideVersionCode = 1),
)