Update bundled sources. Add duktape stub lib. Update gradle
This commit is contained in:
parent
7929a768c4
commit
0c26d11846
|
@ -4,7 +4,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.2.3'
|
classpath 'com.android.tools.build:gradle:2.3.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Mon Dec 28 10:00:20 PST 2015
|
#Thu Jun 01 17:09:13 CEST 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java.srcDirs = ['src']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceCompatibility = "1.6"
|
||||||
|
targetCompatibility = "1.6"
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.squareup.duktape;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
public class Duktape implements Closeable {
|
||||||
|
|
||||||
|
public static Duktape create() {
|
||||||
|
throw new RuntimeException("Stub!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void close() throws IOException {
|
||||||
|
throw new RuntimeException("Stub!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized Object evaluate(String script) {
|
||||||
|
throw new RuntimeException("Stub!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -4,4 +4,6 @@ new File(rootDir, "src").eachDir { dir ->
|
||||||
include name
|
include name
|
||||||
project(name).projectDir = new File("src/${dir.name}/${subdir.name}")
|
project(name).projectDir = new File("src/${dir.name}/${subdir.name}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
include ':duktape-stub'
|
||||||
|
project(':duktape-stub').projectDir = new File("lib/duktape-stub")
|
|
@ -6,8 +6,12 @@ ext {
|
||||||
pkgNameSuffix = "en.kissmanga"
|
pkgNameSuffix = "en.kissmanga"
|
||||||
extClass = '.Kissmanga'
|
extClass = '.Kissmanga'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
provided project(':duktape-stub')
|
||||||
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.kissmanga
|
package eu.kanade.tachiyomi.extension.en.kissmanga
|
||||||
|
|
||||||
|
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 pages = mutableListOf<Page>()
|
||||||
while (m.find()) {
|
|
||||||
pages.add(Page(i++, "", m.group(1)))
|
// Kissmanga now encrypts the urls, so we need to execute these two scripts in JS.
|
||||||
|
val ca = client.newCall(GET("$baseUrl/Scripts/ca.js", headers)).execute().body()!!.string()
|
||||||
|
val lo = client.newCall(GET("$baseUrl/Scripts/lo.js", headers)).execute().body()!!.string()
|
||||||
|
|
||||||
|
Duktape.create().use {
|
||||||
|
it.evaluate(ca)
|
||||||
|
it.evaluate(lo)
|
||||||
|
|
||||||
|
// There are two functions in an inline script needed to decrypt the urls. We find and
|
||||||
|
// execute them.
|
||||||
|
var p = Pattern.compile("(.*CryptoJS.*)")
|
||||||
|
var m = p.matcher(body)
|
||||||
|
while (m.find()) {
|
||||||
|
it.evaluate(m.group(1))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally find all the urls and decrypt them in JS.
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Mangafox : ParsedHttpSource() {
|
||||||
override fun latestUpdatesNextPageSelector() = "a:has(span.next)"
|
override fun latestUpdatesNextPageSelector() = "a:has(span.next)"
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1").newBuilder().addQueryParameter("name", query)
|
val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1")!!.newBuilder().addQueryParameter("name", query)
|
||||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||||
when (filter) {
|
when (filter) {
|
||||||
is Status -> url.addQueryParameter(filter.id, filter.state.toString())
|
is Status -> url.addQueryParameter(filter.id, filter.state.toString())
|
||||||
|
@ -168,7 +168,7 @@ class Mangafox : ParsedHttpSource() {
|
||||||
private class Type : Filter.Select<String>("Type", arrayOf("Any", "Japanese Manga", "Korean Manhwa", "Chinese Manhua"))
|
private class Type : Filter.Select<String>("Type", arrayOf("Any", "Japanese Manga", "Korean Manhwa", "Chinese Manhua"))
|
||||||
private class OrderBy : Filter.Sort("Order by",
|
private class OrderBy : Filter.Sort("Order by",
|
||||||
arrayOf("Series name", "Rating", "Views", "Total chapters", "Last chapter"),
|
arrayOf("Series name", "Rating", "Views", "Total chapters", "Last chapter"),
|
||||||
Selection(2, false))
|
Filter.Sort.Selection(2, false))
|
||||||
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
|
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
|
||||||
|
|
||||||
override fun getFilterList() = FilterList(
|
override fun getFilterList() = FilterList(
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
pkgNameSuffix = "en.mangahere"
|
pkgNameSuffix = "en.mangahere"
|
||||||
extClass = '.Mangahere'
|
extClass = '.Mangahere'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ class Mangahere : ParsedHttpSource() {
|
||||||
override fun latestUpdatesNextPageSelector() = "div.next-page > a.next"
|
override fun latestUpdatesNextPageSelector() = "div.next-page > a.next"
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1").newBuilder().addQueryParameter("name", query)
|
val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1")!!.newBuilder().addQueryParameter("name", query)
|
||||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||||
when (filter) {
|
when (filter) {
|
||||||
is Status -> url.addQueryParameter("is_completed", arrayOf("", "1", "0")[filter.state])
|
is Status -> url.addQueryParameter("is_completed", arrayOf("", "1", "0")[filter.state])
|
||||||
|
@ -152,6 +152,11 @@ class Mangahere : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
|
val licensedError = document.select(".mangaread_error > .mt10").first()
|
||||||
|
if (licensedError != null) {
|
||||||
|
throw Exception(licensedError.text())
|
||||||
|
}
|
||||||
|
|
||||||
val pages = mutableListOf<Page>()
|
val pages = mutableListOf<Page>()
|
||||||
document.select("select.wid60").first()?.getElementsByTag("option")?.forEach {
|
document.select("select.wid60").first()?.getElementsByTag("option")?.forEach {
|
||||||
pages.add(Page(pages.size, it.attr("value")))
|
pages.add(Page(pages.size, it.attr("value")))
|
||||||
|
@ -168,7 +173,7 @@ class Mangahere : ParsedHttpSource() {
|
||||||
private class Type : Filter.Select<String>("Type", arrayOf("Any", "Japanese Manga (read from right to left)", "Korean Manhwa (read from left to right)"))
|
private class Type : Filter.Select<String>("Type", arrayOf("Any", "Japanese Manga (read from right to left)", "Korean Manhwa (read from left to right)"))
|
||||||
private class OrderBy : Filter.Sort("Order by",
|
private class OrderBy : Filter.Sort("Order by",
|
||||||
arrayOf("Series name", "Rating", "Views", "Total chapters", "Last chapter"),
|
arrayOf("Series name", "Rating", "Views", "Total chapters", "Last chapter"),
|
||||||
Selection(2, false))
|
Filter.Sort.Selection(2, false))
|
||||||
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
|
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Genres", genres)
|
||||||
|
|
||||||
override fun getFilterList() = FilterList(
|
override fun getFilterList() = FilterList(
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
pkgNameSuffix = "en.mangasee"
|
pkgNameSuffix = "en.mangasee"
|
||||||
extClass = '.Mangasee'
|
extClass = '.Mangasee'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.network.POST
|
||||||
import eu.kanade.tachiyomi.source.model.*
|
import eu.kanade.tachiyomi.source.model.*
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
|
import okhttp3.Headers
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
|
@ -27,11 +28,16 @@ class Mangasee : ParsedHttpSource() {
|
||||||
|
|
||||||
private val indexPattern = Pattern.compile("-index-(.*?)-")
|
private val indexPattern = Pattern.compile("-index-(.*?)-")
|
||||||
|
|
||||||
|
private val catalogHeaders = Headers.Builder().apply {
|
||||||
|
add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)")
|
||||||
|
add("Host", "mangaseeonline.us")
|
||||||
|
}.build()
|
||||||
|
|
||||||
override fun popularMangaSelector() = "div.requested > div.row"
|
override fun popularMangaSelector() = "div.requested > div.row"
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
val (body, requestUrl) = convertQueryToPost(page, "$baseUrl/search/request.php?sortBy=popularity&sortOrder=descending")
|
val (body, requestUrl) = convertQueryToPost(page, "$baseUrl/search/request.php?sortBy=popularity&sortOrder=descending")
|
||||||
return POST(requestUrl, headers, body.build())
|
return POST(requestUrl, catalogHeaders, body.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element): SManga {
|
override fun popularMangaFromElement(element: Element): SManga {
|
||||||
|
@ -48,7 +54,7 @@ class Mangasee : ParsedHttpSource() {
|
||||||
override fun searchMangaSelector() = "div.requested > div.row"
|
override fun searchMangaSelector() = "div.requested > div.row"
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = HttpUrl.parse("$baseUrl/search/request.php").newBuilder()
|
val url = HttpUrl.parse("$baseUrl/search/request.php")!!.newBuilder()
|
||||||
if (!query.isEmpty()) url.addQueryParameter("keyword", query)
|
if (!query.isEmpty()) url.addQueryParameter("keyword", query)
|
||||||
val genres = mutableListOf<String>()
|
val genres = mutableListOf<String>()
|
||||||
val genresNo = mutableListOf<String>()
|
val genresNo = mutableListOf<String>()
|
||||||
|
@ -74,11 +80,11 @@ class Mangasee : ParsedHttpSource() {
|
||||||
if (genresNo.isNotEmpty()) url.addQueryParameter("genreNo", genresNo.joinToString(","))
|
if (genresNo.isNotEmpty()) url.addQueryParameter("genreNo", genresNo.joinToString(","))
|
||||||
|
|
||||||
val (body, requestUrl) = convertQueryToPost(page, url.toString())
|
val (body, requestUrl) = convertQueryToPost(page, url.toString())
|
||||||
return POST(requestUrl, headers, body.build())
|
return POST(requestUrl, catalogHeaders, body.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun convertQueryToPost(page: Int, url: String): Pair<FormBody.Builder, String> {
|
private fun convertQueryToPost(page: Int, url: String): Pair<FormBody.Builder, String> {
|
||||||
val url = HttpUrl.parse(url)
|
val url = HttpUrl.parse(url)!!
|
||||||
val body = FormBody.Builder().add("page", page.toString())
|
val body = FormBody.Builder().add("page", page.toString())
|
||||||
for (i in 0..url.querySize() - 1) {
|
for (i in 0..url.querySize() - 1) {
|
||||||
body.add(url.queryParameterName(i), url.queryParameterValue(i))
|
body.add(url.queryParameterName(i), url.queryParameterValue(i))
|
||||||
|
@ -164,7 +170,7 @@ class Mangasee : ParsedHttpSource() {
|
||||||
override fun latestUpdatesRequest(page: Int): Request {
|
override fun latestUpdatesRequest(page: Int): Request {
|
||||||
val url = "http://mangaseeonline.net/home/latest.request.php"
|
val url = "http://mangaseeonline.net/home/latest.request.php"
|
||||||
val (body, requestUrl) = convertQueryToPost(page, url)
|
val (body, requestUrl) = convertQueryToPost(page, url)
|
||||||
return POST(requestUrl, headers, body.build())
|
return POST(requestUrl, catalogHeaders, body.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun latestUpdatesFromElement(element: Element): SManga {
|
override fun latestUpdatesFromElement(element: Element): SManga {
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
pkgNameSuffix = "ru.mangachan"
|
pkgNameSuffix = "ru.mangachan"
|
||||||
extClass = '.Mangachan'
|
extClass = '.Mangachan'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,16 +28,21 @@ class Mangachan : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
|
var pageNum = 1
|
||||||
|
when {
|
||||||
|
page < 1 -> pageNum = 1
|
||||||
|
page >= 1 -> pageNum = page
|
||||||
|
}
|
||||||
val url = if (query.isNotEmpty()) {
|
val url = if (query.isNotEmpty()) {
|
||||||
"$baseUrl/?do=search&subaction=search&story=$query"
|
"$baseUrl/?do=search&subaction=search&story=$query&search_start=$pageNum"
|
||||||
} else {
|
} else {
|
||||||
val filt = filters.filterIsInstance<Genre>().filter { !it.isIgnored() }
|
val filt = filters.filterIsInstance<Genre>().filter { !it.isIgnored() }
|
||||||
if (filt.isNotEmpty()) {
|
if (filt.isNotEmpty()) {
|
||||||
var genres = ""
|
var genres = ""
|
||||||
filt.forEach { genres += (if (it.isExcluded()) "-" else "") + it.id + '+' }
|
filt.forEach { genres += (if (it.isExcluded()) "-" else "") + it.id + '+' }
|
||||||
"$baseUrl/tags/${genres.dropLast(1)}"
|
"$baseUrl/tags/${genres.dropLast(1)}?offset=${20 * (pageNum - 1)}"
|
||||||
} else {
|
} else {
|
||||||
"$baseUrl/?do=search&subaction=search&story=$query"
|
"$baseUrl/?do=search&subaction=search&story=$query&search_start=$pageNum"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return GET(url, headers)
|
return GET(url, headers)
|
||||||
|
@ -85,28 +90,29 @@ class Mangachan : ParsedHttpSource() {
|
||||||
|
|
||||||
override fun searchMangaParse(response: Response): MangasPage {
|
override fun searchMangaParse(response: Response): MangasPage {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
|
var hasNextPage = false
|
||||||
|
|
||||||
val mangas = document.select(searchMangaSelector()).map { element ->
|
val mangas = document.select(searchMangaSelector()).map { element ->
|
||||||
searchMangaFromElement(element)
|
searchMangaFromElement(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME
|
val nextSearchPage = document.select(searchMangaNextPageSelector())
|
||||||
// val allIgnore = filters.all { it.state == Filter.TriState.STATE_IGNORE }
|
if (nextSearchPage.isNotEmpty()) {
|
||||||
// searchMangaNextPageSelector().let { selector ->
|
val query = document.select("input#searchinput").first().attr("value")
|
||||||
// if (page.nextPageUrl.isNullOrEmpty() && allIgnore) {
|
val pageNum = nextSearchPage.let { selector ->
|
||||||
// val onClick = document.select(selector).first()?.attr("onclick")
|
val onClick = selector.attr("onclick")
|
||||||
// val pageNum = onClick?.substring(23, onClick.indexOf("); return(false)"))
|
onClick?.split("""\\d+""")
|
||||||
// page.nextPageUrl = searchMangaInitialUrl(query, emptyList()) + "&search_start=" + pageNum
|
}
|
||||||
// }
|
nextSearchPage.attr("href", "$baseUrl/?do=search&subaction=search&story=$query&search_start=$pageNum")
|
||||||
// }
|
hasNextPage = true
|
||||||
//
|
}
|
||||||
// searchGenresNextPageSelector().let { selector ->
|
|
||||||
// if (page.nextPageUrl.isNullOrEmpty() && !allIgnore) {
|
|
||||||
// val url = document.select(selector).first()?.attr("href")
|
|
||||||
// page.nextPageUrl = searchMangaInitialUrl(query, filters) + url
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return MangasPage(mangas, false)
|
val nextGenresPage = document.select(searchGenresNextPageSelector())
|
||||||
|
if (nextGenresPage.isNotEmpty()) {
|
||||||
|
hasNextPage = true
|
||||||
|
}
|
||||||
|
|
||||||
|
return MangasPage(mangas, hasNextPage)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document): SManga {
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
|
@ -146,7 +152,7 @@ class Mangachan : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
override fun pageListParse(response: Response): List<Page> {
|
||||||
val html = response.body().string()
|
val html = response.body()!!.string()
|
||||||
val beginIndex = html.indexOf("fullimg\":[") + 10
|
val beginIndex = html.indexOf("fullimg\":[") + 10
|
||||||
val endIndex = html.indexOf(",]", beginIndex)
|
val endIndex = html.indexOf(",]", beginIndex)
|
||||||
val trimmedHtml = html.substring(beginIndex, endIndex).replace("\"", "")
|
val trimmedHtml = html.substring(beginIndex, endIndex).replace("\"", "")
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
pkgNameSuffix = "ru.mintmanga"
|
pkgNameSuffix = "ru.mintmanga"
|
||||||
extClass = '.Mintmanga'
|
extClass = '.Mintmanga'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,11 +102,25 @@ class Mintmanga : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun prepareNewChapter(chapter: SChapter, manga: SManga) {
|
override fun prepareNewChapter(chapter: SChapter, manga: SManga) {
|
||||||
chapter.chapter_number = -2f
|
val basic = Regex("""\s([0-9]+)(\s-\s)([0-9]+)\s*""")
|
||||||
|
val extra = Regex("""\s([0-9]+\sЭкстра)\s*""")
|
||||||
|
val single = Regex("""\sСингл\s*""")
|
||||||
|
when {
|
||||||
|
basic.containsMatchIn(chapter.name) -> {
|
||||||
|
basic.find(chapter.name)?.let {
|
||||||
|
val number = it.groups[3]?.value!!
|
||||||
|
chapter.chapter_number = number.toFloat()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extra.containsMatchIn(chapter.name) -> // Extra chapters doesn't contain chapter number
|
||||||
|
chapter.chapter_number = -2f
|
||||||
|
single.containsMatchIn(chapter.name) -> // Oneshoots, doujinshi and other mangas with one chapter
|
||||||
|
chapter.chapter_number = 1f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
override fun pageListParse(response: Response): List<Page> {
|
||||||
val html = response.body().string()
|
val html = response.body()!!.string()
|
||||||
val beginIndex = html.indexOf("rm_h.init( [")
|
val beginIndex = html.indexOf("rm_h.init( [")
|
||||||
val endIndex = html.indexOf("], 0, false);", beginIndex)
|
val endIndex = html.indexOf("], 0, false);", beginIndex)
|
||||||
val trimmedHtml = html.substring(beginIndex, endIndex)
|
val trimmedHtml = html.substring(beginIndex, endIndex)
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
pkgNameSuffix = "ru.readmanga"
|
pkgNameSuffix = "ru.readmanga"
|
||||||
extClass = '.Readmanga'
|
extClass = '.Readmanga'
|
||||||
extVersionCode = 1
|
extVersionCode = 1
|
||||||
extVersionSuffix = 1
|
extVersionSuffix = 2
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,11 +102,25 @@ class Readmanga : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun prepareNewChapter(chapter: SChapter, manga: SManga) {
|
override fun prepareNewChapter(chapter: SChapter, manga: SManga) {
|
||||||
chapter.chapter_number = -2f
|
val basic = Regex("""\s([0-9]+)(\s-\s)([0-9]+)\s*""")
|
||||||
|
val extra = Regex("""\s([0-9]+\sЭкстра)\s*""")
|
||||||
|
val single = Regex("""\sСингл\s*""")
|
||||||
|
when {
|
||||||
|
basic.containsMatchIn(chapter.name) -> {
|
||||||
|
basic.find(chapter.name)?.let {
|
||||||
|
val number = it.groups[3]?.value!!
|
||||||
|
chapter.chapter_number = number.toFloat()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extra.containsMatchIn(chapter.name) -> // Extra chapters doesn't contain chapter number
|
||||||
|
chapter.chapter_number = -2f
|
||||||
|
single.containsMatchIn(chapter.name) -> // Oneshoots, doujinshi and other mangas with one chapter
|
||||||
|
chapter.chapter_number = 1f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
override fun pageListParse(response: Response): List<Page> {
|
||||||
val html = response.body().string()
|
val html = response.body()!!.string()
|
||||||
val beginIndex = html.indexOf("rm_h.init( [")
|
val beginIndex = html.indexOf("rm_h.init( [")
|
||||||
val endIndex = html.indexOf("], 0, false);", beginIndex)
|
val endIndex = html.indexOf("], 0, false);", beginIndex)
|
||||||
val trimmedHtml = html.substring(beginIndex, endIndex)
|
val trimmedHtml = html.substring(beginIndex, endIndex)
|
||||||
|
|
Loading…
Reference in New Issue