Misc code cleanup

This commit is contained in:
Eugene 2019-10-27 15:41:40 -04:00
parent 170c382b15
commit 40de8b9723
No known key found for this signature in database
GPG Key ID: E1FD745328866B0A
32 changed files with 777 additions and 691 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: ComiCake'
pkgNameSuffix = 'all.comicake'
extClass = '.ComiCakeFactory'
extVersionCode = 6
extVersionCode = 7
libVersion = '1.2'
}

View File

@ -1,9 +1,13 @@
package eu.kanade.tachiyomi.extension.all.comicake
import android.os.Build
import eu.kanade.tachiyomi.extension.BuildConfig
import eu.kanade.tachiyomi.extensions.BuildConfig
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 okhttp3.Headers
import okhttp3.Request
@ -12,20 +16,19 @@ import org.json.JSONArray
import org.json.JSONObject
import java.text.SimpleDateFormat
const val COMICAKE_DEFAULT_API_ENDPOINT = "/api" // Highly unlikely to change
const val COMICAKE_DEFAULT_READER_ENDPOINT = "/r" // Can change based on CC config
open class ComiCake(override val name: String,
abstract class ComiCake(
override val name: String,
final override val baseUrl: String,
override val lang: String,
readerEndpoint: String = COMICAKE_DEFAULT_READER_ENDPOINT,
apiEndpoint: String = COMICAKE_DEFAULT_API_ENDPOINT) : HttpSource() {
apiEndpoint: String = COMICAKE_DEFAULT_API_ENDPOINT
) : HttpSource() {
override val versionId = 1
override val supportsLatest = true
private val readerBase = baseUrl + readerEndpoint
private var apiBase = baseUrl + apiEndpoint
private val userAgent = "Mozilla/5.0 (" +
"Android ${Build.VERSION.RELEASE}; Mobile) " +
"Tachiyomi/${BuildConfig.VERSION_NAME}"
@ -69,6 +72,7 @@ open class ComiCake(override val name: String,
mangas.add(parseComicJson(obj))
}
}
return MangasPage(mangas, !(response.getString("next").isNullOrEmpty() || response.getString("next") == "null"))
}
@ -156,4 +160,9 @@ open class ComiCake(override val name: String,
}
override fun imageUrlParse(response: Response) = throw UnsupportedOperationException("This method should not be called!")
companion object {
private const val COMICAKE_DEFAULT_API_ENDPOINT = "/api" // Highly unlikely to change
private const val COMICAKE_DEFAULT_READER_ENDPOINT = "/r" // Can change based on CC config
}
}

View File

@ -4,19 +4,13 @@ import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class ComiCakeFactory : SourceFactory {
override fun createSources(): List<Source> = getAllComiCake()
}
fun getAllComiCake(): List<Source> {
return listOf(
WhimSubs(),
override fun createSources(): List<Source> = listOf(
LetItGoScans(),
PTScans(),
LetItGoScans()
WhimSubs()
)
}
class WhimSubs : ComiCake("WhimSubs", "https://whimsubs.xyz", "en")
class PTScans : ComiCake("ProjectTime Scans", "https://read.ptscans.com", "en", "/")
class LetItGoScans : ComiCake("LetItGo Scans", "https://reader.letitgo.scans.today", "en", "/")
class PTScans : ComiCake("ProjectTime Scans", "https://read.ptscans.com", "en", "/")
class WhimSubs : ComiCake("WhimSubs", "https://whimsubs.xyz", "en")

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: FMReader (multiple aggregators)'
pkgNameSuffix = 'all.fmreader'
extClass = '.FMReaderFactory'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -1,16 +1,26 @@
package eu.kanade.tachiyomi.extension.all.fmreader
// For sites based on the Flat-Manga CMS
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.Headers
import okhttp3.HttpUrl
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.*
import java.util.*
import java.util.Calendar
/**
* For sites based on the Flat-Manga CMS
*/
abstract class FMReader(
override val name: String,
override val baseUrl: String,
@ -43,10 +53,8 @@ abstract class FMReader (
}
is TextField -> url.addQueryParameter(filter.key, filter.state)
is GenreList -> {
var genre = String()
var ungenre = String()
filter.state.forEach {
if (it.isIncluded()) genre += ",${it.name}"
if (it.isExcluded()) ungenre += ",${it.name}"

View File

@ -5,9 +5,17 @@ import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
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.util.asJsoup
import okhttp3.*
import okhttp3.FormBody
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import rx.Observable
@ -40,6 +48,7 @@ class FMReaderFactory : SourceFactory {
* most likely the fix is to override popularMangaNextPageSelector() */
class LHTranslation : FMReader("LHTranslation", "https://lhtranslation.net", "en")
class MangaHato : FMReader("MangaHato", "https://mangahato.com", "ja")
class ManhwaScan : FMReader("ManhwaScan", "https://manhwascan.com", "en")
class MangaTiki : FMReader("MangaTiki", "https://mangatiki.com", "ja")
@ -47,16 +56,20 @@ class MangaBone : FMReader("MangaBone", "https://mangabone.com", "en")
class YoloManga : FMReader("Yolo Manga", "https://yolomanga.ca", "es") {
override fun chapterListSelector() = "div#tab-chapper ~ div#tab-chapper table tr"
}
class MangaLeer : FMReader("MangaLeer", "https://mangaleer.com", "es") {
override val dateValueIndex = 1
override val dateWordIndex = 2
}
class AiLoveManga : FMReader("AiLoveManga", "https://ailovemanga.com", "vi") {
override val requestPath = "danh-sach-truyen.html"
// TODO: could add a genre search (different URL paths for genres)
override fun getFilterList() = FilterList()
// I don't know why, but I have to override searchMangaRequest to make it work for this source
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/$requestPath?name=$query&page=$page")
override fun chapterListSelector() = "div#tab-chapper table tr"
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
@ -72,10 +85,12 @@ class AiLoveManga : FMReader("AiLoveManga", "https://ailovemanga.com", "vi") {
return manga
}
}
class ReadComicOnlineOrg : FMReader("ReadComicOnline.org", "https://readcomiconline.org", "en") {
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor { requestIntercept(it) }
.build()
private fun requestIntercept(chain: Interceptor.Chain): Response {
val request = chain.request()
val response = chain.proceed(request)
@ -92,6 +107,7 @@ class ReadComicOnlineOrg : FMReader("ReadComicOnline.org", "https://readcomiconl
response
}
}
override val requestPath = "comic-list.html"
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
@ -101,30 +117,38 @@ class ReadComicOnlineOrg : FMReader("ReadComicOnline.org", "https://readcomiconl
}
return pages.dropLast(1) // last page is a comments page
}
override fun imageUrlRequest(page: Page): Request = GET(baseUrl + page.url, headers)
override fun imageUrlParse(document: Document): String = document.select("img.chapter-img").attr("abs:src").trim()
override fun getGenreList() = getComicsGenreList()
}
class MangaWeek : FMReader("MangaWeek", "https://mangaweek.com", "en")
class HanaScan : FMReader("HanaScan (RawQQ)", "http://rawqq.com", "ja") {
override fun popularMangaNextPageSelector() = "div.col-md-8 button"
}
class RawLH : FMReader("RawLH", "https://lhscan.net", "ja") {
override fun popularMangaNextPageSelector() = "div.col-md-8 button"
}
class Manhwa18 : FMReader("Manhwa18", "https://manhwa18.com", "en") {
override fun getGenreList() = getAdultGenreList()
}
class TruyenTranhLH : FMReader("TruyenTranhLH", "https://truyentranhlh.net", "vi") {
override val requestPath = "danh-sach-truyen.html"
}
class EighteenLHPlus : FMReader("18LHPlus", "https://18lhplus.com", "en") {
override fun getGenreList() = getAdultGenreList()
}
class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
override fun popularMangaNextPageSelector() = "div.btn-group:not(div.btn-block) button.btn-info"
// TODO: genre search possible but a bit of a pain
override fun getFilterList() = FilterList()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = GET("$baseUrl/arama.html?icerik=$query", headers)
override fun searchMangaParse(response: Response): MangasPage {
val mangas = mutableListOf<SManga>()
@ -135,6 +159,7 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
return MangasPage(mangas, false)
}
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
@ -143,6 +168,7 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
return manga
}
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
val infoElement = document.select("div#tab1").first()
@ -156,6 +182,7 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
return manga
}
override fun chapterListSelector() = "tr.table-bordered"
override val chapterUrlSelector = "td[align=left] > a"
override val chapterTimeSelector = "td[align=right]"
@ -172,6 +199,7 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
Observable.error(Exception("Licensed - No chapters to show"))
}
}
private fun chapterListParse(response: Response, requestUrl: String): List<SChapter> {
val chapters = mutableListOf<SChapter>()
var document = response.asJsoup()
@ -193,6 +221,7 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
}
return chapters
}
override fun pageListRequest(chapter: SChapter): Request = GET("$baseUrl/${chapter.url.substringAfter("cek/")}", headers)
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
@ -202,12 +231,15 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
}
return pages.dropLast(1) // last page is a comments page
}
override fun imageUrlParse(document: Document): String = document.select("img.chapter-img").attr("abs:src").trim()
}
class Comicastle : FMReader("Comicastle", "https://www.comicastle.org", "en") {
override val requestPath = "comic-dir"
// this source doesn't have the "page x of y" element
override fun popularMangaNextPageSelector() = "li:contains(»)"
override fun popularMangaParse(response: Response) = defaultMangaParse(response)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = GET("$baseUrl/comic-dir?q=$query", headers)
override fun searchMangaParse(response: Response): MangasPage = defaultMangaParse(response)
@ -224,6 +256,7 @@ class Comicastle : FMReader("Comicastle", "https://www.comicastle.org", "en") {
return manga
}
override fun chapterListSelector() = "div.col-md-9 table:last-of-type tr"
override fun chapterListParse(response: Response): List<SChapter> = super.chapterListParse(response).reversed()
override fun pageListParse(document: Document): List<Page> {
@ -234,29 +267,32 @@ class Comicastle : FMReader("Comicastle", "https://www.comicastle.org", "en") {
}
return pages
}
override fun imageUrlParse(document: Document): String = document.select("img.chapter-img").attr("abs:src").trim()
override fun getGenreList() = getComicsGenreList()
}
class Manhwa18Net : FMReader("Manhwa18.net", "https://manhwa18.net", "en") {
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/$requestPath?listType=pagination&page=$page&sort=views&sort_type=DESC&ungenre=raw", headers)
override fun latestUpdatesRequest(page: Int): Request =
GET("$baseUrl/$requestPath?listType=pagination&page=$page&sort=last_update&sort_type=DESC&ungenre=raw", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val noRawsUrl = super.searchMangaRequest(page, query, filters).url().newBuilder().addQueryParameter("ungenre", "raw").toString()
return GET(noRawsUrl, headers)
}
override fun getGenreList() = getAdultGenreList()
}
class Manhwa18NetRaw : FMReader("Manhwa18.net Raw", "https://manhwa18.net", "ko") {
override val requestPath = "manga-list-genre-raw.html"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val onlyRawsUrl = super.searchMangaRequest(page, query, filters).url().newBuilder().addQueryParameter("genre", "raw").toString()
return GET(onlyRawsUrl, headers)
}
override fun getFilterList() = FilterList(super.getFilterList().filterNot { it == GenreList(getGenreList()) })
}

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: FoolSlide (multiple sources)'
pkgNameSuffix = 'all.foolslide'
extClass = '.FoolSlideFactory'
extVersionCode = 28
extVersionCode = 29
libVersion = '1.2'
}

View File

@ -4,7 +4,11 @@ import com.github.salomonbrys.kotson.get
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.ParsedHttpSource
import okhttp3.FormBody
import okhttp3.Request
@ -13,13 +17,17 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Calendar
import java.util.Date
import java.util.HashSet
import java.util.Locale
open class FoolSlide(override val name: String,
abstract class FoolSlide(
override val name: String,
override val baseUrl: String,
override val lang: String,
val urlModifier: String = "") : ParsedHttpSource() {
val urlModifier: String = ""
) : ParsedHttpSource() {
protected open val dedupeLatestUpdates = true

View File

@ -12,11 +12,7 @@ import okhttp3.Request
import org.jsoup.nodes.Document
class FoolSlideFactory : SourceFactory {
override fun createSources(): List<Source> = getAllFoolSlide()
}
fun getAllFoolSlide(): List<Source> {
return listOf(
override fun createSources(): List<Source> = listOf(
JaminisBox(),
SenseScans(),
KireiCake(),
@ -46,7 +42,6 @@ fun getAllFoolSlide(): List<Source> {
}
class JaminisBox : FoolSlide("Jaimini's Box", "https://jaiminisbox.com", "en", "/reader") {
override fun pageListParse(document: Document): List<Page> {
val doc = document.toString()
var jsonstr = doc.substringAfter("var pages = ").substringBefore(";")
@ -132,7 +127,6 @@ class LupiTeam : FoolSlide("LupiTeam", "https://lupiteam.net", "it", "/reader")
return manga
}
}
class ZandynoFansub : FoolSlide("Zandy no Fansub", "http://zandynofansub.aishiteru.org", "en", "/reader")

View File

@ -2,7 +2,11 @@ package eu.kanade.tachiyomi.extension.all.foolslide
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservable
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.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Request
import okhttp3.Response

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Genkan (multiple sources)'
pkgNameSuffix = 'all.genkan'
extClass = '.GenkanFactory'
extVersionCode = 7
extVersionCode = 8
libVersion = '1.2'
}

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.all.genkan
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.OkHttpClient
@ -11,7 +15,8 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import java.text.SimpleDateFormat
import java.util.*
import java.util.Calendar
import java.util.Locale
abstract class Genkan(
override val name: String,
@ -159,7 +164,7 @@ abstract class Genkan(
.replace(Regex("""["\\]"""), "")
.split(",")
for (i in 0 until allImages.size) {
for (i in allImages.indices) {
pages.add(Page(i, "", allImages[i]))
}
@ -238,4 +243,3 @@ abstract class GenkanOriginal(
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
}

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Madara (multiple sources)'
pkgNameSuffix = "all.madara"
extClass = '.MadaraFactory'
extVersionCode = 22
extVersionCode = 23
libVersion = '1.2'
}

View File

@ -3,31 +3,43 @@ package eu.kanade.tachiyomi.extension.all.madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservable
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.*
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
import okhttp3.CacheControl
import okhttp3.FormBody
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.Calendar
import java.util.Date
import java.util.Locale
import java.util.concurrent.TimeUnit
open class Madara(
abstract class Madara(
override val name: String,
override val baseUrl: String,
override val lang: String,
private val dateFormat: SimpleDateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.US)
) : ParsedHttpSource() {
override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build()
override val supportsLatest = true
// Popular Manga
override fun popularMangaSelector() = "div.page-item-detail"

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.all.madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
@ -11,10 +10,10 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import java.text.SimpleDateFormat
import java.util.Locale
import okhttp3.Response
import okhttp3.Request
class MadaraFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
@ -56,11 +55,13 @@ class MadaraFactory : SourceFactory {
class Mangasushi : Madara("Mangasushi", "https://mangasushi.net", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class NinjaScans : Madara("NinjaScans", "https://ninjascans.com", "en")
class ReadManhua : Madara("ReadManhua", "https://readmanhua.net", "en",
dateFormat = SimpleDateFormat("dd MMM yy", Locale.US)) {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ZeroScans : Madara("ZeroScans", "https://zeroscans.com", "en")
class IsekaiScanCom : Madara("IsekaiScan.com", "https://isekaiscan.com/", "en")
class HappyTeaScans : Madara("Happy Tea Scans", "https://happyteascans.com/", "en")
@ -68,6 +69,7 @@ class JustForFun : Madara("Just For Fun", "https://just-for-fun.ru/", "ru",
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class AoCTranslations : Madara("Agent of Change Translations", "https://aoc.moe/", "en") {
override fun chapterListParse(response: Response): List<SChapter> {
val chapters = mutableListOf<SChapter>()
@ -99,9 +101,11 @@ class AoCTranslations : Madara("Agent of Change Translations", "https://aoc.moe/
return chapters.reversed()
}
}
class KomikGo : Madara("KomikGo", "https://komikgo.com", "id") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class LuxyScans : Madara("Luxy Scans", "https://luxyscans.com/", "en")
class TritiniaScans : Madara("Tritinia Scans", "http://ghajik.ml/", "en",
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
@ -110,25 +114,32 @@ class TritiniaScans : Madara("Tritinia Scans", "http://ghajik.ml/", "en",
override fun latestUpdatesNextPageSelector(): String? = null
override fun popularMangaNextPageSelector(): String? = null
}
class TsubakiNoScan : Madara("Tsubaki No Scan", "https://tsubakinoscan.com/",
"fr", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US))
class YokaiJump : Madara("Yokai Jump", "https://yokaijump.fr/", "fr",
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ZManga : Madara("ZManga", "https://zmanga.org/", "es") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class MangazukiMe : Madara("Mangazuki.me", "https://mangazuki.me/", "en")
class MangazukiOnline : Madara("Mangazuki.online", "https://www.mangazuki.online/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class MangazukiClubJP : Madara("Mangazuki.club", "https://mangazuki.club/", "ja") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class MangazukiClubKO : Madara("Mangazuki.club", "https://mangazuki.club/", "ko") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") {
override val pageListParseSelector = "div.reading-content img"
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
@ -141,12 +152,15 @@ class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") {
return if (page.imageUrl!!.contains(cdnUrl)) GET(page.imageUrl!!, cdnHeaders) else GET(page.imageUrl!!, headers)
}
}
class MangaKomi : Madara("MangaKomi", "https://mangakomi.com/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class MangaSY : Madara("Manga SY", "https://www.mangasy.com/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ManwhaClub : Madara("Manwha Club", "https://manhwa.club/", "en")
class WuxiaWorld : Madara("WuxiaWorld", "https://wuxiaworld.site/", "en") {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/tag/webcomic/page/$page/?m_orderby=views", headers)
@ -154,6 +168,7 @@ class WuxiaWorld : Madara("WuxiaWorld", "https://wuxiaworld.site/", "en") {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = super.searchMangaRequest(page, "$query comics", filters)
override fun popularMangaNextPageSelector() = "div.nav-previous.float-left"
}
class WordRain : Madara("WordRain Translation", "https://wordrain69.com", "en") {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga-genre/manga/page/$page/?m_orderby=views", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga-genre/manga/page/$page/?m_orderby=latest", headers)
@ -167,24 +182,31 @@ class WordRain : Madara("WordRain Translation", "https://wordrain69.com", "en")
return super.searchMangaParse(res)
}
}
class YoManga : Madara("Yo Manga", "https://yomanga.info/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ManyToon : Madara("ManyToon", "https://manytoon.com/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ChibiManga : Madara("Chibi Manga", "http://www.cmreader.info/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ZinManga : Madara("Zin Translator", "https://zinmanga.com/", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class ManwahentaiMe : Madara("Manwahentai.me", "https://manhwahentai.me", "en")
class Manga3asq : Madara("مانجا العاشق", "https://3asq.org", "ar") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class NManhwa : Madara("N Manhwa", "https://nmanhwa.com", "en") {
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
}
class Indiancomicsonline : Madara("Indian Comics Online", "http://www.indiancomicsonline.com", "hi")

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaCards (Valhalla, NANI?)'
pkgNameSuffix = 'all.mangacards'
extClass = '.MangaCardsFactory'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -2,17 +2,21 @@ package eu.kanade.tachiyomi.extension.all.mangacards
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.OkHttpClient
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.FormBody
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 java.util.Locale
abstract class MangaCards(
override val name: String,

View File

@ -14,4 +14,3 @@ class MangaCardsFactory : SourceFactory {
class ValhallaScans : MangaCards("Valhalla Scans", "https://valhallascans.com", "en")
class NaniScans : MangaCards("NANI? Scans", "https://naniscans.xyz", "en")
class IneptBastards : MangaCards("Inept Bastards", "https://ineptbastards.xyz", "en")

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangadexFactory'
extVersionCode = 68
extVersionCode = 69
libVersion = '1.2'
}

View File

@ -43,7 +43,11 @@ import java.util.Date
import java.util.concurrent.TimeUnit
import kotlin.collections.set
open class Mangadex(override val lang: String, private val internalLang: String, private val langCode: Int) : ConfigurableSource, ParsedHttpSource() {
abstract class Mangadex(
override val lang: String,
private val internalLang: String,
private val langCode: Int
) : ConfigurableSource, ParsedHttpSource() {
override val name = "MangaDex"

View File

@ -3,7 +3,83 @@ package eu.kanade.tachiyomi.extension.all.mangadex
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class MangadexFactory : SourceFactory {
override fun createSources(): List<Source> = getAllMangaDexLanguages()
override fun createSources(): List<Source> = listOf(
MangaDexEnglish(),
MangaDexPolish(),
MangaDexItalian(),
MangaDexRussian(),
MangaDexGerman(),
MangaDexFrench(),
MangaDexVietnamese(),
MangaDexSpanishSpain(),
MangaDexSpanishLTAM(),
MangaDexCatalan(),
MangaDexPortuguesePortugal(),
MangaDexPortugueseBrazil(),
MangaDexSwedish(),
MangaDexTurkish(),
MangaDexIndonesian(),
MangaDexHungarian(),
MangaDexBulgarian(),
MangaDexFilipino(),
MangaDexDutch(),
MangaDexArabic(),
MangaDexChineseSimp(),
MangaDexChineseTrad(),
MangaDexThai(),
MangaDexBengali(),
MangaDexBurmese(),
MangaDexCzech(),
MangaDexDanish(),
MangaDexFinnish(),
MangaDexGreek(),
MangaDexJapanese(),
MangaDexKorean(),
MangaDexLithuanian(),
MangaDexMalay(),
MangaDexMongolian(),
MangaDexPersian(),
MangaDexRomanian(),
MangaDexSerboCroatian(),
MangaDexUkrainian()
)
}
class MangaDexPolish : Mangadex("pl", "pl", 3)
class MangaDexItalian : Mangadex("it", "it", 6)
class MangaDexRussian : Mangadex("ru", "ru", 7)
class MangaDexGerman : Mangadex("de", "de", 8)
class MangaDexFrench : Mangadex("fr", "fr", 10)
class MangaDexVietnamese : Mangadex("vi", "vn", 12)
class MangaDexSpanishSpain : Mangadex("es", "es", 15)
class MangaDexSpanishLTAM : Mangadex("es-419", "mx", 29)
class MangaDexCatalan : Mangadex("ca", "ct", 33)
class MangaDexPortuguesePortugal : Mangadex("pt", "pt", 17)
class MangaDexPortugueseBrazil : Mangadex("pt-BR", "br", 16)
class MangaDexSwedish : Mangadex("sv", "se", 18)
class MangaDexTurkish : Mangadex("tr", "tr", 26)
class MangaDexIndonesian : Mangadex("id", "id", 27)
class MangaDexHungarian : Mangadex("hu", "hu", 9)
class MangaDexBulgarian : Mangadex("bg", "bg", 14)
class MangaDexFilipino : Mangadex("fil", "ph", 34)
class MangaDexDutch : Mangadex("nl", "nl", 5)
class MangaDexArabic : Mangadex("ar", "sa", 19)
class MangaDexChineseSimp : Mangadex("zh-Hans", "cn", 21)
class MangaDexChineseTrad : Mangadex("zh-Hant", "hk", 35)
class MangaDexThai : Mangadex("th", "th", 32)
class MangaDexBengali : Mangadex("bn", "bd", 22)
class MangaDexBurmese : Mangadex("my", "mm", 37)
class MangaDexCzech : Mangadex("cs", "cz", 24)
class MangaDexDanish : Mangadex("da", "dk", 20)
class MangaDexFinnish : Mangadex("fi", "fi", 11)
class MangaDexGreek : Mangadex("el", "gr", 13)
class MangaDexJapanese : Mangadex("ja", "jp", 2)
class MangaDexKorean : Mangadex("ko", "kr", 28)
class MangaDexLithuanian : Mangadex("lt", "lt", 38)
class MangaDexMalay : Mangadex("ms", "my", 31)
class MangaDexMongolian : Mangadex("mn", "mn", 25)
class MangaDexPersian : Mangadex("fa", "ir", 30)
class MangaDexRomanian : Mangadex("ro", "ro", 23)
class MangaDexSerboCroatian : Mangadex("sh", "rs", 4)
class MangaDexUkrainian : Mangadex("uk", "ua", 36)

View File

@ -1,84 +0,0 @@
package eu.kanade.tachiyomi.extension.all.mangadex
/**
* Mangadex languages
*/
class MangaDexPolish : Mangadex("pl", "pl", 3)
class MangaDexItalian : Mangadex("it", "it", 6)
class MangaDexRussian : Mangadex("ru", "ru", 7)
class MangaDexGerman : Mangadex("de", "de", 8)
class MangaDexFrench : Mangadex("fr", "fr", 10)
class MangaDexVietnamese : Mangadex("vi", "vn", 12)
class MangaDexSpanishSpain : Mangadex("es", "es", 15)
class MangaDexSpanishLTAM : Mangadex("es-419", "mx", 29)
class MangaDexCatalan : Mangadex("ca", "ct", 33)
class MangaDexPortuguesePortugal : Mangadex("pt", "pt", 17)
class MangaDexPortugueseBrazil : Mangadex("pt-BR", "br", 16)
class MangaDexSwedish : Mangadex("sv", "se", 18)
class MangaDexTurkish : Mangadex("tr", "tr", 26)
class MangaDexIndonesian : Mangadex("id", "id", 27)
class MangaDexHungarian : Mangadex("hu", "hu", 9)
class MangaDexBulgarian : Mangadex("bg", "bg", 14)
class MangaDexFilipino : Mangadex("fil", "ph", 34)
class MangaDexDutch : Mangadex("nl", "nl", 5)
class MangaDexArabic : Mangadex("ar", "sa", 19)
class MangaDexChineseSimp : Mangadex("zh-Hans", "cn", 21)
class MangaDexChineseTrad : Mangadex("zh-Hant", "hk", 35)
class MangaDexThai : Mangadex("th", "th", 32)
class MangaDexBengali : Mangadex("bn", "bd", 22)
class MangaDexBurmese : Mangadex("my", "mm", 37)
class MangaDexCzech : Mangadex("cs", "cz", 24)
class MangaDexDanish : Mangadex("da", "dk", 20)
class MangaDexFinnish : Mangadex("fi", "fi", 11)
class MangaDexGreek : Mangadex("el", "gr", 13)
class MangaDexJapanese : Mangadex("ja", "jp", 2)
class MangaDexKorean : Mangadex("ko", "kr", 28)
class MangaDexLithuanian : Mangadex("lt", "lt", 38)
class MangaDexMalay : Mangadex("ms", "my", 31)
class MangaDexMongolian : Mangadex("mn", "mn", 25)
class MangaDexPersian : Mangadex("fa", "ir", 30)
class MangaDexRomanian : Mangadex("ro", "ro", 23)
class MangaDexSerboCroatian : Mangadex("sh", "rs", 4)
class MangaDexUkrainian : Mangadex("uk", "ua", 36)
fun getAllMangaDexLanguages() = listOf(
MangaDexEnglish(),
MangaDexPolish(),
MangaDexItalian(),
MangaDexRussian(),
MangaDexGerman(),
MangaDexFrench(),
MangaDexVietnamese(),
MangaDexSpanishSpain(),
MangaDexSpanishLTAM(),
MangaDexCatalan(),
MangaDexPortuguesePortugal(),
MangaDexPortugueseBrazil(),
MangaDexSwedish(),
MangaDexTurkish(),
MangaDexIndonesian(),
MangaDexHungarian(),
MangaDexBulgarian(),
MangaDexFilipino(),
MangaDexDutch(),
MangaDexArabic(),
MangaDexChineseSimp(),
MangaDexChineseTrad(),
MangaDexThai(),
MangaDexBengali(),
MangaDexBurmese(),
MangaDexCzech(),
MangaDexDanish(),
MangaDexFinnish(),
MangaDexGreek(),
MangaDexJapanese(),
MangaDexKorean(),
MangaDexLithuanian(),
MangaDexMalay(),
MangaDexMongolian(),
MangaDexPersian(),
MangaDexRomanian(),
MangaDexSerboCroatian(),
MangaDexUkrainian()
)

View File

@ -5,6 +5,7 @@ import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
import kotlin.system.exitProcess
/**
* Springboard that accepts https://mangadex.com/title/xxx intents and redirects them to
@ -38,7 +39,7 @@ class MangadexUrlActivity : Activity() {
}
finish()
System.exit(0)
exitProcess(0)
}
}

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangAdventure'
pkgNameSuffix = 'all.mangadventure'
extClass = '.MangAdventureFactory'
extVersionCode = 3
extVersionCode = 4
libVersion = '1.2'
}

View File

@ -26,7 +26,7 @@ import java.util.Locale
*
* @property categories the available manga categories of the site.
*/
open class MangAdventure(
abstract class MangAdventure(
override val name: String,
override val baseUrl: String,
val categories: Array<String> = DEFAULT_CATEGORIES

View File

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

View File

@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.extension.all.mangadventure
import eu.kanade.tachiyomi.source.SourceFactory
/** [MangAdventure] source factory. */
class MangAdventureFactory : SourceFactory {
override fun createSources() = listOf(
ArcRelight()

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mangatensei'
pkgNameSuffix = 'all.mangatensei'
extClass = '.MangatenseiFactory'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.all.mangatensei
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.HttpUrl
import okhttp3.OkHttpClient
@ -9,7 +13,7 @@ import okhttp3.Request
import org.json.JSONObject
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.*
import java.util.Calendar
import java.util.concurrent.TimeUnit
open class Mangatensei(override val lang: String, private val Mtlang: String) : ParsedHttpSource() {

View File

@ -3,7 +3,54 @@ package eu.kanade.tachiyomi.extension.all.mangatensei
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class MangatenseiFactory : SourceFactory {
override fun createSources(): List<Source> = getAllMangatenseiLanguages()
override fun createSources(): List<Source> = listOf(
MangatenseiArabic(),
MangatenseiBrazilian(),
MangatenseiCzech(),
MangatenseiDanish(),
MangatenseiDutch(),
MangatenseiEnglish(),
MangatenseiFilipino(),
MangatenseiFrench(),
MangatenseiGerman(),
MangatenseiGreek(),
MangatenseiHebrew(),
MangatenseiHungarian(),
MangatenseiIndonesian(),
MangatenseiItalian(),
MangatenseiMalay(),
MangatenseiPolish(),
MangatenseiPortuguese(),
MangatenseiRomanian(),
MangatenseiRussian(),
MangatenseiSpanish(),
MangatenseiThai(),
MangatenseiTurkish(),
MangatenseiVietnamese()
)
}
class MangatenseiArabic : Mangatensei("ar", "arabic")
class MangatenseiBrazilian : Mangatensei("pt-BR", "brazilian")
class MangatenseiCzech : Mangatensei("cs", "czech")
class MangatenseiDanish : Mangatensei("da", "danish")
class MangatenseiDutch : Mangatensei("nl", "dutch")
class MangatenseiEnglish : Mangatensei("en", "english")
class MangatenseiFilipino : Mangatensei("fil", "filipino")
class MangatenseiFrench : Mangatensei("fr", "french")
class MangatenseiGerman : Mangatensei("de", "german")
class MangatenseiGreek : Mangatensei("el", "greek")
class MangatenseiHebrew : Mangatensei("iw", "hebrew")
class MangatenseiHungarian : Mangatensei("hu", "hungarian")
class MangatenseiIndonesian : Mangatensei("id", "indonesian")
class MangatenseiItalian : Mangatensei("it", "italian")
class MangatenseiMalay : Mangatensei("ms", "malay")
class MangatenseiPolish : Mangatensei("pl", "polish")
class MangatenseiPortuguese : Mangatensei("pt", "portuguese")
class MangatenseiRomanian : Mangatensei("ro", "romanian")
class MangatenseiRussian : Mangatensei("ru", "russian")
class MangatenseiSpanish : Mangatensei("es", "spanish")
class MangatenseiThai : Mangatensei("th", "thai")
class MangatenseiTurkish : Mangatensei("tr", "turkish")
class MangatenseiVietnamese : Mangatensei("vi", "vietnamese")

View File

@ -1,55 +0,0 @@
package eu.kanade.tachiyomi.extension.all.mangatensei
/**
* Mangatensei languages
*/
class MangatenseiArabic : Mangatensei("ar", "arabic")
class MangatenseiBrazilian : Mangatensei("pt-BR", "brazilian")
class MangatenseiCzech : Mangatensei("cs", "czech")
class MangatenseiDanish : Mangatensei("da", "danish")
class MangatenseiDutch : Mangatensei("nl", "dutch")
class MangatenseiEnglish : Mangatensei("en", "english")
class MangatenseiFilipino : Mangatensei("fil", "filipino")
class MangatenseiFrench : Mangatensei("fr", "french")
class MangatenseiGerman : Mangatensei("de", "german")
class MangatenseiGreek : Mangatensei("el", "greek")
class MangatenseiHebrew : Mangatensei("iw", "hebrew")
class MangatenseiHungarian : Mangatensei("hu", "hungarian")
class MangatenseiIndonesian : Mangatensei("id", "indonesian")
class MangatenseiItalian : Mangatensei("it", "italian")
class MangatenseiMalay : Mangatensei("ms", "malay")
class MangatenseiPolish : Mangatensei("pl", "polish")
class MangatenseiPortuguese : Mangatensei("pt", "portuguese")
class MangatenseiRomanian : Mangatensei("ro", "romanian")
class MangatenseiRussian : Mangatensei("ru", "russian")
class MangatenseiSpanish : Mangatensei("es", "spanish")
class MangatenseiThai : Mangatensei("th", "thai")
class MangatenseiTurkish : Mangatensei("tr", "turkish")
class MangatenseiVietnamese : Mangatensei("vi", "vietnamese")
fun getAllMangatenseiLanguages() = listOf(
MangatenseiArabic(),
MangatenseiBrazilian(),
MangatenseiCzech(),
MangatenseiDanish(),
MangatenseiDutch(),
MangatenseiEnglish(),
MangatenseiFilipino(),
MangatenseiFrench(),
MangatenseiGerman(),
MangatenseiGreek(),
MangatenseiHebrew(),
MangatenseiHungarian(),
MangatenseiIndonesian(),
MangatenseiItalian(),
MangatenseiMalay(),
MangatenseiPolish(),
MangatenseiPortuguese(),
MangatenseiRomanian(),
MangatenseiRussian(),
MangatenseiSpanish(),
MangatenseiThai(),
MangatenseiTurkish(),
MangatenseiVietnamese()
)