Grouple: Add user token (#7617)
* Grouple: Add user token * Grouple: Bump * Grouple: update readmanga domain
This commit is contained in:
parent
bd311d42e8
commit
5e57723c32
@ -2,4 +2,4 @@ plugins {
|
|||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 28
|
baseVersionCode = 29
|
||||||
|
@ -209,7 +209,9 @@ abstract class GroupLe(
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected open fun getChapterSearchParams(document: Document): String {
|
protected open fun getChapterSearchParams(document: Document): String {
|
||||||
return "?mtr=true"
|
val scriptContent = document.selectFirst("script:containsData(user_hash)")?.data()
|
||||||
|
val userHash = scriptContent?.let { USER_HASH_REGEX.find(it)?.groupValues?.get(1) }
|
||||||
|
return userHash?.let { "?d=$it&mtr=true" } ?: "?mtr=true"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun chapterListParse(response: Response, manga: SManga): List<SChapter> {
|
private fun chapterListParse(response: Response, manga: SManga): List<SChapter> {
|
||||||
@ -436,5 +438,6 @@ abstract class GroupLe(
|
|||||||
private const val UAGENT_TITLE = "User-Agent(для некоторых стран)"
|
private const val UAGENT_TITLE = "User-Agent(для некоторых стран)"
|
||||||
private const val UAGENT_DEFAULT = "arora"
|
private const val UAGENT_DEFAULT = "arora"
|
||||||
const val PREFIX_SLUG_SEARCH = "slug:"
|
const val PREFIX_SLUG_SEARCH = "slug:"
|
||||||
|
private val USER_HASH_REGEX = "user_hash.+'(.+)'".toRegex()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import eu.kanade.tachiyomi.network.GET
|
|||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
|
||||||
@ -19,16 +18,6 @@ class AllHentai : GroupLe("AllHentai", "https://20.allhen.online", "ru") {
|
|||||||
|
|
||||||
override val baseUrl by lazy { getPrefBaseUrl() }
|
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||||
|
|
||||||
override fun getChapterSearchParams(document: Document): String {
|
|
||||||
val html = document.html()
|
|
||||||
|
|
||||||
val userHashRegex = "user_hash.+'(.+)'".toRegex()
|
|
||||||
|
|
||||||
val userHash = userHashRegex.find(html)?.groupValues?.get(1)
|
|
||||||
|
|
||||||
return userHash?.let { "?d=$it" } ?: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
|
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
|
||||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||||
|
@ -8,7 +8,6 @@ import eu.kanade.tachiyomi.network.GET
|
|||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
|
||||||
@ -21,14 +20,6 @@ class MintManga : GroupLe("MintManga", "https://2.mintmanga.one", "ru") {
|
|||||||
|
|
||||||
override val baseUrl by lazy { getPrefBaseUrl() }
|
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||||
|
|
||||||
override fun getChapterSearchParams(document: Document): String {
|
|
||||||
val scriptContent = document.selectFirst("script:containsData(user_hash)")?.data()
|
|
||||||
|
|
||||||
val userHash = scriptContent?.let { USER_HASH_REGEX.find(it)?.groupValues?.get(1) }
|
|
||||||
|
|
||||||
return userHash?.let { "?d=$it" } ?: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
|
val url = super.searchMangaRequest(page, query, filters).url.newBuilder()
|
||||||
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList().reversed() else filters.reversed()).forEach { filter ->
|
||||||
@ -210,6 +201,5 @@ class MintManga : GroupLe("MintManga", "https://2.mintmanga.one", "ru") {
|
|||||||
private const val DOMAIN_PREF = "Домен"
|
private const val DOMAIN_PREF = "Домен"
|
||||||
private const val DEFAULT_DOMAIN_PREF = "pref_default_domain"
|
private const val DEFAULT_DOMAIN_PREF = "pref_default_domain"
|
||||||
private const val DOMAIN_TITLE = "Домен"
|
private const val DOMAIN_TITLE = "Домен"
|
||||||
private val USER_HASH_REGEX = "user_hash.+'(.+)'".toRegex()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ ext {
|
|||||||
extName = 'ReadManga'
|
extName = 'ReadManga'
|
||||||
extClass = '.ReadManga'
|
extClass = '.ReadManga'
|
||||||
themePkg = 'grouple'
|
themePkg = 'grouple'
|
||||||
baseUrl = 'https://1.readmanga.io'
|
baseUrl = 'https://zz.readmanga.io'
|
||||||
overrideVersionCode = 46
|
overrideVersionCode = 46
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import okhttp3.Request
|
|||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
|
||||||
class ReadManga : GroupLe("ReadManga", "https://1.readmanga.io", "ru") {
|
class ReadManga : GroupLe("ReadManga", "https://zz.readmanga.io", "ru") {
|
||||||
|
|
||||||
override val id: Long = 5
|
override val id: Long = 5
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user