[RU]Remanga change exManga chapters redirect (#16247)
* [RU]Remanga change exManga chapters redirect * extVersionCode
This commit is contained in:
parent
e55fb1a7fe
commit
b7b77a7299
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'Remanga'
|
extName = 'Remanga'
|
||||||
pkgNameSuffix = 'ru.remanga'
|
pkgNameSuffix = 'ru.remanga'
|
||||||
extClass = '.Remanga'
|
extClass = '.Remanga'
|
||||||
extVersionCode = 72
|
extVersionCode = 73
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -504,7 +504,7 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||||||
if (preferences.getBoolean(exPAID_PREF, true)) {
|
if (preferences.getBoolean(exPAID_PREF, true)) {
|
||||||
if (chapter.is_paid and (chapter.is_bought != true)) {
|
if (chapter.is_paid and (chapter.is_bought != true)) {
|
||||||
if (exChID != null) {
|
if (exChID != null) {
|
||||||
url = "$exManga/chapter?id=${exChID.id}"
|
url = "/chapter?id=${exChID.id}"
|
||||||
scanlator = "exmanga"
|
scanlator = "exmanga"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -551,10 +551,10 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.N)
|
@TargetApi(Build.VERSION_CODES.N)
|
||||||
private fun pageListParse(response: Response, urlChapter: String): List<Page> {
|
private fun pageListParse(response: Response, chapter: SChapter): List<Page> {
|
||||||
val body = response.body.string()
|
val body = response.body.string()
|
||||||
val heightEmptyChunks = 10
|
val heightEmptyChunks = 10
|
||||||
if (urlChapter.contains(exManga)) {
|
if (chapter.scanlator.equals("exmanga")) {
|
||||||
try {
|
try {
|
||||||
val exPage = json.decodeFromString<SeriesExWrapperDto<List<List<PagesDto>>>>(body)
|
val exPage = json.decodeFromString<SeriesExWrapperDto<List<List<PagesDto>>>>(body)
|
||||||
val result = mutableListOf<Page>()
|
val result = mutableListOf<Page>()
|
||||||
@ -568,7 +568,7 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||||||
throw IOException("Главы больше нет на ExManga. Попробуйте обновить список глав (свайп сверху).")
|
throw IOException("Главы больше нет на ExManga. Попробуйте обновить список глав (свайп сверху).")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (urlChapter.contains("#is_bought") and (preferences.getBoolean(exPAID_PREF, true))) {
|
if (chapter.url.contains("#is_bought") and (preferences.getBoolean(exPAID_PREF, true))) {
|
||||||
val newHeaders = exHeaders().newBuilder()
|
val newHeaders = exHeaders().newBuilder()
|
||||||
.add("Content-Type", "application/json")
|
.add("Content-Type", "application/json")
|
||||||
.build()
|
.build()
|
||||||
@ -601,8 +601,8 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||||||
override fun pageListParse(response: Response): List<Page> = throw UnsupportedOperationException("pageListParse(response: Response, urlRequest: String)")
|
override fun pageListParse(response: Response): List<Page> = throw UnsupportedOperationException("pageListParse(response: Response, urlRequest: String)")
|
||||||
|
|
||||||
override fun pageListRequest(chapter: SChapter): Request {
|
override fun pageListRequest(chapter: SChapter): Request {
|
||||||
return if (chapter.url.contains(exManga)) {
|
return if (chapter.scanlator.equals("exmanga")) {
|
||||||
GET(chapter.url, exHeaders())
|
GET(exManga + chapter.url, exHeaders())
|
||||||
} else {
|
} else {
|
||||||
if (chapter.name.contains("\uD83D\uDCB2")) {
|
if (chapter.name.contains("\uD83D\uDCB2")) {
|
||||||
val noEX = if (preferences.getBoolean(exPAID_PREF, true)) {
|
val noEX = if (preferences.getBoolean(exPAID_PREF, true)) {
|
||||||
@ -618,12 +618,12 @@ class Remanga : ConfigurableSource, HttpSource() {
|
|||||||
return client.newCall(pageListRequest(chapter))
|
return client.newCall(pageListRequest(chapter))
|
||||||
.asObservableSuccess()
|
.asObservableSuccess()
|
||||||
.map { response ->
|
.map { response ->
|
||||||
pageListParse(response, chapter.url)
|
pageListParse(response, chapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getChapterUrl(chapter: SChapter): String {
|
override fun getChapterUrl(chapter: SChapter): String {
|
||||||
return if (chapter.url.contains(exManga)) chapter.url else baseUrl.replace("api.", "") + chapter.url.substringBefore("#is_bought")
|
return if (chapter.scanlator.equals("exmanga")) exManga + chapter.url else baseUrl.replace("api.", "") + chapter.url.substringBefore("#is_bought")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun fetchImageUrl(page: Page): Observable<String> = Observable.just(page.imageUrl!!)
|
override fun fetchImageUrl(page: Page): Observable<String> = Observable.just(page.imageUrl!!)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user