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 {
// 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'
// Android support library
@ -212,7 +212,7 @@ dependencies {
}
buildscript {
ext.kotlin_version = '1.1.0'
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
}

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.online.english
import com.squareup.duktape.Duktape
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
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 pageListParse(response: Response): List<Page> {
val pages = mutableListOf<Page>()
//language=RegExp
val p = Pattern.compile("""lstImages.push\("(.+?)"""")
val m = p.matcher(response.body().string())
val body = response.body().string()
var i = 0
while (m.find()) {
pages.add(Page(i++, "", m.group(1)))
val ca = client.newCall(GET("$baseUrl/Scripts/ca.js", headers)).execute()
val lo = client.newCall(GET("$baseUrl/Scripts/lo.js", headers)).execute()
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
}

View File

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