[RU]Grouple disable library redirects (again and limit) (#10941)

* [RU]Grouple disable library redirects (again and limit)

* chapter_number get rid of zero

* minimizing erroneous site numbering chapters (visibility only name)
This commit is contained in:
e-shl 2022-02-27 19:48:14 +05:00 committed by GitHub
parent 91ae13fa20
commit ef2c7c761d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 20 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'AllHentai'
pkgNameSuffix = 'ru.allhentai'
extClass = '.AllHentai'
extVersionCode = 16
extVersionCode = 17
isNsfw = true
}

View File

@ -25,6 +25,7 @@ import org.jsoup.nodes.Element
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
@ -49,10 +50,10 @@ class AllHentai : ConfigurableSource, ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor)
.addInterceptor { chain ->
.addNetworkInterceptor { chain ->
val originalRequest = chain.request()
val response = chain.proceed(originalRequest)
if (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301))
if (originalRequest.url.toString().contains(baseUrl) and (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301)))
throw Exception("Манга переехала на другой адрес/ссылку!")
response
}
@ -235,11 +236,13 @@ class AllHentai : ConfigurableSource, ParsedHttpSource() {
val single = Regex("""\s*Сингл\s*""")
when {
extra.containsMatchIn(chapter.name) -> {
chapter.name = chapter.name.replaceFirst(" ", " - " + chapter.chapter_number.toString() + " ")
if (chapter.name.substringAfter("Экстра").trim().isEmpty())
chapter.name = chapter.name.replaceFirst(" ", " - " + DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " ")
}
single.containsMatchIn(chapter.name) -> {
chapter.name = chapter.chapter_number.toString() + " " + chapter.name
if (chapter.name.substringAfter("Сингл").trim().isEmpty())
chapter.name = DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " " + chapter.name
}
}
}

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mintmanga'
pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga'
extVersionCode = 39
extVersionCode = 40
}
dependencies {

View File

@ -25,6 +25,7 @@ import org.jsoup.nodes.Element
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
@ -48,10 +49,10 @@ class Mintmanga : ConfigurableSource, ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor)
.addInterceptor { chain ->
.addNetworkInterceptor { chain ->
val originalRequest = chain.request()
val response = chain.proceed(originalRequest)
if (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301))
if (originalRequest.url.toString().contains(baseUrl) and (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301)))
throw Exception("Манга переехала на другой адрес/ссылку!")
response
}
@ -267,11 +268,13 @@ class Mintmanga : ConfigurableSource, ParsedHttpSource() {
val single = Regex("""\s*Сингл\s*""")
when {
extra.containsMatchIn(chapter.name) -> {
chapter.name = chapter.name.replaceFirst(" ", " - " + chapter.chapter_number.toString() + " ")
if (chapter.name.substringAfter("Экстра").trim().isEmpty())
chapter.name = chapter.name.replaceFirst(" ", " - " + DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " ")
}
single.containsMatchIn(chapter.name) -> {
chapter.name = chapter.chapter_number.toString() + " " + chapter.name
if (chapter.name.substringAfter("Сингл").trim().isEmpty())
chapter.name = DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " " + chapter.name
}
}
}

View File

@ -5,7 +5,7 @@ ext {
extName = 'Readmanga'
pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga'
extVersionCode = 38
extVersionCode = 39
}
dependencies {

View File

@ -25,6 +25,7 @@ import org.jsoup.nodes.Element
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
@ -48,10 +49,10 @@ class Readmanga : ConfigurableSource, ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor)
.addInterceptor { chain ->
.addNetworkInterceptor { chain ->
val originalRequest = chain.request()
val response = chain.proceed(originalRequest)
if (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301))
if (originalRequest.url.toString().contains(baseUrl) and (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301)))
throw Exception("Манга переехала на другой адрес/ссылку!")
response
}
@ -268,11 +269,13 @@ class Readmanga : ConfigurableSource, ParsedHttpSource() {
val single = Regex("""\s*Сингл\s*""")
when {
extra.containsMatchIn(chapter.name) -> {
chapter.name = chapter.name.replaceFirst(" ", " - " + chapter.chapter_number.toString() + " ")
if (chapter.name.substringAfter("Экстра").trim().isEmpty())
chapter.name = chapter.name.replaceFirst(" ", " - " + DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " ")
}
single.containsMatchIn(chapter.name) -> {
chapter.name = chapter.chapter_number.toString() + " " + chapter.name
if (chapter.name.substringAfter("Сингл").trim().isEmpty())
chapter.name = DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " " + chapter.name
}
}
}

View File

@ -5,7 +5,7 @@ ext {
extName = 'Selfmanga'
pkgNameSuffix = 'ru.selfmanga'
extClass = '.Selfmanga'
extVersionCode = 16
extVersionCode = 17
}
dependencies {

View File

@ -15,6 +15,7 @@ import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
@ -34,10 +35,10 @@ class Selfmanga : ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor)
.addInterceptor { chain ->
.addNetworkInterceptor { chain ->
val originalRequest = chain.request()
val response = chain.proceed(originalRequest)
if (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301))
if (originalRequest.url.toString().contains(baseUrl) and (originalRequest.url.toString().contains("internal/redirect") or (response.code == 301)))
throw Exception("Манга переехала на другой адрес/ссылку!")
response
}
@ -151,11 +152,13 @@ class Selfmanga : ParsedHttpSource() {
val single = Regex("""\s*Сингл\s*""")
when {
extra.containsMatchIn(chapter.name) -> {
chapter.name = chapter.name.replaceFirst(" ", " - " + chapter.chapter_number.toString() + " ")
if (chapter.name.substringAfter("Экстра").trim().isEmpty())
chapter.name = chapter.name.replaceFirst(" ", " - " + DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " ")
}
single.containsMatchIn(chapter.name) -> {
chapter.name = chapter.chapter_number.toString() + " " + chapter.name
if (chapter.name.substringAfter("Сингл").trim().isEmpty())
chapter.name = DecimalFormat("#,###.##").format(chapter.chapter_number).replace(",", ".") + " " + chapter.name
}
}
}