Lint fixes

This commit is contained in:
arkon 2020-04-24 23:16:31 -04:00 committed by arkon
parent 5e05175f8c
commit 020c2af006
130 changed files with 1765 additions and 1429 deletions

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.en.myhentaicomics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
@ -125,10 +129,10 @@ class MyHentaiComics : ParsedHttpSource() {
override fun getFilterList() = FilterList(
Filter.Header("Cannot combine search types!"),
Filter.Separator("-----------------"),
GenreFilter ()
GenreFilter()
)
private class GenreFilter: UriPartFilter("Genres",
private class GenreFilter : UriPartFilter("Genres",
arrayOf(
Pair("<Choose a genre>", ""),
Pair("3D", "/index.php/tag/2403"),

View File

@ -2,7 +2,12 @@ package eu.kanade.tachiyomi.extension.en.myhentaigallery
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
@ -150,81 +155,81 @@ class MyHentaiGallery : ParsedHttpSource() {
private class GenreFilter : UriPartFilter("Category", arrayOf(
Pair("<select>", "---"),
Pair("3D Comic","3"),
Pair("Ahegao","2740"),
Pair("Anal","2741"),
Pair("Asian","4"),
Pair("Ass Expansion","5"),
Pair("Aunt","6"),
Pair("BBW","7"),
Pair("Beastiality","8"),
Pair("Bimbofication","3430"),
Pair("Bisexual","9"),
Pair("Black & Interracial","10"),
Pair("Body Swap","11"),
Pair("Bondage","12"),
Pair("Breast Expansion","13"),
Pair("Brother","14"),
Pair("Bukakke","15"),
Pair("Catgirl","2742"),
Pair("Cheating","16"),
Pair("Cousin","17"),
Pair("Crossdressing","18"),
Pair("Dad","19"),
Pair("Daughter","20"),
Pair("Dick Growth","21"),
Pair("Ebony","3533"),
Pair("Elf","2744"),
Pair("Exhibitionism","2745"),
Pair("Father","22"),
Pair("Femdom","23"),
Pair("Foot Fetish","3253"),
Pair("Furry","24"),
Pair("Futanari & Shemale & Dickgirl","25"),
Pair("Futanari X Female","3416"),
Pair("Futanari X Futanari","3415"),
Pair("Futanari X Male","26"),
Pair("Gangbang","27"),
Pair("Gay & Yaoi","28"),
Pair("Gender Bending","29"),
Pair("Giantess","30"),
Pair("Gloryhole","31"),
Pair("Hairy Female","3418"),
Pair("Hardcore","36"),
Pair("Harem","37"),
Pair("Incest","38"),
Pair("Inseki","3417"),
Pair("Kemonomimi","3368"),
Pair("Lactation","39"),
Pair("Lesbian & Yuri & Girls Only","40"),
Pair("Milf","41"),
Pair("Mind Break","3419"),
Pair("Mind Control & Hypnosis","42"),
Pair("Mom","43"),
Pair("Mother","44"),
Pair("Muscle Girl","45"),
Pair("Muscle Growth","46"),
Pair("Nephew","47"),
Pair("Niece","48"),
Pair("Orgy","49"),
Pair("Pegging","50"),
Pair("Possession","51"),
Pair("Pregnant & Impregnation","52"),
Pair("Rape","53"),
Pair("Sister","54"),
Pair("Solo","2746"),
Pair("Son","55"),
Pair("Spanking","56"),
Pair("Stomach Bulge","57"),
Pair("Strap-On","58"),
Pair("Superheroes","59"),
Pair("Tentacles","60"),
Pair("Threesome","61"),
Pair("Transformation","62"),
Pair("Uncle","63"),
Pair("Urination","64"),
Pair("Vore","65"),
Pair("Weight Gain","66")
Pair("3D Comic", "3"),
Pair("Ahegao", "2740"),
Pair("Anal", "2741"),
Pair("Asian", "4"),
Pair("Ass Expansion", "5"),
Pair("Aunt", "6"),
Pair("BBW", "7"),
Pair("Beastiality", "8"),
Pair("Bimbofication", "3430"),
Pair("Bisexual", "9"),
Pair("Black & Interracial", "10"),
Pair("Body Swap", "11"),
Pair("Bondage", "12"),
Pair("Breast Expansion", "13"),
Pair("Brother", "14"),
Pair("Bukakke", "15"),
Pair("Catgirl", "2742"),
Pair("Cheating", "16"),
Pair("Cousin", "17"),
Pair("Crossdressing", "18"),
Pair("Dad", "19"),
Pair("Daughter", "20"),
Pair("Dick Growth", "21"),
Pair("Ebony", "3533"),
Pair("Elf", "2744"),
Pair("Exhibitionism", "2745"),
Pair("Father", "22"),
Pair("Femdom", "23"),
Pair("Foot Fetish", "3253"),
Pair("Furry", "24"),
Pair("Futanari & Shemale & Dickgirl", "25"),
Pair("Futanari X Female", "3416"),
Pair("Futanari X Futanari", "3415"),
Pair("Futanari X Male", "26"),
Pair("Gangbang", "27"),
Pair("Gay & Yaoi", "28"),
Pair("Gender Bending", "29"),
Pair("Giantess", "30"),
Pair("Gloryhole", "31"),
Pair("Hairy Female", "3418"),
Pair("Hardcore", "36"),
Pair("Harem", "37"),
Pair("Incest", "38"),
Pair("Inseki", "3417"),
Pair("Kemonomimi", "3368"),
Pair("Lactation", "39"),
Pair("Lesbian & Yuri & Girls Only", "40"),
Pair("Milf", "41"),
Pair("Mind Break", "3419"),
Pair("Mind Control & Hypnosis", "42"),
Pair("Mom", "43"),
Pair("Mother", "44"),
Pair("Muscle Girl", "45"),
Pair("Muscle Growth", "46"),
Pair("Nephew", "47"),
Pair("Niece", "48"),
Pair("Orgy", "49"),
Pair("Pegging", "50"),
Pair("Possession", "51"),
Pair("Pregnant & Impregnation", "52"),
Pair("Rape", "53"),
Pair("Sister", "54"),
Pair("Solo", "2746"),
Pair("Son", "55"),
Pair("Spanking", "56"),
Pair("Stomach Bulge", "57"),
Pair("Strap-On", "58"),
Pair("Superheroes", "59"),
Pair("Tentacles", "60"),
Pair("Threesome", "61"),
Pair("Transformation", "62"),
Pair("Uncle", "63"),
Pair("Urination", "64"),
Pair("Vore", "65"),
Pair("Weight Gain", "66")
))
private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :

View File

@ -1,13 +1,17 @@
package eu.kanade.tachiyomi.extension.en.oglaf
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Request
import okhttp3.Response
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import org.jsoup.Jsoup
class Oglaf : ParsedHttpSource() {
@ -94,5 +98,4 @@ class Oglaf : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used")
override fun latestUpdatesSelector(): String = throw Exception("Not used")
}

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.en.patchfriday
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
@ -69,7 +73,7 @@ class PatchFriday : HttpSource() {
val last = response.asJsoup().select("ul.strip_toolbar li a[rel=next]").attr("href")
.removeSurrounding("/").toInt()
return listOf(1 .. last).flatten().reversed().map {
return listOf(1..last).flatten().reversed().map {
SChapter.create().apply {
name = "#$it - "
url = "/$it/"

View File

@ -1,15 +1,20 @@
package eu.kanade.tachiyomi.extension.en.perveden
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
class Perveden : ParsedHttpSource() {

View File

@ -1,7 +1,12 @@
package eu.kanade.tachiyomi.extension.en.pururin
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
@ -62,7 +67,7 @@ class Pururin : ParsedHttpSource() {
manga.thumbnail_url = document.select("div.cover-wrapper v-lazy-image").attr("abs:src")
var tags = ""
genres.forEach { tags+= " <$it>" }
genres.forEach { tags += " <$it>" }
manga.description = "Title: " + manga.title + "\n\n" + getDesc(document) + tags
@ -76,7 +81,6 @@ class Pururin : ParsedHttpSource() {
val parodies = infoElement.select("tr:has(td:contains(Parody)) a").text()
val pagess = infoElement.select("tr:has(td:contains(Pages)) td:eq(1)").text()
if (magazine.isNotEmpty()) {
stringBuilder.append("Magazine: ")
stringBuilder.append(magazine)
@ -98,7 +102,7 @@ class Pururin : ParsedHttpSource() {
override fun chapterListSelector() = "div.gallery-action a"
//TODO Make it work for collections
// TODO Make it work for collections
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
@ -116,8 +120,8 @@ class Pururin : ParsedHttpSource() {
val id = galleryInfo.substringAfter("id&quot;:").substringBefore(',')
val total: Int = (galleryInfo.substringAfter("total_pages&quot;:").substringBefore(',')).toInt()
for (i in 1 .. total) {
pages.add(Page(i,"", "https://cdn.pururin.io/assets/images/data/$id/$i.jpg"))
for (i in 1..total) {
pages.add(Page(i, "", "https://cdn.pururin.io/assets/images/data/$id/$i.jpg"))
}
return pages
@ -185,4 +189,3 @@ class Pururin : ParsedHttpSource() {
private class Tag(name: String) : Filter.Text(name)
}

View File

@ -1,6 +1,10 @@
package eu.kanade.tachiyomi.extension.en.questionablecontent
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Request
import okhttp3.Response
@ -83,5 +87,4 @@ class QuestionableContent : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used")
override fun latestUpdatesSelector(): String = throw Exception("Not used")
}

View File

@ -7,8 +7,15 @@ import android.support.v7.preference.PreferenceScreen
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.regex.Pattern
import okhttp3.FormBody
import okhttp3.OkHttpClient
import okhttp3.Request
@ -17,9 +24,6 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.regex.Pattern
class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
@ -224,8 +228,6 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
screen.addPreference(qualitypref)
}
override fun setupPreferenceScreen(screen: PreferenceScreen) {
val qualitypref = ListPreference(screen.context).apply {
key = QUALITY_PREF_Title

View File

@ -8,17 +8,17 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.util.Calendar
import java.util.concurrent.TimeUnit
import okhttp3.FormBody
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.Calendar
import java.util.concurrent.TimeUnit
class ReadM : ParsedHttpSource() {
//Info
// Info
override val name: String = "ReadM"
override val baseUrl: String = "https://readm.org"
override val lang: String = "en"
@ -30,7 +30,7 @@ class ReadM : ParsedHttpSource() {
.followRedirects(true)
.build()
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/popular-manga/$page", headers)
override fun popularMangaNextPageSelector(): String? = "div.pagination a:contains(»)"
@ -41,10 +41,9 @@ class ReadM : ParsedHttpSource() {
title = this.text().trim()
url = this.attr("href")
}
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/latest-releases/$page", headers)
override fun latestUpdatesNextPageSelector(): String? = popularMangaNextPageSelector()
@ -57,7 +56,7 @@ class ReadM : ParsedHttpSource() {
}
}
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val formBody = FormBody.Builder()
@ -83,12 +82,11 @@ class ReadM : ParsedHttpSource() {
return POST("$baseUrl/service/advanced_search", searchHeaders, formBody.build())
}
override fun searchMangaNextPageSelector(): String? = null
override fun searchMangaSelector(): String = "div.poster-with-subject"
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
//Details
// Details
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
thumbnail_url = document.select("img.series-profile-thumb").attr("abs:src")
@ -99,7 +97,7 @@ class ReadM : ParsedHttpSource() {
genre = document.select("div.series-summary-wrapper div.item a").joinToString(", ") { it.text().trim() }
}
//Chapters
// Chapters
override fun chapterListSelector(): String = "div.season_start"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
@ -142,14 +140,14 @@ class ReadM : ParsedHttpSource() {
return 0L
}
//Pages
// Pages
override fun imageUrlParse(document: Document): String = throw Exception("Not Used")
override fun pageListParse(document: Document): List<Page> = document.select("div.ch-images img").mapIndexed { index, element ->
Page(index, "", element.attr("abs:src"))
}
//Filters
// Filters
override fun getFilterList(): FilterList = FilterList(
TypeFilter(typeArray),
@ -166,7 +164,6 @@ class ReadM : ParsedHttpSource() {
private class GenreFilter(state: List<Tag>) : Filter.Group<Tag>("Genres", state)
private class Tag(name: String, val id: String) : Filter.TriState(name)
private val typeArray = arrayOf(
Pair("All", "all"),
Pair("Japanese Manga", "japanese"),
@ -221,6 +218,4 @@ class ReadM : ParsedHttpSource() {
Tag("Yaoi", "28"),
Tag("Yuri", "20")
).sortedWith(compareBy { it.name })
}

View File

@ -2,14 +2,18 @@ package eu.kanade.tachiyomi.extension.en.readmangatoday
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.util.Calendar
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.*
class Readmangatoday : ParsedHttpSource() {
@ -165,7 +169,7 @@ class Readmangatoday : ParsedHttpSource() {
}
override fun pageListParse(document: Document): List<Page> {
return document.select("div.content-list > img").mapIndexed{ i, img ->
return document.select("div.content-list > img").mapIndexed { i, img ->
Page(i, "", img.attr("abs:src"))
}
}

View File

@ -1,18 +1,23 @@
package eu.kanade.tachiyomi.extension.en.renascans
import com.github.salomonbrys.kotson.fromJson
import com.github.salomonbrys.kotson.get
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
import com.github.salomonbrys.kotson.*
import com.google.gson.Gson
import com.google.gson.JsonObject
class Renascans : ParsedHttpSource() {
@ -146,5 +151,4 @@ class Renascans : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -1,15 +1,19 @@
package eu.kanade.tachiyomi.extension.en.sleepypandascans
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.util.Calendar
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.Calendar
class SleepyPandaScans : ParsedHttpSource() {
@ -125,7 +129,7 @@ class SleepyPandaScans : ParsedHttpSource() {
val calendar = Calendar.getInstance()
if (date.contains("yesterday")) {
calendar.apply{add(Calendar.DAY_OF_MONTH, -1)}
calendar.apply { add(Calendar.DAY_OF_MONTH, -1) }
} else {
val trimmedDate = date.replace("one", "1").removeSuffix("s").split(" ")
@ -149,5 +153,4 @@ class SleepyPandaScans : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.extension.en.tapastic
import android.net.Uri
import android.util.Log
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
@ -10,22 +9,22 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class Tapastic : ParsedHttpSource() {
//Info
// Info
override val lang = "en"
override val supportsLatest = true
override val name = "Tapastic"
override val baseUrl = "https://tapas.io"
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/comics?b=POPULAR&g=&f=NONE&pageNumber=$page&pageSize=20&")
@ -38,7 +37,7 @@ class Tapastic : ParsedHttpSource() {
thumbnail_url = element.select(".item__thumb img").attr("src")
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request =
GET("$baseUrl/comics?b=FRESH&g=&f=NONE&pageNumber=$page&pageSize=20&")
@ -48,10 +47,10 @@ class Tapastic : ParsedHttpSource() {
override fun latestUpdatesFromElement(element: Element): SManga =
popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
//If there is any search text, use text search, otherwise use filter search
// If there is any search text, use text search, otherwise use filter search
val uri = if (query.isNotBlank()) {
Uri.parse("$baseUrl/search")
.buildUpon()
@ -59,14 +58,14 @@ class Tapastic : ParsedHttpSource() {
.appendQueryParameter("q", query)
} else {
val uri = Uri.parse("$baseUrl/comics").buildUpon()
//Append uri filters
// Append uri filters
filters.forEach {
if (it is UriFilter)
it.addToUri(uri)
}
uri
}
//Append page number
// Append page number
uri.appendQueryParameter("pageNumber", page.toString())
return GET(uri.toString())
}
@ -86,7 +85,7 @@ class Tapastic : ParsedHttpSource() {
thumbnail_url = element.select(".item__thumb img, .thumb-wrap img").attr("src")
}
//Details
// Details
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
title = document.select(".desc__title").text().trim()
@ -98,7 +97,7 @@ class Tapastic : ParsedHttpSource() {
thumbnail_url = document.select("div.header__thumb img").attr("src")
}
//Chapters
// Chapters
override fun chapterListRequest(manga: SManga): Request {
return GET(baseUrl + manga.url + "?sort_order=desc", headers)
@ -144,7 +143,7 @@ class Tapastic : ParsedHttpSource() {
return SimpleDateFormat("MMM dd, yyyy", Locale.US).parse(date)?.time ?: 0
}
//Pages
// Pages
override fun pageListRequest(chapter: SChapter): Request {
if (chapter.url == "locked") throw Exception("Chapter Locked. If logged in, refresh chapter list.")
@ -160,10 +159,10 @@ class Tapastic : ParsedHttpSource() {
override fun imageUrlParse(document: Document) =
throw UnsupportedOperationException("This method should not be called!")
//Filters
// Filters
override fun getFilterList() = FilterList(
//Tapastic does not support genre filtering and text search at the same time
// Tapastic does not support genre filtering and text search at the same time
Filter.Header("NOTE: Ignored if using text search!"),
Filter.Separator(),
FilterFilter(),
@ -225,9 +224,11 @@ class Tapastic : ParsedHttpSource() {
* If an entry is selected it is appended as a query parameter onto the end of the URI.
* If `firstIsUnspecified` is set to true, if the first entry is selected, nothing will be appended on the the URI.
*/
//vals: <name, display>
// vals: <name, display>
private open class UriSelectFilter(
displayName: String, val uriParam: String, val vals: Array<Pair<String, String>>,
displayName: String,
val uriParam: String,
val vals: Array<Pair<String, String>>,
val firstIsUnspecified: Boolean = true,
defaultValue: Int = 0
) :

View File

@ -5,13 +5,18 @@ import com.github.salomonbrys.kotson.get
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.extension.en.tsumino.TsuminoUtils.Companion.getArtists
import eu.kanade.tachiyomi.extension.en.tsumino.TsuminoUtils.Companion.getCollection
import eu.kanade.tachiyomi.extension.en.tsumino.TsuminoUtils.Companion.getChapter
import eu.kanade.tachiyomi.extension.en.tsumino.TsuminoUtils.Companion.getCollection
import eu.kanade.tachiyomi.extension.en.tsumino.TsuminoUtils.Companion.getDesc
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.FormBody
@ -22,7 +27,7 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
class Tsumino: ParsedHttpSource() {
class Tsumino : ParsedHttpSource() {
override val name = "Tsumino"
@ -96,7 +101,7 @@ class Tsumino: ParsedHttpSource() {
add("Tags[$index][Exclude]", entry.exclude.toString())
}
if(f.filterIsInstance<ExcludeParodiesFilter>().first().state)
if (f.filterIsInstance<ExcludeParodiesFilter>().first().state)
add("Exclude[]", "6")
}
.build()
@ -231,7 +236,7 @@ class Tsumino: ParsedHttpSource() {
class SortFilter : Filter.Select<SortType>("Sort by", SortType.values())
class LengthFilter : Filter.Select<LengthType>("Length", LengthType.values())
class MinimumRatingFilter : Filter.Select<String>("Minimum rating", (0 .. 5).map { "$it stars" }.toTypedArray())
class MinimumRatingFilter : Filter.Select<String>("Minimum rating", (0..5).map { "$it stars" }.toTypedArray())
class ExcludeParodiesFilter : Filter.CheckBox("Exclude parodies")
enum class SortType {

View File

@ -100,8 +100,8 @@ class TsuminoUtils {
name = "Chapter"
scanlator = getGroups(document)
chapter_number = 1f
url = response.request().url().encodedPath().
replace("entry", "Read/Index")
url = response.request().url().encodedPath()
.replace("entry", "Read/Index")
}
chapterList.add(chapter)
return chapterList

View File

@ -4,7 +4,11 @@ import android.os.Build.VERSION
import eu.kanade.tachiyomi.extension.BuildConfig
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.Response

View File

@ -1,7 +1,12 @@
package eu.kanade.tachiyomi.extension.en.webcomics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.HttpUrl
@ -9,7 +14,6 @@ import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.lang.UnsupportedOperationException
class Webcomics : ParsedHttpSource() {

View File

@ -5,13 +5,17 @@ import com.github.salomonbrys.kotson.get
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.OkHttpClient
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.RequestBody
import okhttp3.Response
class Wutopia : HttpSource() {
@ -129,5 +133,4 @@ class Wutopia : HttpSource() {
override fun imageUrlParse(response: Response): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -1,14 +1,18 @@
package eu.kanade.tachiyomi.extension.en.xkcd
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.SimpleDateFormat
import java.util.Locale
class Xkcd : ParsedHttpSource() {
@ -129,5 +133,4 @@ class Xkcd : ParsedHttpSource() {
const val baseAltTextUrl = "https://fakeimg.pl/1500x2126/ffffff/000000/?text="
const val baseAltTextPostUrl = "&font_size=42&font=museo"
}
}

View File

@ -11,13 +11,13 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
open class DoujinYang : ParsedHttpSource() {
@ -35,7 +35,6 @@ open class DoujinYang : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = "nav#paginacion a:contains(Última)"
override fun searchMangaNextPageSelector() = latestUpdatesNextPageSelector()
override fun popularMangaRequest(page: Int) =
GET("$baseUrl/directorio/?orden=visitas&p=$page", headers)
@ -46,7 +45,7 @@ open class DoujinYang : ParsedHttpSource() {
.appendQueryParameter("s", query)
} else {
val uri = Uri.parse("$baseUrl/directorio").buildUpon()
//Append uri filters
// Append uri filters
filters.forEach {
if (it is UriFilter)
it.addToUri(uri)
@ -56,8 +55,8 @@ open class DoujinYang : ParsedHttpSource() {
return GET(uri.toString(), headers)
}
//override fun mangaDetailsRequest(manga: SManga) = GET(baseUrl + manga.url, headers)
//override fun pageListRequest(chapter: SChapter) = GET(baseUrl + chapter.url, headers)
// override fun mangaDetailsRequest(manga: SManga) = GET(baseUrl + manga.url, headers)
// override fun pageListRequest(chapter: SChapter) = GET(baseUrl + chapter.url, headers)
override fun chapterListRequest(manga: SManga): Request {
return GET(baseUrl + manga.url, headers)
@ -88,12 +87,11 @@ open class DoujinYang : ParsedHttpSource() {
val manga = SManga.create()
manga.setUrlWithoutDomain(element.select("a").first().attr("abs:href"))
manga.title = element.select("h2").text().trim()
//manga.thumbnail_url = "https:" + element.select("img").attr("src")
// manga.thumbnail_url = "https:" + element.select("img").attr("src")
manga.thumbnail_url = element.select("img").attr("abs:src")
return manga
}
override fun chapterListParse(response: Response): List<SChapter> {
return response.asJsoup().select("div#c_list a").map { element ->
SChapter.create().apply {
@ -123,7 +121,7 @@ open class DoujinYang : ParsedHttpSource() {
manga.genre = glist.joinToString(", ")
manga.status = when (document.select("span[id=desarrollo]")?.first()?.text()) {
"En desarrollo" -> SManga.ONGOING
//"Completed" -> SManga.COMPLETED
// "Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
return manga
@ -296,7 +294,7 @@ open class DoujinYang : ParsedHttpSource() {
* If an entry is selected it is appended as a query parameter onto the end of the URI.
* If `firstIsUnspecified` is set to true, if the first entry is selected, nothing will be appended on the the URI.
*/
//vals: <name, display>
// vals: <name, display>
open class UriPartFilter(
displayName: String,
private val uriParam: String,
@ -330,4 +328,3 @@ open class DoujinYang : ParsedHttpSource() {
fun addToUri(uri: Uri.Builder)
}
}

View File

@ -1,13 +1,25 @@
package eu.kanade.tachiyomi.extension.es.heavenmanga
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import rx.Observable
class HeavenManga : ParsedHttpSource() {
@ -55,28 +67,27 @@ class HeavenManga : ParsedHttpSource() {
val ext = ".html"
var name: String
filters.forEach { filter ->
when(filter) {
when (filter) {
is GenreFilter -> {
if(filter.toUriPart().isNotBlank() && filter.state != 0) {
if (filter.toUriPart().isNotBlank() && filter.state != 0) {
name = filter.toUriPart()
return GET("$baseUrl/genero/$name$ext$pageParameter", headers)
}
}
is AlphabeticoFilter -> {
if(filter.toUriPart().isNotBlank() && filter.state != 0) {
if (filter.toUriPart().isNotBlank() && filter.state != 0) {
name = filter.toUriPart()
return GET("$baseUrl/letra/$name$ext$pageParameter", headers)
}
}
is ListaCompletasFilter -> {
if(filter.toUriPart().isNotBlank() && filter.state != 0) {
if (filter.toUriPart().isNotBlank() && filter.state != 0) {
name = filter.toUriPart()
return GET("$baseUrl/$name$pageParameter", headers)
}
}
}
}
}
return GET(searchUrl, headers)
@ -123,6 +134,7 @@ class HeavenManga : ParsedHttpSource() {
setUrlWithoutDomain(it.attr("href"))
}
scanlator = element.select("span.pull-right").text()
}
}
@ -277,7 +289,7 @@ class HeavenManga : ParsedHttpSource() {
* Array.from(document.querySelectorAll('#t li a')).map(a => `Pair("${a.textContent}", "${a.getAttribute('href')}")`).join(',\n')
* on https://heavenmanga.com/top/
* */
private class ListaCompletasFilter: UriPartFilter("Lista Completa", arrayOf(
private class ListaCompletasFilter : UriPartFilter("Lista Completa", arrayOf(
Pair("Todo", ""),
Pair("Lista Comis", "comic"),
Pair("Lista Novelas", "novela"),
@ -294,10 +306,8 @@ class HeavenManga : ParsedHttpSource() {
ListaCompletasFilter()
)
private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second
}
}

View File

@ -41,7 +41,7 @@ class Ikuhentai : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaFromElement(element: Element):SManga {
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.thumbnail_url = element.select("div.col-4.col-sm-2.col-md-2 > div > a > img").attr("data-src")
element.select("div.tab-thumb > a").first().let {
@ -53,16 +53,16 @@ class Ikuhentai : ParsedHttpSource() {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = HttpUrl.parse("$baseUrl/page/$page")!!.newBuilder()
url.addQueryParameter("post_type","wp-manga")
url.addQueryParameter("post_type", "wp-manga")
val pattern = "\\s+".toRegex()
val q = query.replace(pattern, "+")
if(query.length > 0){
if (query.length > 0) {
url.addQueryParameter("s", q)
}else{
} else {
url.addQueryParameter("s", "")
}
var orderBy = ""
var orderBy: String
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
when (filter) {
@ -74,29 +74,29 @@ class Ikuhentai : ParsedHttpSource() {
genreInclude.add(it.id)
}
}
if(genreInclude.isNotEmpty()){
genreInclude.forEach{ genre ->
if (genreInclude.isNotEmpty()) {
genreInclude.forEach { genre ->
url.addQueryParameter("genre[]", genre)
}
}
}
is StatusList ->{
is StatusList -> {
val statuses = mutableListOf<String>()
filter.state.forEach {
if (it.state == 1) {
statuses.add(it.id)
}
}
if(statuses.isNotEmpty()){
statuses.forEach{ status ->
if (statuses.isNotEmpty()) {
statuses.forEach { status ->
url.addQueryParameter("status[]", status)
}
}
}
is SortBy -> {
orderBy = filter.toUriPart();
url.addQueryParameter("m_orderby",orderBy)
orderBy = filter.toUriPart()
url.addQueryParameter("m_orderby", orderBy)
}
is TextField -> url.addQueryParameter(filter.key, filter.state)
}
@ -105,8 +105,6 @@ class Ikuhentai : ParsedHttpSource() {
return GET(url.toString(), headers)
}
// max 200 results
override fun mangaDetailsParse(document: Document): SManga {
@ -121,7 +119,7 @@ class Ikuhentai : ParsedHttpSource() {
val genre = element.text()
genres.add(genre)
}
manga.genre =genres.joinToString(", ")
manga.genre = genres.joinToString(", ")
manga.status = parseStatus(infoElement.select("div.post-status > div:nth-child(2) > div.summary-content").text())
manga.description = document.select("div.description-summary")?.text()
@ -142,7 +140,7 @@ class Ikuhentai : ParsedHttpSource() {
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()
var url = urlElement.attr("href")
url = url.replace("/p/1","")
url = url.replace("/p/1", "")
url += "?style=list"
val chapter = SChapter.create()
chapter.setUrlWithoutDomain(url)
@ -168,7 +166,7 @@ class Ikuhentai : ParsedHttpSource() {
document.select("div.reading-content * img").forEach { element ->
val url = element.attr("data-src")
i++
if(url.length != 0){
if (url.length != 0) {
pages.add(Page(i, "", url))
}
}
@ -210,59 +208,58 @@ class Ikuhentai : ParsedHttpSource() {
GenreList(getGenreList())
)
private fun getStatusList() = listOf(
Status("Completado","end"),
Status("En emisión","on-going"),
Status("Cancelado","canceled"),
Status("Pausado","on-hold")
Status("Completado", "end"),
Status("En emisión", "on-going"),
Status("Cancelado", "canceled"),
Status("Pausado", "on-hold")
)
private fun getGenreList() = listOf(
Genre("Ahegao","ahegao"),
Genre("Anal","anal"),
Genre("Bestiality","bestialidad"),
Genre("Bondage","bondage"),
Genre("Bukkake","bukkake"),
Genre("Chicas monstruo","chicas-monstruo"),
Genre("Chikan","chikan"),
Genre("Colegialas","colegialas"),
Genre("Comics porno","comics-porno"),
Genre("Dark Skin","dark-skin"),
Genre("Demonios","demonios"),
Genre("Ecchi","ecchi"),
Genre("Embarazadas","embarazadas"),
Genre("Enfermeras","enfermeras"),
Genre("Eroges","eroges"),
Genre("Fantasía","fantasia"),
Genre("Futanari","futanari"),
Genre("Gangbang","gangbang"),
Genre("Gemelas","gemelas"),
Genre("Gender Bender","gender-bender"),
Genre("Gore","gore"),
Genre("Handjob","handjob"),
Genre("Harem","harem"),
Genre("Hipnosis","hipnosis"),
Genre("Incesto","incesto"),
Genre("Loli","loli"),
Genre("Maids","maids"),
Genre("Masturbación","masturbacion"),
Genre("Milf","milf"),
Genre("Mind Break","mind-break"),
Genre("My Hero Academia","my-hero-academia"),
Genre("Naruto","naruto"),
Genre("Netorare","netorare"),
Genre("Paizuri","paizuri"),
Genre("Pokemon","pokemon"),
Genre("Profesora","profesora"),
Genre("Prostitución","prostitucion"),
Genre("Romance","romance"),
Genre("Straight Shota","straight-shota"),
Genre("Tentáculos","tentaculos"),
Genre("Virgen","virgen"),
Genre("Yaoi","yaoi"),
Genre("Yuri","yuri")
Genre("Ahegao", "ahegao"),
Genre("Anal", "anal"),
Genre("Bestiality", "bestialidad"),
Genre("Bondage", "bondage"),
Genre("Bukkake", "bukkake"),
Genre("Chicas monstruo", "chicas-monstruo"),
Genre("Chikan", "chikan"),
Genre("Colegialas", "colegialas"),
Genre("Comics porno", "comics-porno"),
Genre("Dark Skin", "dark-skin"),
Genre("Demonios", "demonios"),
Genre("Ecchi", "ecchi"),
Genre("Embarazadas", "embarazadas"),
Genre("Enfermeras", "enfermeras"),
Genre("Eroges", "eroges"),
Genre("Fantasía", "fantasia"),
Genre("Futanari", "futanari"),
Genre("Gangbang", "gangbang"),
Genre("Gemelas", "gemelas"),
Genre("Gender Bender", "gender-bender"),
Genre("Gore", "gore"),
Genre("Handjob", "handjob"),
Genre("Harem", "harem"),
Genre("Hipnosis", "hipnosis"),
Genre("Incesto", "incesto"),
Genre("Loli", "loli"),
Genre("Maids", "maids"),
Genre("Masturbación", "masturbacion"),
Genre("Milf", "milf"),
Genre("Mind Break", "mind-break"),
Genre("My Hero Academia", "my-hero-academia"),
Genre("Naruto", "naruto"),
Genre("Netorare", "netorare"),
Genre("Paizuri", "paizuri"),
Genre("Pokemon", "pokemon"),
Genre("Profesora", "profesora"),
Genre("Prostitución", "prostitucion"),
Genre("Romance", "romance"),
Genre("Straight Shota", "straight-shota"),
Genre("Tentáculos", "tentaculos"),
Genre("Virgen", "virgen"),
Genre("Yaoi", "yaoi"),
Genre("Yuri", "yuri")
)
private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second
}
}

View File

@ -8,17 +8,21 @@ import com.google.gson.JsonElement
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.RequestBody
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class InManga : ParsedHttpSource() {

View File

@ -2,26 +2,37 @@ package eu.kanade.tachiyomi.extension.es.lectormanga
import android.app.Application
import android.content.SharedPreferences
import android.support.v7.preference.*
import android.support.v7.preference.ListPreference
import android.support.v7.preference.PreferenceScreen
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.TimeZone
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.*
/**
* Note: this source is similar to TuMangaOnline.
*/
class LectorManga : ConfigurableSource, ParsedHttpSource() {
//Info
// Info
override val name = "LectorManga"
override val baseUrl = "https://lectormanga.com"
@ -49,7 +60,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
.toString()
}
//Popular
// Popular
override fun popularMangaRequest(page: Int) = GET("$baseUrl/library?order_item=likes_count&order_dir=desc&type=&filter_by=title&page=$page", headers)
override fun popularMangaNextPageSelector() = ".pagination .page-item:not(.disabled) a[rel='next']"
@ -60,15 +71,14 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
thumbnail_url = element.select("img").attr("src")
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/library?order_item=creation&order_dir=desc&page=$page", headers)
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = HttpUrl.parse("$baseUrl/library")!!.newBuilder()
@ -139,7 +149,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
//Details
// Details
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
genre = document.select("a.py-2").joinToString(", ") {
@ -156,10 +166,10 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
else -> SManga.UNKNOWN
}
//Chapters
// Chapters
override fun chapterListParse(response: Response): List<SChapter> = mutableListOf<SChapter>().apply {
time = serverTime() //Get time when the chapter page is opened
time = serverTime() // Get time when the chapter page is opened
val document = response.asJsoup()
val chapterUrl = response.request().url().toString()
@ -213,26 +223,26 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
.parse(date)?.time ?: 0
}
//Utilities
// Utilities
private var time = serverTime() //Grab time at app launch, can be updated
private var time = serverTime() // Grab time at app launch, can be updated
private fun serverTime(): String {
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US)
formatter.timeZone = TimeZone.getTimeZone("GMT+1") //Convert time to match server
formatter.timeZone = TimeZone.getTimeZone("GMT+1") // Convert time to match server
return formatter.format(Date())
}
//Pages
// Pages
override fun pageListRequest(chapter: SChapter): Request {
val (chapterURL, chapterID) = chapter.url.split("#")
val response = client.newCall(GET(chapterURL, headers)).execute() //Get chapter page for current token
val response = client.newCall(GET(chapterURL, headers)).execute() // Get chapter page for current token
if (!response.isSuccessful) throw Exception("Lector Manga HTTP Error ${response.code()}")
val document = response.asJsoup()
val getUrl = document.select("form#$chapterID").attr("action") + "/$time" //Get redirect URL
val token = document.select("form#$chapterID input").attr("value") //Get token
val method = document.select("form#$chapterID").attr("method") //Check POST or GET
time = serverTime() //Update time for next chapter
val getUrl = document.select("form#$chapterID").attr("action") + "/$time" // Get redirect URL
val token = document.select("form#$chapterID input").attr("value") // Get token
val method = document.select("form#$chapterID").attr("method") // Check POST or GET
time = serverTime() // Update time for next chapter
val getHeaders = headersBuilder()
.add("User-Agent", userAgent)
@ -275,7 +285,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
}
} else {
val pageList = document.select("#viewer-pages-select").first().select("option").map { it.attr("value").toInt() }
val url = document.baseUri().substringBefore("/paginated") //Accounts for url ending in number "/paginated/1"
val url = document.baseUri().substringBefore("/paginated") // Accounts for url ending in number "/paginated/1"
pageList.forEach {
add(Page(it, "$url/paginated/$it"))
}
@ -284,7 +294,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = document.select("img.viewer-image").attr("src")
//Filters
// Filters
private class Types : UriPartFilter("Filtrar por tipo", arrayOf(
Pair("Ver todo", ""),

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.es.mangamx
import android.net.Uri
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.string
@ -8,20 +7,25 @@ import com.google.gson.JsonElement
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.FormBody
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
open class MangaMx : ParsedHttpSource() {
//Info
// Info
override val name = "MangaMx"
override val baseUrl = "https://manga-mx.com"
@ -29,7 +33,7 @@ open class MangaMx : ParsedHttpSource() {
override val supportsLatest = true
private var csrfToken = ""
//Popular
// Popular
override fun popularMangaRequest(page: Int) =
GET("$baseUrl/directorio?filtro=visitas&p=$page", headers)
@ -57,7 +61,7 @@ open class MangaMx : ParsedHttpSource() {
return MangasPage(mangas, hasNextPage)
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/recientes?p=$page", headers)
override fun latestUpdatesNextPageSelector(): String? = popularMangaNextPageSelector()
@ -70,7 +74,7 @@ open class MangaMx : ParsedHttpSource() {
}
}
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
if (query.isNotBlank()) {
@ -83,7 +87,7 @@ open class MangaMx : ParsedHttpSource() {
return POST("$baseUrl/buscar", searchHeaders, formBody)
} else {
val uri = Uri.parse("$baseUrl/directorio").buildUpon()
//Append uri filters
// Append uri filters
for (filter in filters) {
when (filter) {
is StatusFilter -> uri.appendQueryParameter(
@ -146,7 +150,7 @@ open class MangaMx : ParsedHttpSource() {
thumbnail_url = jsonElement["img"].string.replace("/thumb", "/cover")
}
//Details
// Details
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
@ -161,13 +165,13 @@ open class MangaMx : ParsedHttpSource() {
manga.genre = document.select("div#categ a").joinToString(", ") { it.text() }
manga.status = when (document.select("span#desarrollo")?.first()?.text()) {
"En desarrollo" -> SManga.ONGOING
//"Completed" -> SManga.COMPLETED
// "Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
return manga
}
//Chapters
// Chapters
override fun chapterListSelector(): String = "div#c_list a"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
@ -181,7 +185,7 @@ open class MangaMx : ParsedHttpSource() {
return SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).parse(date)?.time ?: 0
}
//Pages
// Pages
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
val script = document.select("script:containsData(hojas)").html()
@ -195,7 +199,7 @@ open class MangaMx : ParsedHttpSource() {
override fun imageUrlParse(document: Document) = throw Exception("Not Used")
//Filters
// Filters
override fun getFilterList() = FilterList(
Filter.Header("NOTA: ¡Ignorado si usa la búsqueda de texto!"),
@ -207,7 +211,6 @@ open class MangaMx : ParsedHttpSource() {
OrderFilter("Orden", orderArray)
)
private class StatusFilter(name: String, values: Array<Pair<String, String>>) :
Filter.Select<String>(name, values.map { it.first }.toTypedArray())
@ -251,4 +254,3 @@ open class MangaMx : ParsedHttpSource() {
Pair("Ascendente", "asc")
)
}

View File

@ -1,9 +1,14 @@
package eu.kanade.tachiyomi.extension.es.tmohentai
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
@ -213,5 +218,4 @@ class TMOHentai : ParsedHttpSource() {
Pair("Popularidad", "popularity")
)
}
}

View File

@ -6,27 +6,35 @@ import android.support.v7.preference.ListPreference
import android.support.v7.preference.PreferenceScreen
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.*
class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
//Info
// Info
override val name = "TuMangaOnline"
override val baseUrl = "https://lectortmo.com"
override val lang = "es"
override val supportsLatest = true
//Client
// Client
private val userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36"
override fun headersBuilder(): Headers.Builder {
@ -50,7 +58,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
.toString()
}
//Popular
// Popular
override fun popularMangaRequest(page: Int) = GET("$baseUrl/library?order_item=likes_count&order_dir=desc&filter_by=title&_page=1&page=$page", headers)
override fun popularMangaNextPageSelector() = "a.page-link"
@ -63,21 +71,21 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
}
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/library?order_item=creation&order_dir=desc&filter_by=title&_page=1&page=$page", headers)
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = HttpUrl.parse("$baseUrl/library")!!.newBuilder()
url.addQueryParameter("title", query)
url.addQueryParameter("page", page.toString())
url.addQueryParameter("_page", "1") //Extra Query to Prevent Scrapping aka without it = 403
url.addQueryParameter("_page", "1") // Extra Query to Prevent Scrapping aka without it = 403
filters.forEach { filter ->
when (filter) {
@ -142,7 +150,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
//Details
// Details
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
document.select("h5.card-title").let {
@ -165,7 +173,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
else -> SManga.UNKNOWN
}
//Chapters
// Chapters
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
@ -224,18 +232,18 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
private fun parseChapterDate(date: String): Long = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(date)?.time
?: 0
//Pages
// Pages
override fun pageListRequest(chapter: SChapter): Request {
val (chapterURL, chapterID) = chapter.url.split("#")
val response = client.newCall(GET(chapterURL, headers)).execute() //Get chapter page for current token
val response = client.newCall(GET(chapterURL, headers)).execute() // Get chapter page for current token
if (!response.isSuccessful) throw Exception("TMO HTTP Error ${response.code()}")
val document = response.asJsoup()
val script = document.select("script:containsData(submitChapterForm)").html()
val tmotk = script.substringAfter("action+\"").substringBefore("\"}")
val geturl = document.select("form#$chapterID").attr("action") + tmotk //Get redirect URL
val token = document.select("form#$chapterID input").attr("value") //Get token
val method = document.select("form#$chapterID").attr("method") //Check POST or GET
val geturl = document.select("form#$chapterID").attr("action") + tmotk // Get redirect URL
val token = document.select("form#$chapterID input").attr("value") // Get token
val method = document.select("form#$chapterID").attr("method") // Check POST or GET
val getHeaders = headersBuilder()
.add("User-Agent", userAgent)
@ -283,7 +291,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
return document.select("div.viewer-container > div.img-container > img.viewer-image").attr("src")
}
//Filters
// Filters
private class Types : UriPartFilter("Filtrar por tipo", arrayOf(
Pair("Ver todo", ""),

View File

@ -1,11 +1,16 @@
package eu.kanade.tachiyomi.extension.es.vcpvmp
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.*
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
open class VCPVMP(override val name: String, override val baseUrl: String) : ParsedHttpSource() {
@ -57,7 +62,6 @@ open class VCPVMP(override val name: String, override val baseUrl: String) : Par
setUrlWithoutDomain(element.baseUri())
}
override fun pageListRequest(chapter: SChapter) = GET(baseUrl + chapter.url)
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
@ -477,5 +481,4 @@ open class VCPVMP(override val name: String, override val baseUrl: String) : Par
Pair("Zzomp", "252"),
Pair("ZZZ Comics", "2839")
))
}

View File

@ -1,7 +1,8 @@
package eu.kanade.tachiyomi.extension.es.vcpvmp
import eu.kanade.tachiyomi.source.*
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.Filter
class VCPVMPFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
@ -363,7 +364,6 @@ class VMP : VCPVMP("VMP", "https://vermangasporno.com") {
Pair("Zoids Shinseiki Zero", "153"),
Pair("Zombieland Saga", "2059")
))
}
open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.es.zahard
import android.net.Uri
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Request
import org.jsoup.nodes.Document
@ -28,7 +32,7 @@ class Zahard : ParsedHttpSource() {
throw Exception("Source does not support search")
} else {
val uri = Uri.parse("$baseUrl/").buildUpon()
//Append uri filters
// Append uri filters
filters.forEach {
if (it is UriFilter)
it.addToUri(uri)
@ -38,9 +42,9 @@ class Zahard : ParsedHttpSource() {
}
}
override fun mangaDetailsRequest(manga: SManga) = GET( manga.url, headers)
override fun mangaDetailsRequest(manga: SManga) = GET(manga.url, headers)
override fun chapterListRequest(manga: SManga) = mangaDetailsRequest(manga)
override fun pageListRequest(chapter: SChapter) = GET( chapter.url, headers)
override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers)
override fun popularMangaFromElement(element: Element) = mangaFromElement(element)
override fun latestUpdatesFromElement(element: Element) = mangaFromElement(element)
@ -88,7 +92,7 @@ class Zahard : ParsedHttpSource() {
override fun latestUpdatesSelector() = throw Exception("Not used")
override fun latestUpdatesNextPageSelector() = throw Exception("Not used")
override fun latestUpdatesRequest(page: Int) = throw Exception("Not used")
override fun imageUrlParse(document: Document) = throw Exception ("Not Used")
override fun imageUrlParse(document: Document) = throw Exception("Not Used")
override fun getFilterList() = FilterList(
Filter.Header("NOTE: Filters are ignored if using text search."),
@ -96,14 +100,14 @@ class Zahard : ParsedHttpSource() {
TypeFilter(),
GenreFilter()
)
private class TypeFilter : UriSelectFilter("Type","biblioteca", arrayOf(
private class TypeFilter : UriSelectFilter("Type", "biblioteca", arrayOf(
Pair("all", "All"),
Pair("manga", "Manga"),
Pair("manhwa", "Manhwa"),
Pair("manhua", "Manhua")
))
private class GenreFilter : UriSelectFilter("Genre","genero", arrayOf(
private class GenreFilter : UriSelectFilter("Genre", "genero", arrayOf(
Pair("all", "ALL"),
Pair("accion", "Acción"),
Pair("aventura", "Aventura"),
@ -157,9 +161,13 @@ class Zahard : ParsedHttpSource() {
Pair("Comics", "Comics")
))
private open class UriSelectFilter(displayName: String, val uriParam: String, val vals: Array<Pair<String, String>>,
private open class UriSelectFilter(
displayName: String,
val uriParam: String,
val vals: Array<Pair<String, String>>,
val firstIsUnspecified: Boolean = true,
defaultValue: Int = 0) :
defaultValue: Int = 0
) :
Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter {
override fun addToUri(uri: Uri.Builder) {
if (state != 0 || !firstIsUnspecified)
@ -174,6 +182,4 @@ class Zahard : ParsedHttpSource() {
private interface UriFilter {
fun addToUri(uri: Uri.Builder)
}
}

View File

@ -19,6 +19,11 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.FormBody
import okhttp3.MediaType
import okhttp3.OkHttpClient
@ -28,11 +33,6 @@ import okhttp3.ResponseBody
import org.apache.commons.lang3.StringUtils
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
class Japscan : ParsedHttpSource() {
@ -101,8 +101,7 @@ class Japscan : ParsedHttpSource() {
createKeysheet(doc, doc2)
}
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/mangas/", headers)
}
@ -135,7 +134,7 @@ class Japscan : ParsedHttpSource() {
return manga
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request {
return GET(baseUrl, headers)
}
@ -155,7 +154,7 @@ class Japscan : ParsedHttpSource() {
override fun latestUpdatesSelector() = "#chapters > div > h3.text-truncate"
override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
if (query.isEmpty()) {
val uri = Uri.parse(baseUrl).buildUpon()
@ -204,7 +203,6 @@ class Japscan : ParsedHttpSource() {
return MangasPage(mangas, hasNextPage)
}
}
override fun searchMangaFromElement(element: Element): SManga = SManga.create().apply {
@ -249,9 +247,8 @@ class Japscan : ParsedHttpSource() {
override fun chapterListSelector() = "#chapters_list > div.collapse > div.chapters_list" +
":not(:has(.badge:contains(SPOILER),.badge:contains(RAW),.badge:contains(VUS)))"
//JapScan sometimes uploads some "spoiler preview" chapters, containing 2 or 3 untranslated pictures taken from a raw. Sometimes they also upload full RAWs/US versions and replace them with a translation as soon as available.
//Those have a span.badge "SPOILER" or "RAW". The additional pseudo selector makes sure to exclude these from the chapter list.
// JapScan sometimes uploads some "spoiler preview" chapters, containing 2 or 3 untranslated pictures taken from a raw. Sometimes they also upload full RAWs/US versions and replace them with a translation as soon as available.
// Those have a span.badge "SPOILER" or "RAW". The additional pseudo selector makes sure to exclude these from the chapter list.
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()
@ -259,7 +256,7 @@ class Japscan : ParsedHttpSource() {
val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href"))
chapter.name = urlElement.ownText()
//Using ownText() doesn't include childs' text, like "VUS" or "RAW" badges, in the chapter name.
// Using ownText() doesn't include childs' text, like "VUS" or "RAW" badges, in the chapter name.
chapter.date_upload = element.select("> span").text().trim().let { parseChapterDate(it) }
return chapter
}
@ -284,7 +281,6 @@ class Japscan : ParsedHttpSource() {
pageUrls.add(pages[i].attr("data-img").substring("https://c.japscan.co/".length, pages[i].attr("data-img").length - 4))
}
val az = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray()
val ks = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray()
@ -292,7 +288,6 @@ class Japscan : ParsedHttpSource() {
for (j in 0 until realPageUrls[i].length) {
if (realPageUrls[i][j] != pageUrls[i][j]) {
ks[az.indexOf(pageUrls[i][j])] = realPageUrls[i][j]
}
}
keysheet = ks.joinToString("")
@ -369,7 +364,7 @@ class Japscan : ParsedHttpSource() {
return output.toByteArray()
}
//Filters
// Filters
private class TextField(name: String) : Filter.Text(name)
private class PageList(pages: Array<Int>) : Filter.Select<Int>("Page #", arrayOf(0, *pages))

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.fr.lirescan
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
@ -122,5 +126,4 @@ class LireScan : ParsedHttpSource() {
}
override fun getFilterList() = FilterList()
}

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.fr.mangakawaii
import android.net.Uri
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
@ -9,15 +8,14 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class MangaKawaii : ParsedHttpSource() {
@ -66,7 +64,6 @@ class MangaKawaii : ParsedHttpSource() {
return manga
}
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
chapter.url = element.select("a.list-item__title").attr("href")
@ -101,7 +98,7 @@ class MangaKawaii : ParsedHttpSource() {
val element = body.select("script:containsData(Imagesrc)").toString()
val regex = "(data-src).*[\"]".toRegex()
val match = regex.findAll(element).map { it.value.substringAfter("data-src\", \" ").substringBefore("\"").trim() }
//throw Exception(match.elementAt(1))
// throw Exception(match.elementAt(1))
val pages = mutableListOf<Page>()
for (i in 0 until match.count()) {
pages.add(Page(i, "", match.elementAt(i)))

View File

@ -2,19 +2,22 @@ package eu.kanade.tachiyomi.extension.fr.scantrad
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.Calendar
import java.util.Locale
import java.text.SimpleDateFormat
import rx.Observable
import java.lang.Exception
class Scantrad : ParsedHttpSource() {
@ -197,5 +200,4 @@ class Scantrad : ParsedHttpSource() {
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -1,14 +1,18 @@
package eu.kanade.tachiyomi.extension.id.bacakomik
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import eu.kanade.tachiyomi.source.model.*
import java.text.SimpleDateFormat
import java.util.*
import java.text.ParseException
class Bacakomik : ParsedHttpSource() {
override val name = "Bacakomik"
@ -259,6 +263,4 @@ override fun mangaDetailsParse(document: Document): SManga {
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second
}
}

View File

@ -2,18 +2,26 @@ package eu.kanade.tachiyomi.extension.id.bacamanga
import android.util.Base64
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.json.JSONObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
import java.text.SimpleDateFormat
import java.util.*
class BacaManga : ParsedHttpSource() {
@ -117,8 +125,8 @@ class BacaManga : ParsedHttpSource() {
// Add date for latest chapter only
document.select("script.yoast-schema-graph").html()
.let {
val date = JSONObject(it).getJSONArray("@graph").
getJSONObject(3).getString("dateModified")
val date = JSONObject(it).getJSONArray("@graph")
.getJSONObject(3).getString("dateModified")
chapters[0].date_upload = parseDate(date)
}
return chapters

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.id.kiryuu
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.HttpUrl

View File

@ -1,12 +1,19 @@
package eu.kanade.tachiyomi.extension.id.komikcast
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import java.util.Calendar
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import eu.kanade.tachiyomi.source.model.*
import java.util.*
class Komikcast : ParsedHttpSource() {
@ -37,7 +44,7 @@ class Komikcast : ParsedHttpSource() {
url.toString()
} else {
val url = HttpUrl.parse("$baseUrl/daftar-komik/page/$page")!!.newBuilder()
var orderBy = ""
var orderBy: String
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
when (filter) {
is Status -> url.addQueryParameter("status", arrayOf("", "ongoing", "completed")[filter.state])

View File

@ -2,16 +2,20 @@ package eu.kanade.tachiyomi.extension.id.komikindo
import android.annotation.SuppressLint
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Calendar
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class KomikIndo : ParsedHttpSource() {
@ -81,17 +85,17 @@ class KomikIndo : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document): SManga {
val infoElm = document.select(".listinfo > ul > li")
val manga = SManga.create()
infoElm.forEachIndexed { index, element ->
infoElm.forEach { element ->
val infoTitle = element.select("b").text().toLowerCase()
var infoContent = element.text()
val infoContent = element.text()
when {
infoTitle.contains("status") -> manga.status = parseStatus(infoContent)
infoTitle.contains("author") -> manga.author = infoContent
infoTitle.contains("artist") -> manga.artist = infoContent
infoTitle.contains("genres") -> {
val genres = mutableListOf<String>()
element.select("a").forEach { element ->
val genre = element.text()
element.select("a").forEach { a ->
val genre = a.text()
genres.add(genre)
}
manga.genre = genres.joinToString(", ")

View File

@ -2,23 +2,16 @@ package eu.kanade.tachiyomi.extension.id.komiku
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.util.Calendar
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
class Komiku: ParsedHttpSource() {
class Komiku : ParsedHttpSource() {
override val name = "Komiku"
override val baseUrl = "https://komiku.co.id/"
@ -80,11 +73,11 @@ class Komiku: ParsedHttpSource() {
setUrlWithoutDomain(element.select("a.popunder").attr("href"))
name = element.select("a.popunder").attr("title")
//Has datetime attribute, but all are set to statt of current day for whatever reason, so parsing text instead
// Has datetime attribute, but all are set to statt of current day for whatever reason, so parsing text instead
date_upload = parseRelativeDate(element.select("time").text().trim()) ?: 0
}
//Used Google translate here
// Used Google translate here
private fun parseRelativeDate(date: String): Long? {
val trimmedDate = date.substringBefore(" lalu").removeSuffix("s").split(" ")

View File

@ -1,9 +1,14 @@
package eu.kanade.tachiyomi.extension.id.maidmanga
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
@ -11,7 +16,6 @@ import okhttp3.Response
import org.json.JSONObject
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
class MaidManga : ParsedHttpSource() {
@ -29,7 +33,7 @@ class MaidManga : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request {
// The site redirects page 1 -> url-without-page so we do this redirect early for optimization
val builtUrl = if(page == 1) baseUrl else "$baseUrl/page/$page/"
val builtUrl = if (page == 1) baseUrl else "$baseUrl/page/$page/"
return GET(builtUrl)
}
@ -46,7 +50,7 @@ class MaidManga : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = "a:containsOwn(Berikutnya)"
override fun popularMangaRequest(page: Int): Request {
val builtUrl = if(page == 1) "$baseUrl/advanced-search/?order=popular" else "$baseUrl/advanced-search/page/$page/?order=popular"
val builtUrl = if (page == 1) "$baseUrl/advanced-search/?order=popular" else "$baseUrl/advanced-search/page/$page/?order=popular"
return GET(builtUrl)
}
@ -64,7 +68,7 @@ class MaidManga : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val builtUrl = if(page == 1) "$baseUrl/advanced-search/" else "$baseUrl/advanced-search/page/$page/"
val builtUrl = if (page == 1) "$baseUrl/advanced-search/" else "$baseUrl/advanced-search/page/$page/"
val url = HttpUrl.parse(builtUrl)!!.newBuilder()
url.addQueryParameter("title", query)
url.addQueryParameter("page", page.toString())
@ -166,8 +170,8 @@ class MaidManga : ParsedHttpSource() {
// Add date for latest chapter only
document.select("script.yoast-schema-graph").html()
.let {
val date = JSONObject(it).getJSONArray("@graph").
getJSONObject(3).getString("dateModified")
val date = JSONObject(it).getJSONArray("@graph")
.getJSONObject(3).getString("dateModified")
chapters[0].date_upload = parseDate(date)
}
return chapters
@ -244,7 +248,7 @@ class MaidManga : ParsedHttpSource() {
Tag("4-koma", "4-Koma"),
Tag("4-koma-comedy", "4-Koma Comedy"),
Tag("action", "Action"),
Tag("adult" ,"Adult"),
Tag("adult", "Adult"),
Tag("adventure", "Adventure"),
Tag("comedy", "Comedy"),
Tag("demons", "Demons"),

View File

@ -6,16 +6,19 @@ import com.github.salomonbrys.kotson.int
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.lang.Exception
import java.text.SimpleDateFormat
import java.util.Locale
class MangaIndo : ParsedHttpSource() {
@ -147,5 +150,4 @@ class MangaIndo : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.id.mangaku
import android.annotation.SuppressLint
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers

View File

@ -1,9 +1,11 @@
package eu.kanade.tachiyomi.extension.id.mangakyo
import android.net.Uri
import android.util.Log
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
@ -17,7 +19,7 @@ class Mangakyo : ParsedHttpSource() {
override val supportsLatest: Boolean = true
override val client: OkHttpClient = network.cloudflareClient
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/advanced-search/page/$page/?title&author&status&order=popular", headers)
@ -30,7 +32,7 @@ class Mangakyo : ParsedHttpSource() {
thumbnail_url = element.select("img").attr("abs:src")
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request {
return GET("$baseUrl/advanced-search/page/$page/?title=&author=&status=&order=update", headers)
@ -39,24 +41,24 @@ class Mangakyo : ParsedHttpSource() {
override fun latestUpdatesSelector(): String = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val uri = Uri.parse(baseUrl).buildUpon()
.appendPath("advanced-search")
.appendPath("page")
.appendPath(page.toString())
.appendQueryParameter("title",query)
.appendQueryParameter("author","")
.appendQueryParameter("status","")
.appendQueryParameter("order","title")
.appendQueryParameter("title", query)
.appendQueryParameter("author", "")
.appendQueryParameter("status", "")
.appendQueryParameter("order", "title")
return GET(uri.toString(), headers)
}
override fun searchMangaNextPageSelector(): String? = popularMangaNextPageSelector()
override fun searchMangaSelector(): String = popularMangaSelector()
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
//Details
// Details
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
title = document.select("h1[itemprop=headline]").text()
@ -73,7 +75,7 @@ class Mangakyo : ParsedHttpSource() {
description = document.select("span.desc p").map { it.text() }.joinToString("\n")
}
//Chapter
// Chapter
override fun chapterListSelector(): String = "span.lchx a"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
@ -81,11 +83,11 @@ class Mangakyo : ParsedHttpSource() {
setUrlWithoutDomain(element.attr("abs:href"))
}
//Pages
// Pages
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
document.select("img.alignnone").forEachIndexed { index, element ->
add(Page(index,"",element.attr("abs:src")))
add(Page(index, "", element.attr("abs:src")))
}
}
override fun imageUrlParse(document: Document): String = throw Exception("Not Used")

View File

@ -1,14 +1,18 @@
package eu.kanade.tachiyomi.extension.id.mangashiro
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import eu.kanade.tachiyomi.source.model.*
import java.text.SimpleDateFormat
import java.util.*
import java.text.ParseException
class Mangashiro : ParsedHttpSource() {
@ -261,6 +265,4 @@ class Mangashiro : ParsedHttpSource() {
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second
}
}

View File

@ -2,22 +2,15 @@ package eu.kanade.tachiyomi.extension.id.manhuaid
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
class ManhuaID: ParsedHttpSource() {
class ManhuaID : ParsedHttpSource() {
override val name = "ManhuaID"

View File

@ -1,17 +1,21 @@
package eu.kanade.tachiyomi.extension.id.neumanga
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.X509TrustManager
import okhttp3.HttpUrl
import okhttp3.Request
import org.json.JSONArray
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.X509TrustManager
class Neumanga : ParsedHttpSource() {
@ -95,7 +99,7 @@ class Neumanga : ParsedHttpSource() {
filter.state.forEach {
if (it.state == 1) {
genreInclude.add(it.id)
} else if (it.state == 2){
} else if (it.state == 2) {
genreExclude.add(it.id)
}
}
@ -244,5 +248,4 @@ class Neumanga : ParsedHttpSource() {
Genre("Echi", "Echi"),
Genre("4-Koma", "4-Koma")
)
}

View File

@ -2,23 +2,15 @@ package eu.kanade.tachiyomi.extension.id.ngomik
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
class Ngomik: ParsedHttpSource() {
class Ngomik : ParsedHttpSource() {
override val name = "Ngomik"

View File

@ -1,16 +1,20 @@
package eu.kanade.tachiyomi.extension.id.pecintakomik
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class PecintaKomik : ParsedHttpSource() {
@ -26,7 +30,7 @@ class PecintaKomik : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request {
// The site redirects page 1 -> url-without-page so we do this redirect early for optimization
val builtUrl = if(page == 1) baseUrl else "$baseUrl/page/$page/"
val builtUrl = if (page == 1) baseUrl else "$baseUrl/page/$page/"
return GET(builtUrl)
}
@ -45,7 +49,7 @@ class PecintaKomik : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = "a.next"
override fun popularMangaRequest(page: Int): Request {
val builtUrl = if(page == 1) "$baseUrl/advanced-search/?order=popular" else "$baseUrl/advanced-search/page/$page/?order=popular"
val builtUrl = if (page == 1) "$baseUrl/advanced-search/?order=popular" else "$baseUrl/advanced-search/page/$page/?order=popular"
return GET(builtUrl)
}
@ -63,7 +67,7 @@ class PecintaKomik : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val builtUrl = if(page == 1) "$baseUrl/advanced-search/" else "$baseUrl/advanced-search/page/$page/"
val builtUrl = if (page == 1) "$baseUrl/advanced-search/" else "$baseUrl/advanced-search/page/$page/"
var types: String? = null
fun requireNoType() = require(types == null) {
"You cannot combine type with other filters!"
@ -74,13 +78,13 @@ class PecintaKomik : ParsedHttpSource() {
filters.forEach { filter ->
when (filter) {
is AuthorFilter -> {
if(filter.state.isNotBlank()) {
if (filter.state.isNotBlank()) {
requireNoType()
url.addQueryParameter("author", filter.state)
}
}
is YearFilter -> {
if(filter.state.isNotBlank()) {
if (filter.state.isNotBlank()) {
requireNoType()
url.addQueryParameter("yearx", filter.state)
}
@ -91,18 +95,18 @@ class PecintaKomik : ParsedHttpSource() {
Filter.TriState.STATE_EXCLUDE -> "ongoing"
else -> ""
}
if(status.isNotEmpty()) {
if (status.isNotEmpty()) {
requireNoType()
url.addQueryParameter("status", status)
}
}
is TypeFilter -> {
if(filter.state != 0) {
types = if(page == 1) "$baseUrl/types/${filter.toUriPart()}/" else "$baseUrl/types/${filter.toUriPart()}/page/$page/"
if (filter.state != 0) {
types = if (page == 1) "$baseUrl/types/${filter.toUriPart()}/" else "$baseUrl/types/${filter.toUriPart()}/page/$page/"
}
}
is OrderByFilter -> {
if(filter.state != 0) {
if (filter.state != 0) {
requireNoType()
url.addQueryParameter("order", filter.toUriPart())
}

View File

@ -2,15 +2,22 @@ package eu.kanade.tachiyomi.extension.it.hentaifantasy
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.regex.Pattern
import okhttp3.FormBody
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class HentaiFantasy : ParsedHttpSource() {
override val name = "HentaiFantasy"
@ -35,8 +42,8 @@ class HentaiFantasy : ParsedHttpSource() {
override fun popularMangaSelector() = "div.list > div.group > div.title > a"
override fun popularMangaRequest(page: Int)
= GET("$baseUrl/most_downloaded/$page/", headers)
override fun popularMangaRequest(page: Int) =
GET("$baseUrl/most_downloaded/$page/", headers)
override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
@ -49,8 +56,8 @@ class HentaiFantasy : ParsedHttpSource() {
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesRequest(page: Int)
= GET("$baseUrl/latest/$page/", headers)
override fun latestUpdatesRequest(page: Int) =
GET("$baseUrl/latest/$page/", headers)
override fun latestUpdatesFromElement(element: Element): SManga {
return popularMangaFromElement(element)
@ -68,7 +75,7 @@ class HentaiFantasy : ParsedHttpSource() {
is TagList -> filter.state
.filter { it.state }
.map {
paths.add(it.name.toLowerCase().replace(" ", "_"));
paths.add(it.name.toLowerCase().replace(" ", "_"))
it.id.toString()
}
.forEach { tags.add(it) }
@ -93,12 +100,12 @@ class HentaiFantasy : ParsedHttpSource() {
var searchPath = if (!searchTags) {
"search"
} else if (paths.size == 1) {
"tag/${paths[0]}/${page}"
"tag/${paths[0]}/$page"
} else {
"search_tags"
}
return POST("${baseUrl}/${searchPath}", headers, form.build())
return POST("$baseUrl/$searchPath", headers, form.build())
}
override fun searchMangaFromElement(element: Element): SManga {

View File

@ -5,7 +5,11 @@ import com.github.salomonbrys.kotson.get
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
@ -143,5 +147,4 @@ class ItaScan : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -1,15 +1,20 @@
package eu.kanade.tachiyomi.extension.it.mangaeden
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
class Mangaeden : ParsedHttpSource() {

View File

@ -13,13 +13,13 @@ import org.jsoup.nodes.Element
class NovelleLeggere : ParsedHttpSource() {
//Info
// Info
override val name: String = "Novelle Leggere"
override val baseUrl: String = "https://www.novelleleggere.com"
override val lang: String = "it"
override val supportsLatest: Boolean = false
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request = GET(baseUrl)
override fun popularMangaNextPageSelector(): String? = null
@ -30,7 +30,7 @@ class NovelleLeggere : ParsedHttpSource() {
setUrlWithoutDomain(a.attr("abs:href"))
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request = throw Exception("Latest Not Supported")
override fun latestUpdatesNextPageSelector(): String? = throw Exception("Latest Not Supported")
@ -38,7 +38,7 @@ class NovelleLeggere : ParsedHttpSource() {
override fun latestUpdatesFromElement(element: Element): SManga =
throw Exception("Latest Not Supported")
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request =
throw Exception("Search Not Supported")
@ -47,7 +47,7 @@ class NovelleLeggere : ParsedHttpSource() {
override fun searchMangaFromElement(element: Element): SManga =
throw Exception("Search Not Supported")
//Details
// Details
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
thumbnail_url = document.select("div.post-content img").first().attr("abs:src")
title = document.select("div.post-content h3").text().trim()
@ -56,7 +56,7 @@ class NovelleLeggere : ParsedHttpSource() {
.trim()
}
//Chapters
// Chapters
override fun chapterListSelector(): String =
"div.post-content div:contains(Capitoli) div.su-spoiler-content ul li a"
@ -69,7 +69,7 @@ class NovelleLeggere : ParsedHttpSource() {
return super.chapterListParse(response).reversed()
}
//Pages
// Pages
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
document.select("div.post-content p img").forEachIndexed { index, element ->
add(Page(index, "", element.attr("abs:src").substringBefore("?")))
@ -78,5 +78,4 @@ class NovelleLeggere : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String =
throw Exception("ImgURL Parse Not Used")
}

View File

@ -1,15 +1,20 @@
package eu.kanade.tachiyomi.extension.it.perveden
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
class Perveden : ParsedHttpSource() {

View File

@ -1,9 +1,15 @@
package eu.kanade.tachiyomi.extension.ja.nikkangecchan
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import okhttp3.Headers
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
@ -45,14 +51,14 @@ class Nikkangecchan : ParsedHttpSource() {
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
return super.fetchSearchManga(page, query, filters)
.map {
val filtered = it.mangas.filter{ e -> e.title.contains(query, true) }
val filtered = it.mangas.filter { e -> e.title.contains(query, true) }
MangasPage(filtered, false)
}
}
// Does not have search, use complete list (in popular) instead.
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request
= popularMangaRequest(page)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request =
popularMangaRequest(page)
override fun searchMangaSelector() = popularMangaSelector()
@ -74,8 +80,8 @@ class Nikkangecchan : ParsedHttpSource() {
override fun chapterListSelector(): String = ".episodeBox"
override fun chapterListParse(response: Response): List<SChapter>
= super.chapterListParse(response).reversed()
override fun chapterListParse(response: Response): List<SChapter> =
super.chapterListParse(response).reversed()
override fun chapterFromElement(element: Element): SChapter {
val episodePage = element.select(".episode-page").first()

View File

@ -1,14 +1,22 @@
package eu.kanade.tachiyomi.extension.ja.rawdevart
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class Rawdevart : ParsedHttpSource() {
@ -152,7 +160,7 @@ class Rawdevart : ParsedHttpSource() {
manga.genre = genres.joinToString(", ")
manga.description = infoElement.select("div.description").text()
.substringAfter("Description ")
manga.thumbnail_url =infoElement.select("img.img-fluid.not-lazy").attr("abs:src")
manga.thumbnail_url = infoElement.select("img.img-fluid.not-lazy").attr("abs:src")
return manga
}

View File

@ -1,20 +1,24 @@
package eu.kanade.tachiyomi.extension.ja.rawkuma
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
class Rawkuma: ParsedHttpSource() {
class Rawkuma : ParsedHttpSource() {
override val name = "Rawkuma"
@ -30,7 +34,7 @@ class Rawkuma: ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request {
// The site redirects page 1 -> url-without-page so we do this redirect early for optimization
val builtUrl = if(page == 1) "$baseUrl/manga/?order=update" else "$baseUrl/manga/page/$page/?order=update"
val builtUrl = if (page == 1) "$baseUrl/manga/?order=update" else "$baseUrl/manga/page/$page/?order=update"
return GET(builtUrl)
}
@ -46,7 +50,7 @@ class Rawkuma: ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = "a.next"
override fun popularMangaRequest(page: Int): Request {
val builtUrl = if(page == 1) "$baseUrl/manga/?order=popular" else "$baseUrl/manga/page/$page/?order=popular"
val builtUrl = if (page == 1) "$baseUrl/manga/?order=popular" else "$baseUrl/manga/page/$page/?order=popular"
return GET(builtUrl)
}
@ -57,7 +61,7 @@ class Rawkuma: ParsedHttpSource() {
override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val builtUrl = if(page == 1) "$baseUrl/manga/" else "$baseUrl/manga/page/$page/"
val builtUrl = if (page == 1) "$baseUrl/manga/" else "$baseUrl/manga/page/$page/"
val url = HttpUrl.parse(builtUrl)!!.newBuilder()
url.addQueryParameter("title", query)
url.addQueryParameter("page", page.toString())

View File

@ -2,13 +2,17 @@ package eu.kanade.tachiyomi.extension.ja.senmanga
import android.annotation.SuppressLint
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.util.Calendar
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.Calendar
/**
* Sen Manga source
@ -23,8 +27,8 @@ class SenManga : ParsedHttpSource() {
@SuppressLint("DefaultLocale")
override val client = super.client.newBuilder().addInterceptor {
//Intercept any image requests and add a referer to them
//Enables bandwidth stealing feature
// Intercept any image requests and add a referer to them
// Enables bandwidth stealing feature
val request = if (it.request().url().pathSegments().firstOrNull()?.trim()?.toLowerCase() == "viewer") {
it.request().newBuilder()
.addHeader("Referer", it.request().url().newBuilder()
@ -129,11 +133,11 @@ class SenManga : ParsedHttpSource() {
if (trimmedDate[2] != "ago") return 0
val number = trimmedDate[0].toIntOrNull() ?: return 0
val unit = trimmedDate[1].removeSuffix("s") //Remove 's' suffix
val unit = trimmedDate[1].removeSuffix("s") // Remove 's' suffix
val now = Calendar.getInstance()
//Map English unit to Java unit
// Map English unit to Java unit
val javaUnit = when (unit) {
"year" -> Calendar.YEAR
"month" -> Calendar.MONTH
@ -151,13 +155,13 @@ class SenManga : ParsedHttpSource() {
}
override fun pageListParse(document: Document): List<Page> {
return listOf(1 .. document.select("select[name=page] option:last-of-type").first().text().toInt()).flatten().map { i ->
return listOf(1..document.select("select[name=page] option:last-of-type").first().text().toInt()).flatten().map { i ->
Page(i - 1, "", "${document.location().replace(baseUrl, "$baseUrl/viewer")}/$i")
}
}
override fun imageUrlParse(document: Document)
= throw UnsupportedOperationException("This method should not be called!")
override fun imageUrlParse(document: Document) =
throw UnsupportedOperationException("This method should not be called!")
override fun getFilterList() = FilterList(
GenreFilter(getGenreList()),

View File

@ -10,20 +10,32 @@ import com.github.salomonbrys.kotson.string
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import kotlin.math.floor
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Interceptor
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.ResponseBody
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.io.ByteArrayOutputStream
import java.io.InputStream
import java.lang.Exception
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import kotlin.math.floor
class ShonenJumpPlus : ParsedHttpSource() {
@ -239,7 +251,7 @@ class ShonenJumpPlus : ParsedHttpSource() {
return output.toByteArray()
}
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
DATE_PARSER.parse(date).time
} catch (e: ParseException) {

View File

@ -1,16 +1,20 @@
package eu.kanade.tachiyomi.extension.ko.jmana
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
/**
* JMana Source
@ -157,7 +161,7 @@ class JMana : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = null
//We are able to get the image URL directly from the page list
// We are able to get the image URL directly from the page list
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("This method should not be called!")
override fun getFilterList() = FilterList()

View File

@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.extension.ko.mangashowme
import org.json.JSONArray
internal class CDNUrlHandler(scripts: String) {
internal class MMCDNUrlHandler(scripts: String) {
private val domains = JSONArray("[${scripts.substringBetween("var cdn_domains = [", "];")}]")
private val chapter = scripts.substringBetween("var chapter = ", ";")
.toIntOrNull() ?: 0

View File

@ -6,7 +6,6 @@ import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl
import okhttp3.Request
// TODO: Completely Implement/Update Filters(Genre/Artist).
private class TextField(name: String, val key: String) : Filter.Text(name)
@ -19,7 +18,6 @@ private class SearchNamingList : Filter.Select<String>("Naming", searchNaming())
private class SearchStatusList : Filter.Select<String>("Status", searchStatus())
private class SearchOrderList : Filter.Select<String>("Order", order())
// [`"Not Set"`, ...[...document.querySelectorAll(".categories ul[data-type='1'] li")].map((el, i) => `"${el.innerText.trim()}"`)].join(',\n')
private fun searchNaming() = arrayOf(
"Not Set",

View File

@ -4,10 +4,6 @@ import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Rect
import okhttp3.Interceptor
import okhttp3.MediaType
import okhttp3.Response
import okhttp3.ResponseBody
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.io.InputStream
@ -15,7 +11,10 @@ import kotlin.math.cos
import kotlin.math.floor
import kotlin.math.sin
import kotlin.math.tan
import okhttp3.Interceptor
import okhttp3.MediaType
import okhttp3.Response
import okhttp3.ResponseBody
/*
* `v1` means url padding of image host.
@ -34,7 +33,6 @@ internal class ImageDecoder(scripts: String) {
}
}
internal class ImageDecoderInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val req = chain.request()
@ -91,7 +89,7 @@ internal class ImageDecoderInterceptor : Interceptor {
var cx = ManaMoa.V1_CX
var cy = ManaMoa.V1_CY
//view_cnt / 10 > 30000 ? (this._CX = 1, this._CY = 6) : view_cnt / 10 > 20000 ? this._CX = 1 : view_cnt / 10 > 10000 && (this._CY = 1)
// view_cnt / 10 > 30000 ? (this._CX = 1, this._CY = 6) : view_cnt / 10 > 20000 ? this._CX = 1 : view_cnt / 10 > 10000 && (this._CY = 1)
// DO NOT (AUTOMATICALLY) REPLACE TO when USING IDEA. seems it doesn't detect correct condition
if (viewCnt > 30000) {
cx = 1
@ -102,7 +100,7 @@ internal class ImageDecoderInterceptor : Interceptor {
cy = 1
}
//decode image
// decode image
val order = Array(cx * cy) { IntArray(2) }
val oSize = order.size - 1
@ -113,7 +111,7 @@ internal class ImageDecoderInterceptor : Interceptor {
java.util.Arrays.sort(order) { a, b -> a[1].toDouble().compareTo(b[1].toDouble()) }
//create new bitmap
// create new bitmap
val outputWidth = if (half == 0) input.width else input.width / 2
val output = Bitmap.createBitmap(outputWidth, input.height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(output)

View File

@ -13,10 +13,23 @@ import eu.kanade.tachiyomi.extension.BuildConfig
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
import okhttp3.Call
import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.json.JSONArray
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
@ -24,12 +37,6 @@ import org.jsoup.select.Elements
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
/**
* ManaMoa Source
@ -118,7 +125,6 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request =
searchComplexFilterMangaRequestBuilder(baseUrl, page, query, filters)
override fun mangaDetailsParse(document: Document): SManga {
val info = document.select("div.left-info").first()
val thumbnailElement = info.select("div.manga-thumbnail").first()
@ -127,7 +133,7 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
val mangaStatus = info.select("div.recommend")
val mangaLike = mangaStatus.select(".fa-thumbs-up").trimText("0")
//val mangaViews = trimElementText(mangaStatus.select(".fa-smile-o"), "0")
// val mangaViews = trimElementText(mangaStatus.select(".fa-smile-o"), "0")
val mangaComments = mangaStatus.select(".fa-comment").trimText("0")
val mangaBookmarks = info.select(".fa-bookmark").trimText("0")
val mangaChaptersLike = mangaElementsSum(document.select(".title i.fa.fa-thumbs-up > span"))
@ -145,7 +151,7 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
manga.description =
"\uD83D\uDCDD: $publishTypeText\n" +
"👍: $mangaLike ($mangaChaptersLike)\n" +
//"\uD83D\uDD0D: $mangaViews\n" +
// "\uD83D\uDD0D: $mangaViews\n" +
"\uD83D\uDCAC: $mangaComments ($mangaChaptersComments)\n" +
"\uD83D\uDD16: $mangaBookmarks"
manga.author = authorText
@ -218,16 +224,15 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
}
}
// They are using full url in every links.
// There's possibility to using another domain for serve manga(s). Like marumaru.
//override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers)
// override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers)
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
try {
val element = document.toString()
val cdnHandler = CDNUrlHandler(element)
val cdnHandler = MMCDNUrlHandler(element)
val imageUrl = element.substringBetween("var img_list = [", "];")
val imageUrls = cdnHandler.replace(JSONArray("[$imageUrl]"))
@ -276,7 +281,6 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
return GET(page.imageUrl!!, requestHeaders)
}
// Latest not supported
override fun latestUpdatesSelector() = ".post-row > div.media.post-list"
@ -287,9 +291,9 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
// TODO: Make Clear Regex.
val chapterRegex = Regex("""((?:\s+)(?:(?:(?:[0-9]+권)?(?:[0-9]+부)?(?:[0-9]*?시즌[0-9]*?)?)?(?:\s*)(?:(?:[0-9]+)(?:[-.](?:[0-9]+))?)?(?:\s*[~,]\s*)?(?:[0-9]+)(?:[-.](?:[0-9]+))?)(?:화))""")
val title = rawTitle.trim().replace(chapterRegex, "")
//val regexSpecialChapter = Regex("(부록|단편|외전|.+편)")
//val lastTitleWord = excludeChapterTitle.split(" ").last()
//val title = excludeChapterTitle.replace(lastTitleWord, lastTitleWord.replace(regexSpecialChapter, ""))
// val regexSpecialChapter = Regex("(부록|단편|외전|.+편)")
// val lastTitleWord = excludeChapterTitle.split(" ").last()
// val title = excludeChapterTitle.replace(lastTitleWord, lastTitleWord.replace(regexSpecialChapter, ""))
val manga = SManga.create()
manga.url = linkElement.attr("href")
@ -302,8 +306,7 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/bbs/board.php?bo_table=manga" + if (page > 1) "&page=$page" else "")
override fun latestUpdatesNextPageSelector() = "ul.pagination > li:not(.disabled)"
//We are able to get the image URL directly from the page list
// We are able to get the image URL directly from the page list
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("This method should not be called!")
private fun urlFinder(style: String): String {
@ -341,7 +344,7 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
}
}
val autoFetchUrlPref = androidx.preference.CheckBoxPreference (screen.context).apply {
val autoFetchUrlPref = androidx.preference.CheckBoxPreference(screen.context).apply {
key = AUTOFETCH_URL_PREF_TITLE
title = AUTOFETCH_URL_PREF_TITLE
summary = AUTOFETCH_URL_PREF_SUMMARY
@ -462,21 +465,21 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
}
val request: Request = Request.Builder().get()
//.url("https://mnmnmnmnm.xyz/")
// .url("https://mnmnmnmnm.xyz/")
.url("http://52.74.159.59")
.build()
val future = CallbackFuture()
network.client
//.newBuilder()
//.addInterceptor(DDOSGuardInterceptor())
//.build()!!
// .newBuilder()
// .addInterceptor(DDOSGuardInterceptor())
// .build()!!
.newCall(request).enqueue(future)
val response = future.get()!!
return "https://${response.request().url().host()}"
//val code = response.body().toString().substringBetween("manamoa", ".net")
//return "https://manamoa$code.net"
// val code = response.body().toString().substringBetween("manamoa", ".net")
// return "https://manamoa$code.net"
} catch (e: Exception) {
e.printStackTrace()
return prefBaseUrl
@ -486,7 +489,6 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
}
}
private fun getPrefBaseUrl(): String = preferences.getString(BASE_URL_PREF, defaultBaseUrl)!!
private fun getExperimentLatest(): Boolean = preferences.getBoolean(EXPERIMENTAL_LATEST_PREF, false)

View File

@ -31,5 +31,4 @@ class ManaMoaUrlActivity : Activity() {
finish()
exitProcess(0)
}
}

View File

@ -5,11 +5,11 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Response
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.Response
import org.jsoup.nodes.Element
class NaverWebtoon : NaverComicBase("webtoon") {
override val name = "Naver Webtoon"

View File

@ -8,14 +8,14 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
abstract class NaverComicBase(protected val mType: String) : ParsedHttpSource() {
override val lang: String = "ko"
@ -131,7 +131,7 @@ abstract class NaverComicBase(protected val mType: String) : ParsedHttpSource()
return pages
}
//We are able to get the image URL directly from the page list
// We are able to get the image URL directly from the page list
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("This method should not be called!")
override fun getFilterList() = FilterList()

View File

@ -9,9 +9,15 @@ import android.widget.Toast
import eu.kanade.tachiyomi.extension.BuildConfig
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Calendar
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
@ -19,8 +25,6 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.*
/**
* NewToki Source
@ -31,7 +35,6 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient
override fun popularMangaSelector() = "div#webtoon-list > ul > li"
override fun popularMangaFromElement(element: Element): SManga {
@ -71,7 +74,6 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
override fun searchMangaParse(response: Response) = popularMangaParse(response)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = GET("$baseUrl/$boardName" + (if (page > 1) "/p$page" else "") + "?stx=$query")
override fun mangaDetailsParse(document: Document): SManga {
val info = document.select("div.view-title > .view-content").first()
val title = document.select("div.view-content > span > b").text()
@ -161,7 +163,6 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
}
}
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
try {
@ -181,15 +182,13 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
return pages
}
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
override fun latestUpdatesRequest(page: Int) = popularMangaRequest(page)
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun latestUpdatesParse(response: Response) = popularMangaParse(response)
//We are able to get the image URL directly from the page list
// We are able to get the image URL directly from the page list
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("This method should not be called!")
override fun getFilterList() = FilterList()

View File

@ -5,11 +5,11 @@ import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.Request
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.Date
/**
* Source changes domain names approximately once every 10 days (e.g. newtoki31.net to newtoki32.net)

View File

@ -6,16 +6,21 @@ import com.github.salomonbrys.kotson.string
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class AnimaRegia : ParsedHttpSource() {
@ -130,7 +135,7 @@ class AnimaRegia : ParsedHttpSource() {
}
}
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
SimpleDateFormat("dd MMM. yyyy", Locale.ENGLISH).parse(date).time
} catch (e: ParseException) {
@ -149,7 +154,7 @@ class AnimaRegia : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
val pages = document.select("div.viewer-cnt img.img-responsive")
return pages.mapIndexed { i, element -> Page(i, "", element.absUrl("data-src"))}
return pages.mapIndexed { i, element -> Page(i, "", element.absUrl("data-src")) }
}
override fun imageUrlParse(document: Document) = ""

View File

@ -7,8 +7,16 @@ import com.google.gson.JsonArray
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
@ -16,10 +24,6 @@ import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
class CentralDeMangas : ParsedHttpSource() {
@ -144,7 +148,7 @@ class CentralDeMangas : ParsedHttpSource() {
?.let { parseChapterDate(it) } ?: 0
}
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH).parse(date).time
} catch (e: ParseException) {

View File

@ -2,15 +2,21 @@ package eu.kanade.tachiyomi.extension.pt.goldenmangas
import android.util.Log
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class GoldenMangas : ParsedHttpSource() {
@ -124,7 +130,7 @@ class GoldenMangas : ParsedHttpSource() {
val pages = chapImages.select("img[pag]")
return pages
.mapIndexed { i, element -> Page(i, "", baseUrl + element.attr("src"))}
.mapIndexed { i, element -> Page(i, "", baseUrl + element.attr("src")) }
}
override fun imageUrlParse(document: Document) = ""
@ -133,7 +139,7 @@ class GoldenMangas : ParsedHttpSource() {
private fun removeLabel(text: String?): String = text!!.substringAfter(":").trim()
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
SimpleDateFormat("(dd/MM/yyyy)", Locale.ENGLISH).parse(date).time
} catch (e: ParseException) {

View File

@ -1,20 +1,32 @@
package eu.kanade.tachiyomi.extension.pt.hipercool
import com.github.salomonbrys.kotson.*
import com.github.salomonbrys.kotson.array
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.jsonObject
import com.github.salomonbrys.kotson.obj
import com.github.salomonbrys.kotson.string
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.*
import rx.Observable
import java.lang.Exception
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Locale
import okhttp3.Headers
import okhttp3.MediaType
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import rx.Observable
class Hipercool : HttpSource() {
override val name = "HipercooL"
@ -205,7 +217,7 @@ class Hipercool : HttpSource() {
return GET(page.imageUrl!!, newHeaders)
}
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
.parse(date.substringBefore("T"))
@ -215,11 +227,11 @@ class Hipercool : HttpSource() {
}
}
private fun getThumbnailUrl(bookSlug: String, revision: Int): String
= "$STATIC_URL/books/$bookSlug/$bookSlug-cover.jpg?revision=$revision"
private fun getThumbnailUrl(bookSlug: String, revision: Int): String =
"$STATIC_URL/books/$bookSlug/$bookSlug-cover.jpg?revision=$revision"
private fun getPageUrl(bookSlug: String, chapterSlug: String, page: Int, revision: Int): String
= "$STATIC_URL/books/$bookSlug/$chapterSlug/$bookSlug-chapter-$chapterSlug-page-$page.jpg?revision=$revision"
private fun getPageUrl(bookSlug: String, chapterSlug: String, page: Int, revision: Int): String =
"$STATIC_URL/books/$bookSlug/$chapterSlug/$bookSlug-chapter-$chapterSlug-page-$page.jpg?revision=$revision"
private fun Response.asJsonObject(): JsonObject = JSON_PARSER.parse(body()!!.string()).obj

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.pt.hqdragon
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.FormBody
@ -65,12 +69,12 @@ class HQDragon : ParsedHttpSource() {
val mangas = mutableListOf<SManga>()
document.select(latestUpdatesSelector())
.forEach{ mangas.add(latestUpdatesFromElements(it, it.nextElementSibling())) }
.forEach { mangas.add(latestUpdatesFromElements(it, it.nextElementSibling())) }
return MangasPage(mangas, document.select("a[href\$=5693-x-force-2018]").isEmpty())
}
private fun latestUpdatesFromElements(imageElement: Element, titleElement: Element) : SManga {
private fun latestUpdatesFromElements(imageElement: Element, titleElement: Element): SManga {
val manga = SManga.create()
manga.thumbnail_url = imageElement.select("img").attr("src")
@ -157,5 +161,4 @@ class HQDragon : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -5,7 +5,12 @@ import com.github.salomonbrys.kotson.get
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
@ -151,33 +156,33 @@ class HQNow : HttpSource() {
)
private class LetterFilter : UriPartFilter("Letra", arrayOf(
Pair("---","<Selecione>"),
Pair("a","A"),
Pair("b","B"),
Pair("c","C"),
Pair("d","D"),
Pair("e","E"),
Pair("f","F"),
Pair("g","G"),
Pair("h","H"),
Pair("i","I"),
Pair("j","J"),
Pair("k","K"),
Pair("l","L"),
Pair("m","M"),
Pair("n","N"),
Pair("o","O"),
Pair("p","P"),
Pair("q","Q"),
Pair("r","R"),
Pair("s","S"),
Pair("t","T"),
Pair("u","U"),
Pair("v","V"),
Pair("w","W"),
Pair("x","X"),
Pair("y","Y"),
Pair("z","Z")
Pair("---", "<Selecione>"),
Pair("a", "A"),
Pair("b", "B"),
Pair("c", "C"),
Pair("d", "D"),
Pair("e", "E"),
Pair("f", "F"),
Pair("g", "G"),
Pair("h", "H"),
Pair("i", "I"),
Pair("j", "J"),
Pair("k", "K"),
Pair("l", "L"),
Pair("m", "M"),
Pair("n", "N"),
Pair("o", "O"),
Pair("p", "P"),
Pair("q", "Q"),
Pair("r", "R"),
Pair("s", "S"),
Pair("t", "T"),
Pair("u", "U"),
Pair("v", "V"),
Pair("w", "W"),
Pair("x", "X"),
Pair("y", "Y"),
Pair("z", "Z")
))
open class UriPartFilter(displayName: String, private val vals: Array<Pair<String, String>>) :

View File

@ -1,8 +1,14 @@
package eu.kanade.tachiyomi.extension.pt.mangahost
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
@ -10,9 +16,6 @@ import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
class MangaHost : ParsedHttpSource() {
@ -104,9 +107,8 @@ class MangaHost : ParsedHttpSource() {
else -> SManga.UNKNOWN
}
override fun chapterListSelector(): String
= "ul.list_chapters li a, " +
"table.table-hover:not(.table-mangas) > tbody > tr"
override fun chapterListSelector(): String =
"ul.list_chapters li a, table.table-hover:not(.table-mangas) > tbody > tr"
override fun chapterFromElement(element: Element): SChapter {
val isNewLayout = element.tagName() == "a"
@ -170,7 +172,7 @@ class MangaHost : ParsedHttpSource() {
return GET(page.imageUrl!!, newHeaders)
}
private fun SimpleDateFormat.tryParseTime(date: String) : Long {
private fun SimpleDateFormat.tryParseTime(date: String): Long {
return try {
parse(date).time
} catch (e: ParseException) {

View File

@ -7,9 +7,17 @@ import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
@ -19,11 +27,6 @@ import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
import rx.Observable
import java.lang.Exception
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
abstract class MangasProject(
override val name: String,
@ -227,7 +230,7 @@ abstract class MangasProject(
}
}
private fun parseChapterDate(date: String?) : Long {
private fun parseChapterDate(date: String?): Long {
return try {
DATE_FORMATTER.parse(date).time
} catch (e: ParseException) {
@ -278,7 +281,7 @@ abstract class MangasProject(
return result["images"].array
.filter { it.string.startsWith("http") }
.mapIndexed { i, obj -> Page(i, chapterUrl, obj.string)}
.mapIndexed { i, obj -> Page(i, chapterUrl, obj.string) }
}
override fun fetchImageUrl(page: Page): Observable<String> = Observable.just(page.imageUrl!!)

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.pt.mangayabu
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.FormBody
import okhttp3.Headers
@ -119,7 +123,7 @@ class MangaYabu : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
return document.select("img.img-responsive.img-manga")
.mapIndexed { i, element -> Page(i, "", element.absUrl("src"))}
.mapIndexed { i, element -> Page(i, "", element.absUrl("src")) }
}
override fun imageUrlParse(document: Document) = ""

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.pt.saikaiscan
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.HttpUrl
@ -132,5 +136,4 @@ class SaikaiScan : ParsedHttpSource() {
private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36"
private val CHAPTER_REGEX = "Capítulo (\\d+)".toRegex()
}
}

View File

@ -1,13 +1,42 @@
package eu.kanade.tachiyomi.extension.pt.superhentais
import com.github.salomonbrys.kotson.*
import com.github.salomonbrys.kotson.array
import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.jsonArray
import com.github.salomonbrys.kotson.jsonObject
import com.github.salomonbrys.kotson.obj
import com.github.salomonbrys.kotson.string
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.component1
import kotlin.collections.component2
import kotlin.collections.emptyList
import kotlin.collections.first
import kotlin.collections.forEach
import kotlin.collections.isNotEmpty
import kotlin.collections.joinToString
import kotlin.collections.listOf
import kotlin.collections.map
import kotlin.collections.mapIndexed
import kotlin.collections.mapOf
import kotlin.collections.mutableListOf
import kotlin.collections.plus
import kotlin.collections.plusAssign
import kotlin.collections.set
import kotlin.collections.toMutableMap
import kotlin.collections.toTypedArray
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
@ -38,7 +67,7 @@ class SuperHentais : ParsedHttpSource() {
filterGenreDel: List<String> = emptyList(),
typeUrl: String = "hentai-manga",
page: Int = 1
) : Request {
): Request {
val filters = jsonObject(
"filter_data" to filterData.toUrlQueryParams(),
"filter_genre_add" to jsonArray(filterGenreAdd),
@ -64,7 +93,7 @@ class SuperHentais : ParsedHttpSource() {
return POST("$baseUrl/inc/paginator.inc.php", newHeaders, form)
}
private fun genericMangaFromElement(element: Element, imageAttr: String = "src") : SManga = SManga.create().apply {
private fun genericMangaFromElement(element: Element, imageAttr: String = "src"): SManga = SManga.create().apply {
title = element.select("img").first().attr("alt")
thumbnail_url = element.select("img").first().attr(imageAttr).changeSize()
setUrlWithoutDomain(element.attr("href"))
@ -200,7 +229,7 @@ class SuperHentais : ParsedHttpSource() {
val chapters = mutableListOf<SChapter>()
for (page in 1 .. totalPage) {
for (page in 1..totalPage) {
val result = client.newCall(chapterListPaginatedRequest(idCategory, page, totalPage, mangaUrl)).execute()
val apiResponse = result.asJsonObject()
@ -243,7 +272,7 @@ class SuperHentais : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
return document.select("div.capituloViewBox img.lazy")
.mapIndexed { i, element -> Page(i, "", element.absUrl("data-src"))}
.mapIndexed { i, element -> Page(i, "", element.absUrl("data-src")) }
}
override fun imageUrlParse(document: Document) = ""
@ -253,7 +282,7 @@ class SuperHentais : ParsedHttpSource() {
private class ContentFilter : Filter.Select<String>("Tipo de Conteúdo",
CONTENT_LIST.map { it.third }.toTypedArray())
private class LetterFilter: Filter.Select<String>("Letra inicial", LETTER_LIST)
private class LetterFilter : Filter.Select<String>("Letra inicial", LETTER_LIST)
private class StatusFilter : Filter.Select<String>("Status",
STATUS_LIST.map { it.second }.toTypedArray())
@ -382,13 +411,13 @@ class SuperHentais : ParsedHttpSource() {
private fun Response.asJsonObject(): JsonObject = JSON_PARSER.parse(body()!!.string()).obj
private fun Map<String, String>.toUrlQueryParams() : String =
private fun Map<String, String>.toUrlQueryParams(): String =
map { (k, v) -> "$k=$v" }.joinToString("&")
private fun FormBody.value(name: String): String {
return (0 until size())
.first { name(it) == name }
.let{ value(it) }
.let { value(it) }
}
companion object {
@ -413,7 +442,7 @@ class SuperHentais : ParsedHttpSource() {
)
private val LETTER_LIST = listOf("Todas", "Caracteres Especiais")
.plus(('A' .. 'Z').map { it.toString() })
.plus(('A'..'Z').map { it.toString() })
.toTypedArray()
private val CONTENT_LIST = listOf(

View File

@ -8,8 +8,16 @@ import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
@ -19,10 +27,6 @@ import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class UnionMangas : ParsedHttpSource() {
@ -131,7 +135,6 @@ class UnionMangas : ParsedHttpSource() {
val imgThumbnail = infoElement.select(".img-thumbnail").first()
val elTitle = infoElement.select("h2").first()
return SManga.create().apply {
title = elTitle!!.text().withoutLanguage()
author = elAuthor?.textWithoutLabel()
@ -164,7 +167,7 @@ class UnionMangas : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
return document.select("img.img-responsive.img-manga")
.filter { it.attr("src").contains("/leitor/") }
.mapIndexed { i, element -> Page(i, document.location(), element.absUrl("src"))}
.mapIndexed { i, element -> Page(i, document.location(), element.absUrl("src")) }
}
override fun imageUrlParse(document: Document) = ""
@ -202,7 +205,7 @@ class UnionMangas : ParsedHttpSource() {
}
}
private fun SimpleDateFormat.tryParseTime(date: String) : Long {
private fun SimpleDateFormat.tryParseTime(date: String): Long {
return try {
parse(date).time
} catch (e: ParseException) {

View File

@ -1,15 +1,22 @@
package eu.kanade.tachiyomi.extension.pt.zinnes
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Locale
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class Zinnes : ParsedHttpSource() {
@ -116,7 +123,7 @@ class Zinnes : ParsedHttpSource() {
override fun latestUpdatesFromElement(element: Element): SManga = throw Exception("This method should not be called!")
private fun parseChapterDate(date: String) : Long {
private fun parseChapterDate(date: String): Long {
return try {
SimpleDateFormat("dd MMM, yyyy", Locale("pt", "BR")).parse(date).time
} catch (e: ParseException) {

View File

@ -1,14 +1,18 @@
package eu.kanade.tachiyomi.extension.ru.acomics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.net.URLEncoder
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.net.URLEncoder
class AComics : ParsedHttpSource() {
@ -18,15 +22,16 @@ class AComics : ParsedHttpSource() {
override val lang = "ru"
val cookiesHeader by lazy {
private val cookiesHeader by lazy {
val cookies = mutableMapOf<String, String>()
cookies.put("ageRestrict", "17")
cookies["ageRestrict"] = "17"
buildCookies(cookies)
}
fun buildCookies(cookies: Map<String, String>) = cookies.entries.map {
private fun buildCookies(cookies: Map<String, String>) =
cookies.entries.joinToString(separator = "; ", postfix = ";") {
"${URLEncoder.encode(it.key, "UTF-8")}=${URLEncoder.encode(it.value, "UTF-8")}"
}.joinToString(separator = "; ", postfix = ";")
}
override val client = network.client.newBuilder()
.addNetworkInterceptor { chain ->
@ -39,7 +44,6 @@ class AComics : ParsedHttpSource() {
chain.proceed(newReq)
}.build()!!
override val supportsLatest = true
override fun popularMangaRequest(page: Int): Request =
@ -114,7 +118,6 @@ class AComics : ParsedHttpSource() {
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select(".about-summary").first()
val manga = SManga.create()
@ -149,7 +152,6 @@ class AComics : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> {
val imageElement = document.select("img#mainImage").first()
return listOf(Page(0, imageUrl = baseUrl + imageElement.attr("src")))
}
override fun imageUrlParse(document: Document) = ""
@ -168,7 +170,6 @@ class AComics : ParsedHttpSource() {
Rating("18+", 6)
))
override fun getFilterList() = FilterList(
Status(),
RatingList(),
@ -190,5 +191,4 @@ class AComics : ParsedHttpSource() {
Genre("Стимпанк", 12),
Genre("Супергерои", 13)
)
}

View File

@ -1,16 +1,22 @@
package eu.kanade.tachiyomi.extension.ru.anibe
import com.github.salomonbrys.kotson.fromJson
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.keys
import com.google.gson.Gson
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import com.google.gson.Gson
import com.github.salomonbrys.kotson.*
import okhttp3.Response
import com.google.gson.JsonObject
class Anibe : ParsedHttpSource() {
@ -91,7 +97,7 @@ class Anibe : ParsedHttpSource() {
manga.author = jsonManga["author"].asString
val status = jsonManga["status"].asString
manga.status = parseStatus(status)
manga.genre = jsonManga["genre"].toString().substringAfter("[").substringBefore("]").replace("\"" ,"").replace("," ," ")
manga.genre = jsonManga["genre"].toString().substringAfter("[").substringBefore("]").replace("\"", "").replace(",", " ")
manga.description = jsonManga["description"].asString
manga.thumbnail_url = jsonManga["cover"].asString
return manga
@ -114,7 +120,7 @@ class Anibe : ParsedHttpSource() {
override fun chapterListParse(response: Response): List<SChapter> {
val allChapters = mutableListOf<SChapter>()
val jsonManga = gson.fromJson<JsonObject>(response.body()!!.string())
val jsonChapters = jsonManga["episodes"].asJsonObject.keys().sortedWith(Comparator<String>{ a, b ->
val jsonChapters = jsonManga["episodes"].asJsonObject.keys().sortedWith(Comparator<String> { a, b ->
when {
a.substringBefore("_").toInt() < b.substringBefore("_").toInt() -> 1
a.substringBefore("_").toInt() > b.substringBefore("_").toInt() -> -1
@ -160,5 +166,4 @@ class Anibe : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList()
}

View File

@ -9,7 +9,13 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import okhttp3.Cookie
import okhttp3.CookieJar
import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
@ -38,7 +44,6 @@ class ComX : ParsedHttpSource() {
.build())
}
}
})
.build()
@ -50,11 +55,9 @@ class ComX : ParsedHttpSource() {
override fun latestUpdatesSelector() = "ul.last-comix li"
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/comix/page/$page/", headers)
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/comix/page/$page/", headers)
override fun latestUpdatesRequest(page: Int): Request =
GET(baseUrl, headers)
override fun latestUpdatesRequest(page: Int): Request = GET(baseUrl, headers)
override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
@ -76,7 +79,6 @@ class ComX : ParsedHttpSource() {
return manga
}
override fun popularMangaNextPageSelector() = "div.nextprev:last-child"
override fun latestUpdatesNextPageSelector(): Nothing? = null
@ -114,8 +116,8 @@ class ComX : ParsedHttpSource() {
if (!text.contains("Добавить описание на комикс")) {
val fromRemove = "Отслеживать"
val toRemove = "Читать комикс"
val desc = text.removeRange(0, text.indexOf(fromRemove)+fromRemove.length)
manga.description = desc.removeRange(desc.indexOf(toRemove)+toRemove.length, desc.length)
val desc = text.removeRange(0, text.indexOf(fromRemove) + fromRemove.length)
manga.description = desc.removeRange(desc.indexOf(toRemove) + toRemove.length, desc.length)
}
val src = infoElement.select("img").attr("src")
@ -139,11 +141,11 @@ class ComX : ParsedHttpSource() {
override fun chapterListSelector() = "li[id^=cmx-]"
private fun chapterResponseParse(document: Document) : List<SChapter> {
private fun chapterResponseParse(document: Document): List<SChapter> {
return document.select(chapterListSelector()).map { chapterFromElement(it) }
}
private fun chapterPageListParse(document: Document) : List<String> {
private fun chapterPageListParse(document: Document): List<String> {
return document.select("span[class=\"\"]").map { it -> it.text() }
}
@ -192,10 +194,9 @@ class ComX : ParsedHttpSource() {
val urls: List<String> = html.substring(beginIndex + beginTag.length, endIndex)
.split(',')
val pages = mutableListOf<Page>()
for (i in urls.indices) {
pages.add(Page(i, "", link+(urls[i].removeSurrounding("'"))))
pages.add(Page(i, "", link + (urls[i].removeSurrounding("'"))))
}
return pages
}

View File

@ -1,14 +1,19 @@
package eu.kanade.tachiyomi.extension.ru.desu
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import java.util.ArrayList
import okhttp3.Headers
import okhttp3.Request
import okhttp3.Response
import org.json.JSONArray
import org.json.JSONObject
import java.util.*
class Desu : HttpSource() {
override val name = "Desu"
@ -59,7 +64,6 @@ class Desu : HttpSource() {
}
}
override fun popularMangaRequest(page: Int) = GET("$baseUrl/?limit=50&order=popular&page=$page")
override fun popularMangaParse(response: Response) = searchMangaParse(response)
@ -76,7 +80,7 @@ class Desu : HttpSource() {
when (filter) {
is OrderBy -> url += "&order=" + arrayOf("popular", "updated", "name")[filter.state]
is TypeList -> filter.state.forEach { type -> if (type.state) types.add(type) }
is GenreList -> filter.state.forEach {genre -> if (genre.state) genres.add(genre) }
is GenreList -> filter.state.forEach { genre -> if (genre.state) genres.add(genre) }
}
}
@ -99,7 +103,7 @@ class Desu : HttpSource() {
val count = nav.getInt("count")
val limit = nav.getInt("limit")
val page = nav.getInt("page")
return mangaPageFromJSON(obj.toString(), count > page*limit)
return mangaPageFromJSON(obj.toString(), count > page * limit)
}
override fun mangaDetailsParse(response: Response) = SManga.create().apply {
@ -127,7 +131,7 @@ class Desu : HttpSource() {
val id = obj2.getString("id")
url = "/$cid/chapter/$id"
chapter_number = ch.toFloat()
date_upload = obj2.getLong("date")*1000
date_upload = obj2.getLong("date") * 1000
})
}
return ret
@ -144,8 +148,8 @@ class Desu : HttpSource() {
return ret
}
override fun imageUrlParse(response: Response)
= throw UnsupportedOperationException("This method should not be called!")
override fun imageUrlParse(response: Response) =
throw UnsupportedOperationException("This method should not be called!")
private class OrderBy : Filter.Select<String>("Сортировка",
arrayOf("Популярность", "Дата", "Имя"))

View File

@ -8,19 +8,23 @@ import com.google.gson.JsonArray
import com.google.gson.JsonObject
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.net.URL
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.net.URL
import java.text.SimpleDateFormat
import java.util.*
class Henchan : ParsedHttpSource() {
@ -52,8 +56,8 @@ class Henchan : ParsedHttpSource() {
} else {
var genres = ""
var order = ""
filters.forEach {filter ->
when(filter){
filters.forEach { filter ->
when (filter) {
is GenreList -> {
filter.state
.filter { !it.isIgnored() }
@ -65,7 +69,7 @@ class Henchan : ParsedHttpSource() {
}
if (genres.isNotEmpty()) {
filters.forEach {filter ->
filters.forEach { filter ->
when (filter) {
is OrderBy -> {
order = filter.toUriPartWithGenres()
@ -73,8 +77,8 @@ class Henchan : ParsedHttpSource() {
}
}
"$baseUrl/tags/${genres.dropLast(1)}&sort=manga$order?offset=${20 * (page - 1)}"
}else{
filters.forEach {filter ->
} else {
filters.forEach { filter ->
when (filter) {
is OrderBy -> {
order = filter.toUriPartWithoutGenres()
@ -97,8 +101,8 @@ class Henchan : ParsedHttpSource() {
val isExHenManga = this.contains("/manganew_thumbs_blur/")
val regex = "(?<=/)manganew_thumbs\\w*?(?=/)".toRegex(RegexOption.IGNORE_CASE)
return this.replace(regex, "showfull_retina/manga")
.replace("_".plus(URL(baseUrl).host), "_hentaichan.ru") //domain-related replacing for very old mangas
.plus(if(isExHenManga) {"#"} else {""})// # for later so we know what type manga is it
.replace("_".plus(URL(baseUrl).host), "_hentaichan.ru") // domain-related replacing for very old mangas
.plus(if (isExHenManga) { "#" } else { "" }) // # for later so we know what type manga is it
}
override fun popularMangaFromElement(element: Element): SManga {
@ -148,7 +152,7 @@ class Henchan : ParsedHttpSource() {
val document = response.asJsoup()
// exhentai chapter
if(responseUrl.contains("/manga/")){
if (responseUrl.contains("/manga/")) {
val chap = SChapter.create()
chap.setUrlWithoutDomain(responseUrl)
chap.name = document.select("a.title_top_a").text()
@ -170,7 +174,7 @@ class Henchan : ParsedHttpSource() {
.replace("\\\"", "\"")
.replace("\\'", "'")
chap.chapter_number = 1F
chap.date_upload = Date().time //setting to current date because of a sorting in the "Recent updates" section
chap.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section
return listOf(chap)
}
@ -203,7 +207,7 @@ class Henchan : ParsedHttpSource() {
val chapterName = element.select("h2 a").attr("title")
chapter.name = chapterName
chapter.chapter_number = "(глава\\s|часть\\s)(\\d+)".toRegex(RegexOption.IGNORE_CASE).find(chapterName)?.groupValues?.get(2)?.toFloat() ?: 0F
chapter.date_upload = Date().time //setting to current date because of a sorting in the "Recent updates" section
chapter.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section
return chapter
}
@ -240,8 +244,8 @@ class Henchan : ParsedHttpSource() {
private open class UriPartFilter(displayName: String, sortNames: Array<String>, val withGenres: Array<Pair<String, String>>, val withoutGenres: Array<Pair<String, String>>) :
Filter.Sort(displayName, sortNames, Selection(1, false)) {
fun toUriPartWithGenres() = if(state!!.ascending) withGenres[state!!.index].first else withGenres[state!!.index].second
fun toUriPartWithoutGenres() = if(state!!.ascending) withoutGenres[state!!.index].first else withoutGenres[state!!.index].second
fun toUriPartWithGenres() = if (state!!.ascending) withGenres[state!!.index].first else withGenres[state!!.index].second
fun toUriPartWithoutGenres() = if (state!!.ascending) withoutGenres[state!!.index].first else withoutGenres[state!!.index].second
}
override fun getFilterList() = FilterList(

View File

@ -4,25 +4,40 @@ import android.app.Application
import android.content.SharedPreferences
import android.support.v7.preference.ListPreference
import android.support.v7.preference.PreferenceScreen
import com.github.salomonbrys.kotson.*
import android.util.Base64.decode as base64Decode
import com.github.salomonbrys.kotson.array
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.nullArray
import com.github.salomonbrys.kotson.nullInt
import com.github.salomonbrys.kotson.nullString
import com.github.salomonbrys.kotson.obj
import com.github.salomonbrys.kotson.string
import com.google.gson.JsonElement
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.*
import android.util.Base64.decode as base64Decode
class LibManga : ConfigurableSource, HttpSource() {
@ -209,12 +224,11 @@ class LibManga : ConfigurableSource, HttpSource() {
val teams = jsonParser.parse(element.attr("data-teams"))
val team = teams[0]["slug"].nullString
val baseUrl = "${element.baseUri()}/v$volume/c$number"
val url = if (team != null) "${baseUrl}/$team" else baseUrl
val url = if (team != null) "$baseUrl/$team" else baseUrl
chapter.setUrlWithoutDomain(url)
}
chapter.name = element.select("div.chapter-item__name").first().text()
chapter.date_upload = SimpleDateFormat("dd.MM.yyyy", Locale.US)
.parse(element.select("div.chapter-item__date").text()).time

View File

@ -2,16 +2,21 @@ package eu.kanade.tachiyomi.extension.ru.mangachan
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class Mangachan : ParsedHttpSource() {
@ -30,7 +35,6 @@ class Mangachan : ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build()
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/mostfavorites?offset=${20 * (page - 1)}", headers)
@ -226,14 +230,12 @@ class Mangachan : ParsedHttpSource() {
arrayOf("Дата", "Популярность", "Имя", "Главы"),
Filter.Sort.Selection(1, false))
override fun getFilterList() = FilterList(
Status(),
OrderBy(),
GenreList(getGenreList())
)
/* [...document.querySelectorAll("li.sidetag > a:nth-child(1)")]
* .map(el => `Genre("${el.getAttribute('href').substr(6)}")`).join(',\n')
* on https://mangachan.me/

View File

@ -9,17 +9,17 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.FormBody
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class Mangaclub : ParsedHttpSource() {
//Info
// Info
override val name: String = "MangaClub"
override val baseUrl: String = "https://mangaclub.ru"
@ -27,7 +27,7 @@ class Mangaclub : ParsedHttpSource() {
override val supportsLatest: Boolean = true
override val client: OkHttpClient = network.cloudflareClient
//Popular
// Popular
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/f/order_by=news_read/order=desc/page/$page/", headers)
@ -42,7 +42,7 @@ class Mangaclub : ParsedHttpSource() {
}
}
//Latest
// Latest
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/page/$page/", headers)
override fun latestUpdatesNextPageSelector(): String? = popularMangaNextPageSelector()
@ -50,7 +50,7 @@ class Mangaclub : ParsedHttpSource() {
override fun latestUpdatesFromElement(element: Element): SManga =
popularMangaFromElement(element)
//Search
// Search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
if (query.isNotBlank()) {
val formBody = FormBody.Builder()
@ -97,8 +97,7 @@ class Mangaclub : ParsedHttpSource() {
override fun searchMangaSelector(): String = popularMangaSelector()
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
//Details
// Details
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
thumbnail_url = document.select("img[title].img-responsive").attr("abs:src")
title = document.select(".title").text().substringBefore("/").trim()
@ -113,7 +112,7 @@ class Mangaclub : ParsedHttpSource() {
genre = document.select("div.more-info a[href*=tags]").joinToString(", ") { it.text() }
}
//Chapters
// Chapters
override fun chapterListSelector(): String = ".chapter-main"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
@ -127,8 +126,7 @@ class Mangaclub : ParsedHttpSource() {
return SimpleDateFormat("dd.MM.yyyy", Locale.US).parse(date)?.time ?: 0
}
//Pages
// Pages
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
document.select(".manga-lines-page a").forEach {
add(Page(it.attr("data-p").toInt(), "", it.attr("abs:data-i")))
@ -138,7 +136,7 @@ class Mangaclub : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String =
throw Exception("imageUrlParse Not Used")
//Filters
// Filters
private class Categories(values: Array<Pair<String, String>>) :
Filter.Select<String>("Категории", values.map { it.first }.toTypedArray())

View File

@ -7,13 +7,13 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
open class Mangahub : ParsedHttpSource() {
@ -30,7 +30,6 @@ open class Mangahub : ParsedHttpSource() {
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build()
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/explore?filter[sort]=rating&filter[dateStart][left_number]=1900&filter[dateStart][right_number]=2099&page=$page", headers)

View File

@ -6,15 +6,20 @@ import com.github.salomonbrys.kotson.string
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class MangaOnlineBiz : ParsedHttpSource() {
override val name = "MangaOnlineBiz"
@ -94,7 +99,6 @@ class MangaOnlineBiz : ParsedHttpSource() {
return manga
}
override fun latestUpdatesFromElement(element: Element): SManga =
popularMangaFromElement(element)

View File

@ -3,17 +3,25 @@ package eu.kanade.tachiyomi.extension.ru.mintmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.regex.Pattern
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
class Mintmanga : ParsedHttpSource() {

View File

@ -1,17 +1,20 @@
package eu.kanade.tachiyomi.extension.ru.nudemoon
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.net.URLEncoder
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.net.URLEncoder
import java.text.SimpleDateFormat
import java.util.Locale
class Nudemoon : ParsedHttpSource() {
@ -30,14 +33,14 @@ class Nudemoon : ParsedHttpSource() {
GET("$baseUrl/all_manga?date&rowstart=${30 * (page - 1)}", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
//Search by query on this site works really badly, i don't even sure of the need to implement it
// Search by query on this site works really badly, i don't even sure of the need to implement it
val url = if (query.isNotEmpty()) {
"$baseUrl/search?stext=${URLEncoder.encode(query, "CP1251")}&rowstart=${30 * (page - 1)}"
}else{
} else {
var genres = ""
var order = ""
for (filter in if (filters.isEmpty()) getFilterList() else filters) {
when(filter){
when (filter) {
is GenreList -> {
filter.state.forEach { f ->
if (f.state) {
@ -52,17 +55,17 @@ class Nudemoon : ParsedHttpSource() {
for (filter in filters) {
when (filter) {
is OrderBy -> {
//The site has no ascending order
// The site has no ascending order
order = arrayOf("&date", "&views", "&like")[filter.state!!.index]
}
}
}
"$baseUrl/tags/${genres.dropLast(1)}$order&rowstart=${30 * (page - 1)}"
}else{
} else {
for (filter in filters) {
when (filter) {
is OrderBy -> {
//The site has no ascending order
// The site has no ascending order
order = arrayOf("all_manga?date", "all_manga?views", "all_manga?like")[filter.state!!.index]
}
}
@ -83,7 +86,7 @@ class Nudemoon : ParsedHttpSource() {
val manga = SManga.create()
manga.thumbnail_url = element.select("img[class^=news]").attr("abs:src")
element.select("a:has(h2)").let{
element.select("a:has(h2)").let {
manga.title = it.text()
manga.setUrlWithoutDomain(it.attr("href"))
}
@ -115,7 +118,7 @@ class Nudemoon : ParsedHttpSource() {
override fun chapterListRequest(manga: SManga): Request {
val chapterUrl = if(manga.title.contains("\\s#\\d+".toRegex()))
val chapterUrl = if (manga.title.contains("\\s#\\d+".toRegex()))
"/vse_glavy/" + manga.title.split("\\s#\\d+".toRegex())[0].replace("\\W".toRegex(), "_")
else
manga.url
@ -129,11 +132,11 @@ class Nudemoon : ParsedHttpSource() {
val responseUrl = response.request().url().toString()
val document = response.asJsoup()
if(!responseUrl.contains("/vse_glavy/")){
if (!responseUrl.contains("/vse_glavy/")) {
return listOf(chapterFromElement(document))
}
//Order chapters by its number 'cause on the site they are in random order
// Order chapters by its number 'cause on the site they are in random order
return document.select(chapterListSelector()).sortedByDescending {
val regex = "#(\\d+)".toRegex()
val chapterName = it.select("img[class^=news]").first().parent().attr("title")
@ -147,13 +150,13 @@ class Nudemoon : ParsedHttpSource() {
val infoElem = element.select("tr[valign=top]").first().parent()
val chapterName = infoElem.select("h1, h2").text()
var chapterUrl = infoElem.select("a[title]:has(img)").attr("href")
if(!chapterUrl.contains("-online")) {
if (!chapterUrl.contains("-online")) {
chapterUrl = chapterUrl.replace("/\\d+".toRegex(), "$0-online")
} else {
chapter.chapter_number = 1F
}
chapter.setUrlWithoutDomain(if(!chapterUrl.startsWith("/")) "/$chapterUrl" else chapterUrl)
chapter.setUrlWithoutDomain(if (!chapterUrl.startsWith("/")) "/$chapterUrl" else chapterUrl)
chapter.name = chapterName
chapter.date_upload = infoElem.text().substringAfter("Дата:").substringBefore("Просмотров").trim().let {
try {
@ -172,7 +175,6 @@ class Nudemoon : ParsedHttpSource() {
return Regex("""images\[(\d+)].src\s=\s'(http.*)'""").findAll(imgScript).map {
Page(it.groupValues[1].toInt(), imageUrl = it.groupValues[2])
}.toList()
}
override fun imageUrlParse(document: Document) = throw Exception("Not Used")

View File

@ -1,19 +1,23 @@
package eu.kanade.tachiyomi.extension.ru.onlinecomics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers
import okhttp3.Request
import okhttp3.Response
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class Onlinecomics: ParsedHttpSource() {
class Onlinecomics : ParsedHttpSource() {
override fun searchMangaFromElement(element: Element): SManga {
throw Exception("Not used")
}
@ -65,7 +69,6 @@ class Onlinecomics: ParsedHttpSource() {
popularMangaFromElement(element)
}
val hasNextPage = popularMangaNextPageSelector().let { selector ->
document.select(selector).first()
} != null
@ -114,7 +117,6 @@ class Onlinecomics: ParsedHttpSource() {
val result = mangaList.filter { it.url.isNotEmpty() }.distinctBy { it.url }
return MangasPage(result, false)
}
override fun mangaDetailsParse(document: Document): SManga {
@ -134,7 +136,7 @@ class Onlinecomics: ParsedHttpSource() {
"Жанры:"
}
val end = "Тип:"
val tempString = text.removeRange(0, text.indexOf(begin)+begin.length)
val tempString = text.removeRange(0, text.indexOf(begin) + begin.length)
manga.genre = tempString.removeRange(tempString.indexOf(end), tempString.length).trim()
manga.status = parseStatus(infoElement.text())
@ -146,7 +148,6 @@ class Onlinecomics: ParsedHttpSource() {
manga.description = document.select(".remark").text()
}
return manga
}
private fun parseStatus(element: String): Int = when {
@ -160,7 +161,6 @@ class Onlinecomics: ParsedHttpSource() {
val chapterList = mutableListOf<SChapter>()
chapterList.addAll(document.select(chapterListSelector()).map { chapterFromElement(it) })
val lastPage: String? = document.select("div.navigationG .C").last()?.text()
if (lastPage != null) {
(2..lastPage.toInt()).forEach { i ->

View File

@ -3,17 +3,25 @@ package eu.kanade.tachiyomi.extension.ru.readmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.regex.Pattern
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
class Readmanga : ParsedHttpSource() {

View File

@ -20,7 +20,6 @@ import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class RisensTeam : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> = throw Exception("Not Used")
@ -37,18 +36,18 @@ class RisensTeam : ParsedHttpSource() {
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/manga/page/$page/", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request{
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
return POST(baseUrl, headers, buildRequestBody(query, page))
}
private fun buildRequestBody(query: String, page: Int): RequestBody{
private fun buildRequestBody(query: String, page: Int): RequestBody {
return MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("do", "search")
.addFormDataPart("subaction", "search")
.addFormDataPart("story", query)
.addFormDataPart("catlist[]", "33")
.addFormDataPart("search_start", (page-1).toString())
.addFormDataPart("search_start", (page - 1).toString())
.build()
}
@ -60,7 +59,7 @@ class RisensTeam : ParsedHttpSource() {
val manga = SManga.create()
val coverElem = element.select(".card-img-top").first()
val imgUrl = coverElem.attr("src")
manga.thumbnail_url = baseUrl + if(imgUrl.contains("/pagespeed_static/")) coverElem.attr("data-pagespeed-lazy-src") else imgUrl
manga.thumbnail_url = baseUrl + if (imgUrl.contains("/pagespeed_static/")) coverElem.attr("data-pagespeed-lazy-src") else imgUrl
manga.setUrlWithoutDomain(element.select("b-link").first().attr("to"))
manga.title = coverElem.attr("alt").split('/').first().replace("(Манга)", "").trim()
@ -86,7 +85,7 @@ class RisensTeam : ParsedHttpSource() {
manga.thumbnail_url = baseUrl + document.select("b-img[fluid]").first().attr("src")
manga.genre = document.select("td:containsOwn(Жанр:) + td > a").joinToString { it.ownText() }
manga.description = document.select(".news-body").text()
manga.status = when(document.select("td:containsOwn(Состояние:) + td").first().ownText()){
manga.status = when (document.select("td:containsOwn(Состояние:) + td").first().ownText()) {
"Выход продолжается" -> SManga.ONGOING
"Выход завершён", "Выход завершен" -> SManga.COMPLETED
else -> SManga.UNKNOWN

View File

@ -1,18 +1,22 @@
package eu.kanade.tachiyomi.extension.ru.selfmanga
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.regex.Pattern
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
class Selfmanga : ParsedHttpSource() {
@ -196,7 +200,6 @@ class Selfmanga : ParsedHttpSource() {
GenreList(getGenreList())
)
private fun getCategoryList() = listOf(
Genre("Артбук", "el_5894"),
Genre("Веб", "el_2160"),

View File

@ -1,8 +1,9 @@
package eu.kanade.tachiyomi.extension.th.nekopost
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
import java.util.ArrayList
import java.util.Locale
import org.jsoup.nodes.Element
class NPArrayList<E>(c: Collection<E>, val mangaList: List<Element>) : ArrayList<E>(c) {
override fun isEmpty(): Boolean = mangaList.isEmpty()
@ -12,13 +13,11 @@ class NPArrayList<E>(c: Collection<E>, val mangaList: List<Element>) : ArrayList
fun isListEmpty(): Boolean = super.isEmpty()
fun isListNotEmpty(): Boolean = !isListEmpty()
}
object NPUtils {
private val urlWithoutDomainFromFullUrlRegex: Regex = Regex("^https://www\\.nekopost\\.net/manga/(.*)$")
fun getMangaOrChapterAlias(url: String): String {
val (urlWithoutDomain) = urlWithoutDomainFromFullUrlRegex.find(url)!!.destructured
return urlWithoutDomain

View File

@ -2,9 +2,17 @@ package eu.kanade.tachiyomi.extension.th.nekopost
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import java.net.URL
import java.util.Calendar
import java.util.Locale
import okhttp3.Request
import okhttp3.Response
import org.json.JSONArray
@ -13,10 +21,6 @@ import org.json.JSONObject
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.net.URL
import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashSet
class Nekopost() : ParsedHttpSource() {
override val baseUrl: String = "https://www.nekopost.net/manga/"

Some files were not shown because too many files have changed in this diff Show More