[RU]Remanga fix many request (HTTP 429) (#17801)

[RU]Remanga fix many request
This commit is contained in:
Eshlender 2023-09-06 21:38:32 +05:00 committed by GitHub
parent 651e5cf507
commit f922e6cc7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Remanga' extName = 'Remanga'
pkgNameSuffix = 'ru.remanga' pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga' extClass = '.Remanga'
extVersionCode = 76 extVersionCode = 77
} }
dependencies { dependencies {

View File

@ -487,7 +487,7 @@ class Remanga : ConfigurableSource, HttpSource() {
} }
val selectedBranch = branch.maxByOrNull { selector(it) }!! val selectedBranch = branch.maxByOrNull { selector(it) }!!
val tempChaptersList = mutableListOf<SChapter>() val tempChaptersList = mutableListOf<SChapter>()
(1..(selectedBranch.count_chapters / 100 + 1)).map { (1..(selectedBranch.count_chapters / 300 + 1)).map {
val response = chapterListRequest(selectedBranch.id, it) val response = chapterListRequest(selectedBranch.id, it)
chapterListParse(response, manga, exChapters) chapterListParse(response, manga, exChapters)
}.let { tempChaptersList.addAll(it.flatten()) } }.let { tempChaptersList.addAll(it.flatten()) }
@ -501,7 +501,7 @@ class Remanga : ConfigurableSource, HttpSource() {
).content.firstOrNull()?.chapter?.toFloatOrNull() ?: -2F ).content.firstOrNull()?.chapter?.toFloatOrNull() ?: -2F
) )
) { ) {
(1..(selectedBranch2.count_chapters / 100 + 1)).map { (1..(selectedBranch2.count_chapters / 300 + 1)).map {
val response = chapterListRequest(selectedBranch2.id, it) val response = chapterListRequest(selectedBranch2.id, it)
chapterListParse(response, manga, exChapters) chapterListParse(response, manga, exChapters)
}.let { tempChaptersList.addAll(0, it.flatten()) } }.let { tempChaptersList.addAll(0, it.flatten()) }
@ -518,7 +518,7 @@ class Remanga : ConfigurableSource, HttpSource() {
private fun chapterListRequest(branch: Long, page: Number): Response = private fun chapterListRequest(branch: Long, page: Number): Response =
client.newCall( client.newCall(
GET( GET(
"$baseUrl/api/titles/chapters/?branch_id=$branch&page=$page&count=100", "$baseUrl/api/titles/chapters/?branch_id=$branch&page=$page&count=300",
headers, headers,
), ),
).execute().run { ).execute().run {