Foolslide (#257)

* foolslide addition

* foolslide addition
This commit is contained in:
Carlos 2018-03-14 12:43:23 -04:00 committed by GitHub
parent b7ab043af4
commit 00e1e62f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 51 additions and 19 deletions

View File

@ -2,9 +2,9 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
ext { ext {
appName = 'Tachiyomi: Jaiminis Box' appName = 'Tachiyomi: FoolSlide'
pkgNameSuffix = "en.jaiminisbox" pkgNameSuffix = "all.foolslide"
extClass = '.JaiminisBox' extClass = '.FoolSlideFactory'
extVersionCode = 1 extVersionCode = 1
extVersionSuffix = 0 extVersionSuffix = 0
libVersion = '1.2' libVersion = '1.2'

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.en.jaiminisbox package eu.kanade.tachiyomi.extension.all.foolslide
import android.util.Base64
import com.github.salomonbrys.kotson.get import com.github.salomonbrys.kotson.get
import com.google.gson.JsonParser import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
@ -17,26 +16,23 @@ import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
class JaiminisBox : ParsedHttpSource() { /**
* Created by Carlos on 3/14/2018.
override val name = "Jaimini's Box" */
open class FoolSlide(override val name: String, override val baseUrl: String, override val lang: String, private val urlModifier: String = "") : ParsedHttpSource() {
override val baseUrl = "https://jaiminisbox.com"
override val lang = "en"
override val supportsLatest = true override val supportsLatest = true
override fun popularMangaSelector() = "div.group" override fun popularMangaSelector() = "div.group"
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/reader/directory/$page/", headers) return GET("$baseUrl$urlModifier/directory/$page/", headers)
} }
override fun latestUpdatesSelector() = "div.group" override fun latestUpdatesSelector() = "div.group"
override fun latestUpdatesRequest(page: Int): Request { override fun latestUpdatesRequest(page: Int): Request {
return GET("$baseUrl/reader/latest/$page/") return GET("$baseUrl$urlModifier/latest/$page/")
} }
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
@ -72,7 +68,7 @@ class JaiminisBox : ParsedHttpSource() {
add("search", query) add("search", query)
} }
return POST("$baseUrl/reader/search/", headers, form.build()) return POST("$baseUrl$urlModifier/search/", headers, form.build())
} }
override fun searchMangaSelector() = "div.group" override fun searchMangaSelector() = "div.group"
@ -122,10 +118,8 @@ class JaiminisBox : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val doc = document.toString() val doc = document.toString()
val jsonstr = doc.substringAfter("var pages = ").substringBefore(";")
val base64Json = doc.substringAfter("JSON.parse(atob(\"").substringBefore("\"));") val json = JsonParser().parse(jsonstr).asJsonArray
val decodeJson = String(Base64.decode(base64Json, Base64.DEFAULT))
val json = JsonParser().parse(decodeJson).asJsonArray
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
json.forEach { json.forEach {
pages.add(Page(pages.size, "", it.get("url").asString)) pages.add(Page(pages.size, "", it.get("url").asString))

View File

@ -0,0 +1,38 @@
package eu.kanade.tachiyomi.extension.all.foolslide
import android.util.Base64
import com.github.salomonbrys.kotson.get
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.Page
import org.jsoup.nodes.Document
/**
* Created by Carlos on 3/14/2018.
*/
class FoolSlideFactory : SourceFactory {
override fun createSources(): List<Source> = getAllFoolSlide()
}
fun getAllFoolSlide(): List<Source> {
return listOf(JaminisBox(), ChampionScans())
}
class JaminisBox : FoolSlide("Jaimini's Box", "https://jaiminisbox.com", "en", "/reader") {
override fun pageListParse(document: Document): List<Page> {
val doc = document.toString()
val base64Json = doc.substringAfter("JSON.parse(atob(\"").substringBefore("\"));")
val decodeJson = String(Base64.decode(base64Json, Base64.DEFAULT))
val json = JsonParser().parse(decodeJson).asJsonArray
val pages = mutableListOf<Page>()
json.forEach {
pages.add(Page(pages.size, "", it.get("url").asString))
}
return pages
}
}
class ChampionScans : FoolSlide("Champion Scans", "http://reader.championscans.com", "en")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB