Nudemoon - fix pages (#2668)

Nudemoon - fix pages
This commit is contained in:
Mike 2020-04-13 20:49:20 -04:00 committed by GitHub
parent 7a09f9fc17
commit 6ca901f7e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Nude-Moon' appName = 'Tachiyomi: Nude-Moon'
pkgNameSuffix = 'ru.nudemoon' pkgNameSuffix = 'ru.nudemoon'
extClass = '.Nudemoon' extClass = '.Nudemoon'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -8,10 +8,9 @@ import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.jsoup.nodes.TextNode
import java.net.URLEncoder import java.net.URLEncoder
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.Locale
class Nudemoon : ParsedHttpSource() { class Nudemoon : ParsedHttpSource() {
@ -167,20 +166,13 @@ class Nudemoon : ParsedHttpSource() {
return chapter return chapter
} }
override fun pageListRequest(chapter: SChapter): Request {
return GET(baseUrl + chapter.url, headers)
}
override fun pageListParse(response: Response): List<Page> { override fun pageListParse(response: Response): List<Page> {
val document = response.asJsoup() val imgScript = response.asJsoup().select("script:containsData(var images)").first().data()
val resPages = mutableListOf<Page>()
val imgScript = document.select("script:containsData(var images)").first().html()
Regex("images\\[(\\d+)].src\\s=\\s'.(.*)'").findAll(imgScript).forEach { return Regex("""images\[(\d+)].src\s=\s'(http.*)'""").findAll(imgScript).map {
resPages.add(Page(it.groupValues[1].toInt(), imageUrl = baseUrl + it.groupValues[2])) Page(it.groupValues[1].toInt(), imageUrl = it.groupValues[2])
} }.toList()
return resPages
} }
override fun imageUrlParse(document: Document) = throw Exception("Not Used") override fun imageUrlParse(document: Document) = throw Exception("Not Used")