From dfd051d4de48b5a2b0bdec6e4baa6305cc9f695d Mon Sep 17 00:00:00 2001 From: len Date: Fri, 29 Sep 2017 18:40:20 +0200 Subject: [PATCH] Update mangahere catalog --- src/en/mangahere/build.gradle | 6 ++--- .../extension/en/mangahere/Mangahere.kt | 27 ++++++++++++++++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/en/mangahere/build.gradle b/src/en/mangahere/build.gradle index ad004d76a..c69e7bc03 100644 --- a/src/en/mangahere/build.gradle +++ b/src/en/mangahere/build.gradle @@ -5,9 +5,9 @@ ext { appName = 'Tachiyomi: Mangahere' pkgNameSuffix = "en.mangahere" extClass = '.Mangahere' - extVersionCode = 2 - extVersionSuffix = 2 - libVersion = '1.0' + extVersionCode = 3 + extVersionSuffix = 1 + libVersion = '1.2' } apply from: "$rootDir/common.gradle" diff --git a/src/en/mangahere/src/eu/kanade/tachiyomi/extension/en/mangahere/Mangahere.kt b/src/en/mangahere/src/eu/kanade/tachiyomi/extension/en/mangahere/Mangahere.kt index 4bc8b2594..d0705fa23 100644 --- a/src/en/mangahere/src/eu/kanade/tachiyomi/extension/en/mangahere/Mangahere.kt +++ b/src/en/mangahere/src/eu/kanade/tachiyomi/extension/en/mangahere/Mangahere.kt @@ -7,9 +7,13 @@ import okhttp3.HttpUrl import okhttp3.Request import org.jsoup.nodes.Document import org.jsoup.nodes.Element +import java.security.SecureRandom +import java.security.cert.X509Certificate import java.text.ParseException import java.text.SimpleDateFormat import java.util.* +import javax.net.ssl.SSLContext +import javax.net.ssl.X509TrustManager class Mangahere : ParsedHttpSource() { @@ -23,6 +27,26 @@ class Mangahere : ParsedHttpSource() { override val supportsLatest = true + private val trustManager = object : X509TrustManager { + override fun getAcceptedIssuers(): Array { + return emptyArray() + } + + override fun checkClientTrusted(chain: Array, authType: String) { + } + + override fun checkServerTrusted(chain: Array, authType: String) { + } + } + + private val sslContext = SSLContext.getInstance("SSL").apply { + init(null, arrayOf(trustManager), SecureRandom()) + } + + override val client = super.client.newBuilder() + .sslSocketFactory(sslContext.socketFactory, trustManager) + .build() + override fun popularMangaSelector() = "div.directory_list > ul > li" override fun latestUpdatesSelector() = "div.directory_list > ul > li" @@ -159,7 +183,7 @@ class Mangahere : ParsedHttpSource() { val pages = mutableListOf() document.select("select.wid60").first()?.getElementsByTag("option")?.forEach { - pages.add(Page(pages.size, it.attr("value"))) + pages.add(Page(pages.size, "http:" + it.attr("value"))) } pages.getOrNull(0)?.imageUrl = imageUrlParse(document) return pages @@ -174,6 +198,7 @@ class Mangahere : ParsedHttpSource() { private class OrderBy : Filter.Sort("Order by", arrayOf("Series name", "Rating", "Views", "Total chapters", "Last chapter"), Filter.Sort.Selection(2, false)) + private class GenreList(genres: List) : Filter.Group("Genres", genres) override fun getFilterList() = FilterList(