Japscan: use proper request method in interceptor (fixes #931) (#944)

Japscan: use proper request method in interceptor (fixes #931)
This commit is contained in:
Eugene 2019-03-19 20:09:53 -04:00 committed by Carlos
parent c89a080366
commit 97b077819a
2 changed files with 18 additions and 12 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Japscan' appName = 'Tachiyomi: Japscan'
pkgNameSuffix = 'fr.japscan' pkgNameSuffix = 'fr.japscan'
extClass = '.Japscan' extClass = '.Japscan'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -1,12 +1,5 @@
package eu.kanade.tachiyomi.extension.fr.japscan package eu.kanade.tachiyomi.extension.fr.japscan
/**
* @file Japscan.kt
* @brief Defines class Japscan for french source Japscan
* @date 2018-09-02
* @version 1.0
*/
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import android.graphics.Canvas import android.graphics.Canvas
@ -15,9 +8,18 @@ import com.google.gson.JsonObject
import com.google.gson.JsonParser import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.* import okhttp3.FormBody
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.ResponseBody
import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.StringUtils
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
@ -43,7 +45,11 @@ class Japscan : ParsedHttpSource() {
val request = chain.request() val request = chain.request()
val url = request.url().toString() val url = request.url().toString()
val response = chain.proceed(GET(url.substringBefore(indicator)))
val newRequest = request.newBuilder()
.url(url.substringBefore(indicator))
.build()
val response = chain.proceed(newRequest)
if (!url.endsWith(indicator)) return@addInterceptor response if (!url.endsWith(indicator)) return@addInterceptor response