Lint fixes

This commit is contained in:
arkon 2020-04-24 23:15:45 -04:00 committed by arkon
parent 60ef2bea02
commit 5d5c6016ea
77 changed files with 644 additions and 588 deletions

View File

@ -1,16 +1,19 @@
package eu.kanade.tachiyomi.extension.all.boommanga package eu.kanade.tachiyomi.extension.all.boommanga
import eu.kanade.tachiyomi.network.GET 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 eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
open class BoomManga( open class BoomManga(
override val name: String, override val name: String,
@ -39,7 +42,6 @@ open class BoomManga (
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
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 chapterListRequest(manga: SManga) = mangaDetailsRequest(manga)
override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers) override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers)
@ -124,10 +126,7 @@ open class BoomManga (
return url return url
} }
override fun pageListParse(document: Document) = throw Exception("Not used") override fun pageListParse(document: Document) = throw Exception("Not used")
override fun imageUrlRequest(page: Page) = throw Exception("Not used") override fun imageUrlRequest(page: Page) = throw Exception("Not used")
override fun imageUrlParse(document: Document) = throw Exception("Not used") override fun imageUrlParse(document: Document) = throw Exception("Not used")
} }

View File

@ -6,7 +6,6 @@ import eu.kanade.tachiyomi.source.model.SManga
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
class BoomMangaFactory : SourceFactory { class BoomMangaFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(
BoomMangacom(), BoomMangacom(),

View File

@ -115,7 +115,6 @@ abstract class Ciayo(override val lang: String) : HttpSource() {
} != null } != null
return MangasPage(mangas, hasNextPage) return MangasPage(mangas, hasNextPage)
} }
private fun searchMangaSelector() = "div.ais-Hits li.ais-Hits-item" private fun searchMangaSelector() = "div.ais-Hits li.ais-Hits-item"
@ -126,7 +125,6 @@ abstract class Ciayo(override val lang: String) : HttpSource() {
title = this.text().trim() title = this.text().trim()
url = this.attr("href") url = this.attr("href")
} }
} }
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
@ -169,7 +167,6 @@ abstract class Ciayo(override val lang: String) : HttpSource() {
date_upload = it["release_date"].long * 1000 date_upload = it["release_date"].long * 1000
} }
} }
} }
// Pages // Pages
@ -179,9 +176,7 @@ abstract class Ciayo(override val lang: String) : HttpSource() {
document.select("div.chapterViewer img").forEach { document.select("div.chapterViewer img").forEach {
add(Page(size, "", it.attr("abs:src"))) add(Page(size, "", it.attr("abs:src")))
} }
} }
override fun imageUrlParse(response: Response): String = throw Exception("ImgParse Not Used") override fun imageUrlParse(response: Response): String = throw Exception("ImgParse Not Used")
} }

View File

@ -13,5 +13,3 @@ class CiayoFactory : SourceFactory {
class CiayoID : Ciayo("id") class CiayoID : Ciayo("id")
class CiayoEN : Ciayo("en") class CiayoEN : Ciayo("en")

View File

@ -9,12 +9,12 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import java.text.SimpleDateFormat
import okhttp3.Headers import okhttp3.Headers
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import java.text.SimpleDateFormat
abstract class ComiCake( abstract class ComiCake(
override val name: String, override val name: String,

View File

@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.net.URLEncoder
import okhttp3.CacheControl import okhttp3.CacheControl
import okhttp3.CookieJar import okhttp3.CookieJar
import okhttp3.Headers import okhttp3.Headers
@ -18,7 +19,6 @@ import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.net.URLEncoder
open class EHentai(override val lang: String, private val ehLang: String) : HttpSource() { open class EHentai(override val lang: String, private val ehLang: String) : HttpSource() {
@ -66,8 +66,11 @@ open class EHentai(override val lang: String, private val ehLang: String) : Http
/** /**
* Recursively fetch chapter pages * Recursively fetch chapter pages
*/ */
private fun fetchChapterPage(chapter: SChapter, np: String, private fun fetchChapterPage(
pastUrls: List<String> = emptyList()): Observable<List<String>> { chapter: SChapter,
np: String,
pastUrls: List<String> = emptyList()
): Observable<List<String>> {
val urls = ArrayList(pastUrls) val urls = ArrayList(pastUrls)
return chapterPageCall(np).flatMap { return chapterPageCall(np).flatMap {
val jsoup = it.asJsoup() val jsoup = it.asJsoup()

View File

@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.util.Calendar
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -16,7 +17,6 @@ import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.Calendar
/** /**
* For sites based on the Flat-Manga CMS * For sites based on the Flat-Manga CMS

View File

@ -11,16 +11,16 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.net.URLEncoder
import okhttp3.FormBody import okhttp3.FormBody
import okhttp3.Headers
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import okhttp3.Headers
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.net.URLEncoder
class FMReaderFactory : SourceFactory { class FMReaderFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(

View File

@ -10,17 +10,17 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.FormBody
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Date import java.util.Date
import java.util.HashSet import java.util.HashSet
import java.util.Locale import java.util.Locale
import okhttp3.FormBody
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
abstract class FoolSlide( abstract class FoolSlide(
override val name: String, override val name: String,
@ -115,8 +115,8 @@ abstract class FoolSlide(
// if there's no image on the details page, get the first page of the first chapter // if there's no image on the details page, get the first page of the first chapter
fun getDetailsThumbnail(document: Document, urlSelector: String = chapterUrlSelector): String? { fun getDetailsThumbnail(document: Document, urlSelector: String = chapterUrlSelector): String? {
return document.select("div.thumbnail img, table.thumb img").firstOrNull()?.attr("abs:src") ?: return document.select("div.thumbnail img, table.thumb img").firstOrNull()?.attr("abs:src")
document.select(chapterListSelector()).last().select(urlSelector).attr("abs:href") ?: document.select(chapterListSelector()).last().select(urlSelector).attr("abs:href")
.let { url -> client.newCall(allowAdult(GET(url, headers))).execute() } .let { url -> client.newCall(allowAdult(GET(url, headers))).execute() }
.let { response -> pageListParse(response).first().imageUrl } .let { response -> pageListParse(response).first().imageUrl }
} }

View File

@ -8,12 +8,12 @@ import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.net.URLEncoder
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.net.URLEncoder
class HentaiCafe : FoolSlide("Hentai Cafe", "https://hentai.cafe", "en", "/manga") { class HentaiCafe : FoolSlide("Hentai Cafe", "https://hentai.cafe", "en", "/manga") {
// We have custom latest updates logic so do not dedupe latest updates // We have custom latest updates logic so do not dedupe latest updates
@ -121,8 +121,8 @@ class HentaiCafe : FoolSlide("Hentai Cafe", "https://hentai.cafe", "en", "/manga
if (!response.isSuccessful) { if (!response.isSuccessful) {
response.close() response.close()
// Better error message for invalid artist // Better error message for invalid artist
if (response.code() == 404 if (response.code() == 404 &&
&& !filters.findInstance<ArtistFilter>()?.state.isNullOrBlank()) !filters.findInstance<ArtistFilter>()?.state.isNullOrBlank())
error("Invalid artist!") error("Invalid artist!")
else throw Exception("HTTP error ${response.code()}") else throw Exception("HTTP error ${response.code()}")
} }

View File

@ -8,15 +8,15 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.jsoup.select.Elements import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
abstract class Genkan( abstract class Genkan(
override val name: String, override val name: String,
@ -239,5 +239,4 @@ abstract class GenkanOriginal(
override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element) override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element)
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
} }

View File

@ -22,6 +22,9 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import okhttp3.Credentials import okhttp3.Credentials
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
@ -33,8 +36,6 @@ import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers import rx.schedulers.Schedulers
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.*
open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
override fun popularMangaRequest(page: Int): Request = override fun popularMangaRequest(page: Int): Request =
@ -151,8 +152,8 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
private fun SeriesDto.toSManga(): SManga = private fun SeriesDto.toSManga(): SManga =
SManga.create().apply { SManga.create().apply {
title = metadata.title title = metadata.title
url = "/api/v1/series/${id}" url = "/api/v1/series/$id"
thumbnail_url = "$baseUrl/api/v1/series/${id}/thumbnail" thumbnail_url = "$baseUrl/api/v1/series/$id/thumbnail"
status = when (metadata.status) { status = when (metadata.status) {
"ONGOING" -> SManga.ONGOING "ONGOING" -> SManga.ONGOING
"ENDED" -> SManga.COMPLETED "ENDED" -> SManga.COMPLETED
@ -239,8 +240,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
setOnPreferenceChangeListener { _, newValue -> setOnPreferenceChangeListener { _, newValue ->
try { try {
val res = preferences.edit().putString(title, newValue as String).commit() val res = preferences.edit().putString(title, newValue as String).commit()
Toast.makeText(context, "Restart Tachiyomi to apply new setting." Toast.makeText(context, "Restart Tachiyomi to apply new setting.", Toast.LENGTH_LONG).show()
, Toast.LENGTH_LONG).show()
res res
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
@ -267,8 +267,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
setOnPreferenceChangeListener { _, newValue -> setOnPreferenceChangeListener { _, newValue ->
try { try {
val res = preferences.edit().putString(title, newValue as String).commit() val res = preferences.edit().putString(title, newValue as String).commit()
Toast.makeText(context, "Restart Tachiyomi to apply new setting." Toast.makeText(context, "Restart Tachiyomi to apply new setting.", Toast.LENGTH_LONG).show()
, Toast.LENGTH_LONG).show()
res res
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
@ -295,7 +294,6 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
emptyList() emptyList()
} }
}, {}) }, {})
} }
companion object { companion object {

View File

@ -11,5 +11,4 @@ class KomgaFactory : SourceFactory {
Komga("2"), Komga("2"),
Komga("3") Komga("3")
) )
} }

View File

@ -11,7 +11,11 @@ import eu.kanade.tachiyomi.extension.all.lanraragi.model.ArchivePage
import eu.kanade.tachiyomi.extension.all.lanraragi.model.ArchiveSearchResult import eu.kanade.tachiyomi.extension.all.lanraragi.model.ArchiveSearchResult
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource 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.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response

View File

@ -11,22 +11,22 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.CacheControl
import okhttp3.FormBody
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.RequestBody
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Date import java.util.Date
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import okhttp3.CacheControl
import okhttp3.FormBody
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
abstract class Madara( abstract class Madara(
override val name: String, override val name: String,

View File

@ -10,6 +10,8 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -17,8 +19,6 @@ import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class MadaraFactory : SourceFactory { class MadaraFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(
@ -351,7 +351,6 @@ class DoujinHentai : Madara("DoujinHentai", "https://doujinhentai.net", "es", Si
} else { } else {
super.searchMangaFromElement(element) // query search results super.searchMangaFromElement(element) // query search results
} }
} }
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
@ -451,7 +450,6 @@ class YaoiToshokan : Madara("Yaoi Toshokan", "https://www.yaoitoshokan.com.br",
Page(index, "", element.select("img").attr("data-src").trim()) // had to add trim because of white space in source Page(index, "", element.select("img").attr("data-src").trim()) // had to add trim because of white space in source
} }
} }
} }
class GoldenManga : Madara("موقع لترجمة المانجا", "https://golden-manga.ml", "ar", SimpleDateFormat("yyyy-MM-dd", Locale.US)) class GoldenManga : Madara("موقع لترجمة المانجا", "https://golden-manga.ml", "ar", SimpleDateFormat("yyyy-MM-dd", Locale.US))

View File

@ -7,16 +7,16 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
// Based off of Mangakakalot 1.2.8 // Based off of Mangakakalot 1.2.8

View File

@ -3,14 +3,14 @@ package eu.kanade.tachiyomi.extension.all.mangabox
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Request
import okhttp3.Response
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import okhttp3.Request
import okhttp3.Response
class MangaBoxFactory : SourceFactory { class MangaBoxFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(

View File

@ -4,7 +4,14 @@ import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.support.v7.preference.ListPreference import android.support.v7.preference.ListPreference
import android.support.v7.preference.PreferenceScreen import android.support.v7.preference.PreferenceScreen
import com.github.salomonbrys.kotson.* import com.github.salomonbrys.kotson.forEach
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.keys
import com.github.salomonbrys.kotson.long
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.JsonElement
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.google.gson.JsonParser import com.google.gson.JsonParser
@ -13,20 +20,30 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservable
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.ConfigurableSource 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.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.* import java.net.URLEncoder
import java.util.Date
import java.util.concurrent.TimeUnit
import kotlin.collections.set
import okhttp3.CacheControl
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.jsoup.parser.Parser import org.jsoup.parser.Parser
import rx.Observable import rx.Observable
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.net.URLEncoder
import java.util.Date
import java.util.concurrent.TimeUnit
import kotlin.collections.set
abstract class Mangadex( abstract class Mangadex(
override val lang: String, override val lang: String,
@ -34,7 +51,6 @@ abstract class Mangadex(
) : ConfigurableSource, ParsedHttpSource() { ) : ConfigurableSource, ParsedHttpSource() {
init { init {
} }
override val name = "MangaDex" override val name = "MangaDex"
@ -130,7 +146,6 @@ abstract class Mangadex(
element.let { element.let {
manga.setUrlWithoutDomain(modifyMangaUrl(it.attr("href"))) manga.setUrlWithoutDomain(modifyMangaUrl(it.attr("href")))
manga.title = it.text().trim() manga.title = it.text().trim()
} }
manga.thumbnail_url = formThumbUrl(manga.url) manga.thumbnail_url = formThumbUrl(manga.url)
@ -331,7 +346,7 @@ abstract class Mangadex(
searchMangaFromElement(element) searchMangaFromElement(element)
} }
val hasNextPage = searchMangaNextPageSelector()?.let { selector -> val hasNextPage = searchMangaNextPageSelector().let { selector ->
document.select(selector).first() document.select(selector).first()
} != null } != null
@ -389,7 +404,7 @@ abstract class Mangadex(
val chapterJson = json.getAsJsonObject("chapter") val chapterJson = json.getAsJsonObject("chapter")
manga.title = cleanString(mangaJson.get("title").string) manga.title = cleanString(mangaJson.get("title").string)
manga.thumbnail_url = cdnUrl + mangaJson.get("cover_url").string manga.thumbnail_url = cdnUrl + mangaJson.get("cover_url").string
manga.description = cleanString(mangadexDescription.clean(internalLang, mangaJson.get("description").string)) manga.description = cleanString(mangadexDescription.clean(mangaJson.get("description").string))
manga.author = cleanString(mangaJson.get("author").string) manga.author = cleanString(mangaJson.get("author").string)
manga.artist = cleanString(mangaJson.get("artist").string) manga.artist = cleanString(mangaJson.get("artist").string)
val status = mangaJson.get("status").int val status = mangaJson.get("status").int

View File

@ -14,12 +14,12 @@ class MangadexDescription(private val internalLang: String) {
else -> emptyList() else -> emptyList()
} }
fun clean(internalLang: String, description: String): String { fun clean(description: String): String {
val langList = ALL_LANGS.toMutableList() val langList = ALL_LANGS.toMutableList()
// remove any languages before the ones provided in the langTextToCheck, if no matches or empty // remove any languages before the ones provided in the langTextToCheck, if no matches or empty
// just uses the original description, also removes the potential lang from all lang list // just uses the original description, also removes the potential lang from all lang list
var newDescription = description; var newDescription = description
listOfLangs.forEach { it -> listOfLangs.forEach { it ->
newDescription = newDescription.substringAfter(it) newDescription = newDescription.substringAfter(it)
langList.remove(it) langList.remove(it)

View File

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

View File

@ -12,14 +12,14 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers import okhttp3.Headers
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import rx.Observable import rx.Observable
import java.text.SimpleDateFormat
import java.util.Locale
/** /**
* MangAdventure base source. * MangAdventure base source.
@ -73,7 +73,9 @@ abstract class MangAdventure(
override fun mangaDetailsRequest(manga: SManga) = GET(manga.url, headers) override fun mangaDetailsRequest(manga: SManga) = GET(manga.url, headers)
override fun searchMangaRequest( override fun searchMangaRequest(
page: Int, query: String, filters: FilterList page: Int,
query: String,
filters: FilterList
): Request { ): Request {
val uri = Uri.parse("$apiUrl/series/").buildUpon() val uri = Uri.parse("$apiUrl/series/").buildUpon()
if (query.startsWith(SLUG_QUERY)) { if (query.startsWith(SLUG_QUERY)) {

View File

@ -33,5 +33,4 @@ class MangAdventureActivity : Activity() {
private fun logInvalidIntent(intent: Intent) = Log.e( private fun logInvalidIntent(intent: Intent) = Log.e(
"MangAdventureActivity", "Failed to parse URI from intent: $intent" "MangAdventureActivity", "Failed to parse URI from intent: $intent"
) )
} }

View File

@ -3,10 +3,10 @@ package eu.kanade.tachiyomi.extension.all.mangadventure
import android.net.Uri import android.net.Uri
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import java.text.DecimalFormat
import okhttp3.Response import okhttp3.Response
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import java.text.DecimalFormat
/** Returns the body of a response as a `String`. */ /** Returns the body of a response as a `String`. */
fun Response.asString(): String = body()!!.string() fun Response.asString(): String = body()!!.string()

View File

@ -14,8 +14,13 @@ import com.squareup.duktape.Duktape
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.ConfigurableSource 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.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import java.util.UUID
import kotlinx.serialization.protobuf.ProtoBuf import kotlinx.serialization.protobuf.ProtoBuf
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
@ -28,8 +33,6 @@ import okhttp3.ResponseBody
import rx.Observable import rx.Observable
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.lang.Exception
import java.util.UUID
abstract class MangaPlus( abstract class MangaPlus(
override val lang: String, override val lang: String,

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.all.mangaplus package eu.kanade.tachiyomi.extension.all.mangaplus
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kotlinx.serialization.protobuf.ProtoId
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.Serializer import kotlinx.serialization.Serializer
import kotlinx.serialization.protobuf.ProtoId
@Serializer(forClass = MangaPlusResponse::class) @Serializer(forClass = MangaPlusResponse::class)
object MangaPlusSerializer object MangaPlusSerializer

View File

@ -7,14 +7,14 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.util.Calendar
import java.util.concurrent.TimeUnit
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import org.json.JSONObject import org.json.JSONObject
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.Calendar
import java.util.concurrent.TimeUnit
open class Mangatensei(override val lang: String, private val Mtlang: String) : ParsedHttpSource() { open class Mangatensei(override val lang: String, private val Mtlang: String) : ParsedHttpSource() {
@ -392,7 +392,6 @@ open class Mangatensei(override val lang: String, private val Mtlang: String) :
} }
private class Tag(name: String) : Filter.CheckBox(name) private class Tag(name: String) : Filter.CheckBox(name)
} }
abstract class OtherSite(private val sourceName: String, private val sourceBaseUrl: String, private val tachiLang: String, private val sourceLang: String) : Mangatensei(tachiLang, sourceLang) { abstract class OtherSite(private val sourceName: String, private val sourceBaseUrl: String, private val tachiLang: String, private val sourceLang: String) : Mangatensei(tachiLang, sourceLang) {

View File

@ -155,5 +155,3 @@ class BatotoSpanish : OtherSite("Bato.to", "https://bato.to", "es", "spanish")
class BatotoThai : OtherSite("Bato.to", "https://bato.to", "th", "thai") class BatotoThai : OtherSite("Bato.to", "https://bato.to", "th", "thai")
class BatotoTurkish : OtherSite("Bato.to", "https://bato.to", "tr", "turkish") class BatotoTurkish : OtherSite("Bato.to", "https://bato.to", "tr", "turkish")
class BatotoVietnamese : OtherSite("Bato.to", "https://bato.to", "vi", "vietnamese") class BatotoVietnamese : OtherSite("Bato.to", "https://bato.to", "vi", "vietnamese")

View File

@ -1,16 +1,19 @@
package eu.kanade.tachiyomi.extension.all.mangatoon package eu.kanade.tachiyomi.extension.all.mangatoon
import eu.kanade.tachiyomi.network.GET 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 eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
open class MangaToon( open class MangaToon(
override val lang: String, override val lang: String,
@ -30,7 +33,6 @@ open class MangaToon (
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
val page0 = page - 1 val page0 = page - 1
return GET("$baseUrl/$urllang/genre/hot?page=$page0", headers) return GET("$baseUrl/$urllang/genre/hot?page=$page0", headers)
@ -48,7 +50,6 @@ open class MangaToon (
// override fun pageListRequest(chapter: SChapter) = GET(baseUrl + chapter.url, headers) // override fun pageListRequest(chapter: SChapter) = GET(baseUrl + chapter.url, headers)
override fun chapterListRequest(manga: SManga) = GET(baseUrl + manga.url + "/episodes", headers) override fun chapterListRequest(manga: SManga) = GET(baseUrl + manga.url + "/episodes", headers)
override fun popularMangaFromElement(element: Element) = mangaFromElement(element) override fun popularMangaFromElement(element: Element) = mangaFromElement(element)
override fun latestUpdatesFromElement(element: Element) = mangaFromElement(element) override fun latestUpdatesFromElement(element: Element) = mangaFromElement(element)
override fun searchMangaFromElement(element: Element): SManga { override fun searchMangaFromElement(element: Element): SManga {
@ -114,6 +115,4 @@ open class MangaToon (
override fun pageListParse(document: Document) = throw Exception("Not used") override fun pageListParse(document: Document) = throw Exception("Not used")
override fun imageUrlRequest(page: Page) = throw Exception("Not used") override fun imageUrlRequest(page: Page) = throw Exception("Not used")
override fun imageUrlParse(document: Document) = throw Exception("Not used") override fun imageUrlParse(document: Document) = throw Exception("Not used")
} }

View File

@ -4,10 +4,6 @@ import android.annotation.SuppressLint
import android.annotation.TargetApi import android.annotation.TargetApi
import android.os.Build import android.os.Build
import com.google.gson.Gson import com.google.gson.Gson
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import java.io.PrintWriter import java.io.PrintWriter
import java.security.cert.CertificateException import java.security.cert.CertificateException
import java.time.ZonedDateTime import java.time.ZonedDateTime
@ -16,6 +12,10 @@ import java.util.concurrent.TimeUnit
import javax.net.ssl.SSLContext import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager import javax.net.ssl.X509TrustManager
import okhttp3.OkHttpClient
import okhttp3.Request
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
/** /**
* This class generates the sources for MMRCMS. * This class generates the sources for MMRCMS.
@ -78,10 +78,8 @@ class Generator {
val toJson = Gson().toJson(map) val toJson = Gson().toJson(map)
buffer.append("private const val MMRSOURCE_$number = \"\"\"$toJson\"\"\"\n") buffer.append("private const val MMRSOURCE_$number = \"\"\"$toJson\"\"\"\n")
number++ number++
} catch (e: Exception) { } catch (e: Exception) {
println("error generating source ${it.second} ${e.printStackTrace()}") println("error generating source ${it.second} ${e.printStackTrace()}")
} }
@ -104,7 +102,6 @@ class Generator {
val writer = PrintWriter(relativePath) val writer = PrintWriter(relativePath)
writer.write(buffer.toString()) writer.write(buffer.toString())
writer.close() writer.close()
} else { } else {
val writer = PrintWriter(relativePathTest) val writer = PrintWriter(relativePathTest)
writer.write(buffer.toString()) writer.write(buffer.toString())
@ -158,7 +155,6 @@ class Generator {
array.add(map) array.add(map)
} }
return array return array
} }
private fun getItemUrl(document: Document): String { private fun getItemUrl(document: Document): String {
@ -190,7 +186,6 @@ class Generator {
return array return array
} }
@Throws(Exception::class) @Throws(Exception::class)
private fun getOkHttpClient(): OkHttpClient { private fun getOkHttpClient(): OkHttpClient {
val trustAllCerts = arrayOf<TrustManager>(object : X509TrustManager { val trustAllCerts = arrayOf<TrustManager>(object : X509TrustManager {
@ -227,7 +222,6 @@ class Generator {
.build() .build()
} }
companion object { companion object {
const val DRY_RUN = false const val DRY_RUN = false
val sources = listOf( val sources = listOf(
@ -319,7 +313,6 @@ class Generator {
val relativePath = System.getProperty("user.dir") + "/src/all/mmrcms/src/eu/kanade/tachiyomi/extension/all/mmrcms/GeneratedSources.kt" val relativePath = System.getProperty("user.dir") + "/src/all/mmrcms/src/eu/kanade/tachiyomi/extension/all/mmrcms/GeneratedSources.kt"
val relativePathTest = System.getProperty("user.dir") + "/src/all/mmrcms/TestGeneratedSources.kt" val relativePathTest = System.getProperty("user.dir") + "/src/all/mmrcms/TestGeneratedSources.kt"
@JvmStatic @JvmStatic
fun main(args: Array<String>) { fun main(args: Array<String>) {
Generator().generate() Generator().generate()

View File

@ -16,22 +16,24 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
class MyMangaReaderCMSSource(override val lang: String, class MyMangaReaderCMSSource(
override val lang: String,
override val name: String, override val name: String,
override val baseUrl: String, override val baseUrl: String,
override val supportsLatest: Boolean, override val supportsLatest: Boolean,
private val itemUrl: String, private val itemUrl: String,
private val categoryMappings: List<Pair<String, String>>, private val categoryMappings: List<Pair<String, String>>,
private val tagMappings: List<Pair<String, String>>?) : HttpSource() { private val tagMappings: List<Pair<String, String>>?
) : HttpSource() {
private val jsonParser = JsonParser() private val jsonParser = JsonParser()
private val itemUrlPath = Uri.parse(itemUrl).pathSegments.firstOrNull() private val itemUrlPath = Uri.parse(itemUrl).pathSegments.firstOrNull()
private val parsedBaseUrl = Uri.parse(baseUrl) private val parsedBaseUrl = Uri.parse(baseUrl)
@ -349,9 +351,13 @@ class MyMangaReaderCMSSource(override val lang: String,
* If `firstIsUnspecified` is set to true, if the first entry is selected, nothing will be appended on the 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 UriSelectFilter(displayName: String, private val uriParam: String, private val vals: Array<Pair<String, String>>, open class UriSelectFilter(
displayName: String,
private val uriParam: String,
private val vals: Array<Pair<String, String>>,
private val firstIsUnspecified: Boolean = true, private val firstIsUnspecified: Boolean = true,
defaultValue: Int = 0) : defaultValue: Int = 0
) :
Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter { Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter {
override fun addToUri(uri: Uri.Builder) { override fun addToUri(uri: Uri.Builder) {
if (state != 0 || !firstIsUnspecified) if (state != 0 || !firstIsUnspecified)

View File

@ -86,5 +86,3 @@ class MyMangaReaderCMSSources : SourceFactory {
it["id"].string to it["name"].string it["id"].string to it["name"].string
} }
} }

View File

@ -3,9 +3,17 @@ package eu.kanade.tachiyomi.extension.all.myreadingmanga
import android.net.Uri import android.net.Uri
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.CacheControl import okhttp3.CacheControl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -13,9 +21,6 @@ import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
open class MyReadingManga(override val lang: String) : ParsedHttpSource() { open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
@ -56,7 +61,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
} }
for (element in list) { for (element in list) {
mangas.add(latestUpdatesFromElement(element)) mangas.add(latestUpdatesFromElement(element))
} }
val hasNextPage = latestUpdatesNextPageSelector().let { selector -> val hasNextPage = latestUpdatesNextPageSelector().let { selector ->
@ -74,7 +78,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
Uri.parse("$baseUrl/search/").buildUpon() Uri.parse("$baseUrl/search/").buildUpon()
.appendQueryParameter("search", query) .appendQueryParameter("search", query)
.appendQueryParameter("wpsolr_page", page.toString()) .appendQueryParameter("wpsolr_page", page.toString())
} else { } else {
val uri = Uri.parse("$baseUrl/").buildUpon() val uri = Uri.parse("$baseUrl/").buildUpon()
// Append uri filters // Append uri filters
@ -124,7 +127,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
} }
for (element in list) { for (element in list) {
mangas.add(latestUpdatesFromElement(element)) mangas.add(latestUpdatesFromElement(element))
} }
val hasNextPage = latestUpdatesNextPageSelector().let { selector -> val hasNextPage = latestUpdatesNextPageSelector().let { selector ->
@ -137,7 +139,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
override fun searchMangaFromElement(element: Element) = buildManga(element.select("a").first(), element.select("img")?.first()) override fun searchMangaFromElement(element: Element) = buildManga(element.select("a").first(), element.select("img")?.first())
// Build Manga From Element // Build Manga From Element
private fun buildManga(titleElement: Element, thumbnailElement: Element?): SManga { private fun buildManga(titleElement: Element, thumbnailElement: Element?): SManga {
val manga = SManga.create() val manga = SManga.create()
@ -168,7 +169,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
private fun cleanAuthor(author: String) = author.substringAfter("[").substringBefore("]").trim() private fun cleanAuthor(author: String) = author.substringAfter("[").substringBefore("]").trim()
// Manga Details // Manga Details
override fun fetchMangaDetails(manga: SManga): Observable<SManga> { override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
val needCover = manga.thumbnail_url.isNullOrEmpty() val needCover = manga.thumbnail_url.isNullOrEmpty()
@ -204,7 +204,6 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document) = throw Exception("Not used") override fun mangaDetailsParse(document: Document) = throw Exception("Not used")
// Start Chapter Get // Start Chapter Get
override fun chapterListSelector() = ".entry-pagination a" override fun chapterListSelector() = ".entry-pagination a"
@ -318,9 +317,13 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
* If `firstIsUnspecified` is set to true, if the first entry is selected, nothing will be appended on the 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 UriSelectFilterPath(displayName: String, val uriParam: String, val vals: Array<Pair<String, String>>, private open class UriSelectFilterPath(
displayName: String,
val uriParam: String,
val vals: Array<Pair<String, String>>,
val firstIsUnspecified: Boolean = true, val firstIsUnspecified: Boolean = true,
defaultValue: Int = 0) : defaultValue: Int = 0
) :
Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter { Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter {
override fun addToUri(uri: Uri.Builder) { override fun addToUri(uri: Uri.Builder) {
if (state != 0 || !firstIsUnspecified) if (state != 0 || !firstIsUnspecified)
@ -329,14 +332,17 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
} }
} }
private open class UriSelectFilterShortPath(displayName: String, val uriParam: String, val vals: Array<Pair<String, String>>, private open class UriSelectFilterShortPath(
displayName: String,
val uriParam: String,
val vals: Array<Pair<String, String>>,
val firstIsUnspecified: Boolean = true, val firstIsUnspecified: Boolean = true,
defaultValue: Int = 0) : defaultValue: Int = 0
) :
Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter { Filter.Select<String>(displayName, vals.map { it.second }.toTypedArray(), defaultValue), UriFilter {
override fun addToUri(uri: Uri.Builder) { override fun addToUri(uri: Uri.Builder) {
if (state != 0 || !firstIsUnspecified) if (state != 0 || !firstIsUnspecified)
uri.appendPath(vals[state].first) uri.appendPath(vals[state].first)
} }
} }
@ -346,6 +352,4 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() {
private interface UriFilter { private interface UriFilter {
fun addToUri(uri: Uri.Builder) fun addToUri(uri: Uri.Builder)
} }
} }

View File

@ -4,7 +4,6 @@ package eu.kanade.tachiyomi.extension.all.myreadingmanga
* MyReadingManga languages * MyReadingManga languages
*/ */
class MyReadingMangaEnglish : MyReadingManga("en") class MyReadingMangaEnglish : MyReadingManga("en")
fun getAllMyReadingMangaLanguages() = listOf( fun getAllMyReadingMangaLanguages() = listOf(

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.all.nhentai package eu.kanade.tachiyomi.extension.all.nhentai
import java.text.SimpleDateFormat
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
object NHUtils { object NHUtils {
fun getArtists(document: Document): String { fun getArtists(document: Document): String {

View File

@ -259,5 +259,4 @@ open class NHentai(
const val PREFIX_ID_SEARCH = "id:" const val PREFIX_ID_SEARCH = "id:"
private const val TITLE_PREF = "Display manga title as:" private const val TITLE_PREF = "Display manga title as:"
} }
} }

View File

@ -17,7 +17,6 @@ class Tag(
val type: Int = 1 val type: Int = 1
) : Filter.TriState(name) ) : Filter.TriState(name)
data class SearchRequest( data class SearchRequest(
val text: String, val text: String,
val page: Int, val page: Int,

View File

@ -1520,5 +1520,4 @@ object NHTags {
Tag(id = 21354, name = "Zinkurou"), Tag(id = 21354, name = "Zinkurou"),
Tag(id = 290, name = "Zombie") Tag(id = 290, name = "Zombie")
) )
} }

View File

@ -9,13 +9,22 @@ import com.google.gson.JsonElement
import com.google.gson.JsonParser import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess 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.source.online.ParsedHttpSource
import okhttp3.* import java.util.Date
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.util.*
open class NineHentai : ParsedHttpSource() { open class NineHentai : ParsedHttpSource() {

View File

@ -7,14 +7,14 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Locale import java.util.Locale
import okhttp3.HttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
open class NineManga(override val name: String, override val baseUrl: String, override val lang: String) : ParsedHttpSource() { open class NineManga(override val name: String, override val baseUrl: String, override val lang: String) : ParsedHttpSource() {

View File

@ -4,13 +4,13 @@ import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.Headers
import okhttp3.Request
import org.jsoup.nodes.Element
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import java.util.Locale import java.util.Locale
import okhttp3.Headers
import okhttp3.Request
import org.jsoup.nodes.Element
class NineMangaFactory : SourceFactory { class NineMangaFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(

View File

@ -1,13 +1,17 @@
package eu.kanade.tachiyomi.extension.all.noisemanga package eu.kanade.tachiyomi.extension.all.noisemanga
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import okhttp3.* import okhttp3.Headers
import okhttp3.Request
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
import java.lang.Exception
abstract class NoiseManga(override val lang: String) : ParsedHttpSource() { abstract class NoiseManga(override val lang: String) : ParsedHttpSource() {

View File

@ -7,7 +7,11 @@ import com.github.salomonbrys.kotson.string
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonObject import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -16,7 +20,6 @@ import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
abstract class SimplyHentai( abstract class SimplyHentai(
override val lang: String, override val lang: String,
private val urlLang: String, private val urlLang: String,

View File

@ -26,4 +26,3 @@ class SimplyHentaiRU: SimplyHentai("ru", "russian", "7")
class SimplyHentaiFR : SimplyHentai("fr", "french", "3") class SimplyHentaiFR : SimplyHentai("fr", "french", "3")
class SimplyHentaiDE : SimplyHentai("de", "german", "4") class SimplyHentaiDE : SimplyHentai("de", "german", "4")
class SimplyHentaiPT : SimplyHentai("pt", "portuguese", "6") class SimplyHentaiPT : SimplyHentai("pt", "portuguese", "6")

View File

@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.extension.all.toomics
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.Locale
class ToomicsFactory : SourceFactory { class ToomicsFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(

View File

@ -2,24 +2,29 @@ package eu.kanade.tachiyomi.extension.all.toomics
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.model.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.source.online.ParsedHttpSource
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Headers
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
import java.net.URLDecoder import java.net.URLDecoder
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
abstract class ToomicsGlobal(private val siteLang: String, abstract class ToomicsGlobal(
private val siteLang: String,
private val dateFormat: SimpleDateFormat, private val dateFormat: SimpleDateFormat,
override val lang: String = siteLang, override val lang: String = siteLang,
displayName: String = "") : ParsedHttpSource() { displayName: String = ""
) : ParsedHttpSource() {
override val name = "Toomics (Only free chapters)" + (if (displayName.isNotEmpty()) " ($displayName)" else "") override val name = "Toomics (Only free chapters)" + (if (displayName.isNotEmpty()) " ($displayName)" else "")

View File

@ -5,13 +5,13 @@ import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers import okhttp3.Headers
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class DongmanManhua : WebtoonsDefault("zh", "") { class DongmanManhua : WebtoonsDefault("zh", "") {
override val baseUrl = "https://www.dongmanmanhua.cn" override val baseUrl = "https://www.dongmanmanhua.cn"

View File

@ -1,13 +1,20 @@
package eu.kanade.tachiyomi.extension.all.webtoons package eu.kanade.tachiyomi.extension.all.webtoons
import eu.kanade.tachiyomi.network.GET 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.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.* import java.util.Calendar
import okhttp3.Cookie
import okhttp3.CookieJar
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.Calendar
abstract class Webtoons( abstract class Webtoons(
override val lang: String, override val lang: String,
@ -36,7 +43,6 @@ abstract class Webtoons(
.build() .build()
) )
} }
}) })
.build() .build()
@ -166,5 +172,4 @@ abstract class Webtoons(
} }
override fun imageUrlParse(document: Document): String = document.select("img").first().attr("src") override fun imageUrlParse(document: Document): String = document.select("img").first().attr("src")
} }

View File

@ -4,10 +4,10 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import java.text.SimpleDateFormat
import java.util.Locale
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
open class WebtoonsDefault( open class WebtoonsDefault(
override val lang: String, override val lang: String,

View File

@ -2,7 +2,12 @@ package eu.kanade.tachiyomi.extension.all.webtoons
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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 java.util.ArrayList
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.Request import okhttp3.Request
@ -10,7 +15,6 @@ import okhttp3.Response
import org.json.JSONObject import org.json.JSONObject
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.*
import rx.Observable import rx.Observable
open class WebtoonsTranslate(override val lang: String, private val translateLangCode: String, languageNameExtra: String = "") : Webtoons(lang) { open class WebtoonsTranslate(override val lang: String, private val translateLangCode: String, languageNameExtra: String = "") : Webtoons(lang) {
@ -218,5 +222,4 @@ open class WebtoonsTranslate(override val lang: String, private val translateLan
} }
return ret return ret
} }
} }

View File

@ -1,15 +1,18 @@
package eu.kanade.tachiyomi.extension.all.wpcomics package eu.kanade.tachiyomi.extension.all.wpcomics
import eu.kanade.tachiyomi.network.GET 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 eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.Calendar
abstract class WPComics( abstract class WPComics(
override val name: String, override val name: String,
@ -40,7 +43,6 @@ abstract class WPComics(
setUrlWithoutDomain(it.attr("abs:href")) setUrlWithoutDomain(it.attr("abs:href"))
} }
thumbnail_url = imageOrNull(element.select("div.image:first-of-type img").first()) thumbnail_url = imageOrNull(element.select("div.image:first-of-type img").first())
} }
} }

View File

@ -6,10 +6,10 @@ import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.Request
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import okhttp3.Request
import org.jsoup.nodes.Element
class WPComicsFactory : SourceFactory { class WPComicsFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( override fun createSources(): List<Source> = listOf(

View File

@ -8,8 +8,16 @@ import android.support.v7.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource 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.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import java.util.concurrent.TimeUnit
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -18,11 +26,6 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.lang.UnsupportedOperationException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.Calendar
import java.util.concurrent.TimeUnit
abstract class WPMangaStream( abstract class WPMangaStream(
override val name: String, override val name: String,
@ -88,7 +91,6 @@ abstract class WPMangaStream(
.addNetworkInterceptor(rateLimitInterceptor) .addNetworkInterceptor(rateLimitInterceptor)
.build() .build()
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/manga/page/$page/?order=popular", headers) return GET("$baseUrl/manga/page/$page/?order=popular", headers)
} }

View File

@ -5,13 +5,17 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
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.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.HttpUrl
import okhttp3.Interceptor
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import okhttp3.Interceptor
import okhttp3.HttpUrl
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
@ -851,8 +855,8 @@ class MangaRaw : WPMangaStream("Manga Raw", "https://mangaraw.org", "ja") {
} }
override fun popularMangaNextPageSelector() = "a[rel=next]" override fun popularMangaNextPageSelector() = "a[rel=next]"
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/search?order=update&page=$page", headers) override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/search?order=update&page=$page", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request =
= GET("$baseUrl/search?s=$query&page=$page") GET("$baseUrl/search?s=$query&page=$page")
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> { override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
return client.newCall(pageListRequest(chapter)) return client.newCall(pageListRequest(chapter))

View File

@ -160,5 +160,4 @@ class MangaAe : ParsedHttpSource() {
override fun getFilterList() = FilterList( override fun getFilterList() = FilterList(
OrderByFilter() OrderByFilter()
) )
} }

View File

@ -1,7 +1,10 @@
package eu.kanade.tachiyomi.extension.ar.mangalink package eu.kanade.tachiyomi.extension.ar.mangalink
import eu.kanade.tachiyomi.network.GET 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 eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -99,5 +102,4 @@ class MangaLink : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.ar.shqqaa package eu.kanade.tachiyomi.extension.ar.shqqaa
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -116,5 +120,4 @@ class Shqqaa : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }

View File

@ -1,15 +1,19 @@
package eu.kanade.tachiyomi.extension.ar.teamx package eu.kanade.tachiyomi.extension.ar.teamx
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.util.concurrent.TimeUnit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.concurrent.TimeUnit
class TeamX : ParsedHttpSource() { class TeamX : ParsedHttpSource() {
@ -132,5 +136,4 @@ class TeamX : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }

View File

@ -8,17 +8,24 @@ import com.google.gson.JsonObject
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess 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.source.online.ParsedHttpSource
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.lang.Exception
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import rx.Observable
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
class MangaTube : ParsedHttpSource() { class MangaTube : ParsedHttpSource() {

View File

@ -6,13 +6,13 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class WieManga : ParsedHttpSource() { class WieManga : ParsedHttpSource() {
@ -134,5 +134,4 @@ class WieManga : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String { override fun imageUrlParse(document: Document): String {
return document.select("img#comicpic").first().attr("abs:src") return document.select("img#comicpic").first().attr("abs:src")
} }
} }

View File

@ -9,7 +9,11 @@ import com.google.gson.JsonObject
import com.google.gson.JsonParser import com.google.gson.JsonParser
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.source.online.ParsedHttpSource
import okhttp3.HttpUrl import okhttp3.HttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -46,7 +50,6 @@ class BoredomSociety : ParsedHttpSource() {
} }
} }
override fun popularMangaParse(response: Response): MangasPage { override fun popularMangaParse(response: Response): MangasPage {
val jsonArray = getJsonArray(response) val jsonArray = getJsonArray(response)
val list = parseData(jsonArray.toList()) val list = parseData(jsonArray.toList())
@ -95,10 +98,10 @@ class BoredomSociety : ParsedHttpSource() {
val chapterName = mutableListOf<String>() val chapterName = mutableListOf<String>()
if (!jsonElement["chapter_name"].string.startsWith("Chapter", true)) { if (!jsonElement["chapter_name"].string.startsWith("Chapter", true)) {
if (jsonElement["chapter_volume"].string?.isNotBlank()) { if (jsonElement["chapter_volume"].string.isNotBlank()) {
chapterName.add("Vol. " + jsonElement["chapter_volume"].string) chapterName.add("Vol. " + jsonElement["chapter_volume"].string)
} }
if (jsonElement["chapter_number"].string?.isNotBlank()) { if (jsonElement["chapter_number"].string.isNotBlank()) {
chapterName.add("Ch. " + jsonElement["chapter_number"].string + " - ") chapterName.add("Ch. " + jsonElement["chapter_number"].string + " - ")
} }
} }
@ -152,7 +155,6 @@ class BoredomSociety : ParsedHttpSource() {
return mutableChapters return mutableChapters
} }
override fun pageListParse(document: Document) = throw Exception("Not used") override fun pageListParse(document: Document) = throw Exception("Not used")
override fun pageListParse(response: Response): List<Page> { override fun pageListParse(response: Response): List<Page> {
@ -208,5 +210,4 @@ class BoredomSociety : ParsedHttpSource() {
private const val ALL_URL = "/api/titles/" private const val ALL_URL = "/api/titles/"
private const val CHAPTER_URL = "/api/chapter/" private const val CHAPTER_URL = "/api/chapter/"
} }
} }

View File

@ -1,8 +1,11 @@
package eu.kanade.tachiyomi.extension.en.clonemanga package eu.kanade.tachiyomi.extension.en.clonemanga
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Request import okhttp3.Request
@ -11,7 +14,6 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import rx.Observable import rx.Observable
class CloneManga : ParsedHttpSource() { class CloneManga : ParsedHttpSource() {
override val name = "Clone Manga" override val name = "Clone Manga"
@ -120,5 +122,4 @@ class CloneManga : ParsedHttpSource() {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { throw Exception("Not used") } override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { throw Exception("Not used") }
override fun searchMangaSelector(): String { throw Exception("Not used") } override fun searchMangaSelector(): String { throw Exception("Not used") }
} }

View File

@ -7,15 +7,18 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.ArrayList
import java.util.Calendar
import java.util.Date
import java.util.Locale
import java.util.regex.Pattern
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
class ComicExtra : ParsedHttpSource() { class ComicExtra : ParsedHttpSource() {
@ -162,4 +165,3 @@ class ComicExtra : ParsedHttpSource() {
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("Unused method was called somehow!") override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("Unused method was called somehow!")
} }

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.en.comicpunch package eu.kanade.tachiyomi.extension.en.comicpunch
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -149,5 +153,4 @@ class Comicpunch : ParsedHttpSource() {
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }

View File

@ -4,7 +4,11 @@ import android.os.Build.VERSION
import eu.kanade.tachiyomi.extension.BuildConfig import eu.kanade.tachiyomi.extension.BuildConfig
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET 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.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat import java.text.SimpleDateFormat

View File

@ -24,5 +24,4 @@ class DynastyAnthologies : DynastyScans() {
parseDescription(document, manga) parseDescription(document, manga)
return manga return manga
} }
} }

View File

@ -5,12 +5,12 @@ import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.*
class DynastyChapters : DynastyScans() { class DynastyChapters : DynastyScans() {
override val name = "Dynasty-Chapters" override val name = "Dynasty-Chapters"
@ -96,5 +96,4 @@ class DynastyChapters : DynastyScans() {
override fun popularMangaParse(response: Response) = searchMangaParse(response) override fun popularMangaParse(response: Response) = searchMangaParse(response)
override fun latestUpdatesParse(response: Response) = searchMangaParse(response) override fun latestUpdatesParse(response: Response) = searchMangaParse(response)
} }

View File

@ -72,5 +72,4 @@ class DynastyDoujins : DynastyScans() {
override fun imageUrlParse(document: Document): String { override fun imageUrlParse(document: Document): String {
return document.select("div.image img").attr("abs:src") return document.select("div.image img").attr("abs:src")
} }
} }

View File

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.extension.en.dynasty
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
class DynastyFactory : SourceFactory { class DynastyFactory : SourceFactory {
override fun createSources(): List<Source> = getAllDynasty() override fun createSources(): List<Source> = getAllDynasty()
} }

View File

@ -24,5 +24,4 @@ class DynastyIssues : DynastyScans() {
parseDescription(document, manga) parseDescription(document, manga)
return manga return manga
} }
} }

View File

@ -8,6 +8,9 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.text.SimpleDateFormat
import java.util.ArrayList
import java.util.Locale
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.json.JSONArray import org.json.JSONArray
@ -16,8 +19,6 @@ import org.jsoup.nodes.Element
import org.jsoup.nodes.Node import org.jsoup.nodes.Node
import org.jsoup.nodes.TextNode import org.jsoup.nodes.TextNode
import org.jsoup.select.Elements import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.*
abstract class DynastyScans : ParsedHttpSource() { abstract class DynastyScans : ParsedHttpSource() {
@ -110,7 +111,6 @@ abstract class DynastyScans : ParsedHttpSource() {
} }
} }
protected fun parseDescription(document: Document, manga: SManga) { protected fun parseDescription(document: Document, manga: SManga) {
manga.description = document.select("div.tags > div.row div.description").text() manga.description = document.select("div.tags > div.row div.description").text()
} }
@ -228,5 +228,4 @@ abstract class DynastyScans : ParsedHttpSource() {
override fun latestUpdatesRequest(page: Int): Request { override fun latestUpdatesRequest(page: Int): Request {
return popularMangaRequest(page) return popularMangaRequest(page)
} }
} }

View File

@ -24,5 +24,4 @@ class DynastySeries : DynastyScans() {
parseDescription(document, manga) parseDescription(document, manga)
return manga return manga
} }
} }