Kissmanga fix. Kotlin 1.1.1

This commit is contained in:
len 2017-03-18 14:11:16 +01:00
parent 2e44f29882
commit 3be9881997
3 changed files with 32 additions and 10 deletions

View file

@ -101,7 +101,7 @@ android {
dependencies { dependencies {
// Modified dependencies // Modified dependencies
compile 'com.github.inorichi:subsampling-scale-image-view:4255750' compile 'com.github.inorichi:subsampling-scale-image-view:01e5385'
compile 'com.github.inorichi:junrar-android:634c1f5' compile 'com.github.inorichi:junrar-android:634c1f5'
// Android support library // Android support library
@ -212,7 +212,7 @@ dependencies {
} }
buildscript { buildscript {
ext.kotlin_version = '1.1.0' ext.kotlin_version = '1.1.1'
repositories { repositories {
mavenCentral() mavenCentral()
} }

View file

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.online.english package eu.kanade.tachiyomi.source.online.english
import com.squareup.duktape.Duktape
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.*
@ -114,15 +115,37 @@ class Kissmanga : ParsedHttpSource() {
override fun pageListRequest(chapter: SChapter) = POST(baseUrl + chapter.url, headers) override fun pageListRequest(chapter: SChapter) = POST(baseUrl + chapter.url, headers)
override fun pageListParse(response: Response): List<Page> { override fun pageListParse(response: Response): List<Page> {
val pages = mutableListOf<Page>() val body = response.body().string()
//language=RegExp
val p = Pattern.compile("""lstImages.push\("(.+?)"""")
val m = p.matcher(response.body().string())
var i = 0 val ca = client.newCall(GET("$baseUrl/Scripts/ca.js", headers)).execute()
while (m.find()) { val lo = client.newCall(GET("$baseUrl/Scripts/lo.js", headers)).execute()
pages.add(Page(i++, "", m.group(1)))
val caBody = ca.body().string()
val loBody = lo.body().string()
val pages = mutableListOf<Page>()
Duktape.create().use {
it.evaluate(caBody)
it.evaluate(loBody)
var p = Pattern.compile("(.*CryptoJS.*)")
var m = p.matcher(body)
while (m.find()) {
it.evaluate(m.group(1))
}
p = Pattern.compile("""lstImages.push\((.*)\);""")
m = p.matcher(body)
var i = 0
while (m.find()) {
val url = it.evaluate(m.group(1)) as String
pages.add(Page(i++, "", url))
}
} }
return pages return pages
} }

View file

@ -17,6 +17,5 @@ allprojects {
repositories { repositories {
jcenter() jcenter()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/inorichi/maven" }
} }
} }