Update parsers structure (again)
This commit is contained in:
@@ -24,8 +24,11 @@ public interface MangaParser : Interceptor {
|
||||
*/
|
||||
public val availableSortOrders: Set<SortOrder>
|
||||
|
||||
@Deprecated("Too complex. Use filterCapabilities instead")
|
||||
public val searchQueryCapabilities: MangaSearchQueryCapabilities
|
||||
|
||||
public val filterCapabilities: MangaListFilterCapabilities
|
||||
|
||||
public val config: MangaSourceConfig
|
||||
|
||||
public val authorizationProvider: MangaParserAuthProvider?
|
||||
@@ -40,8 +43,11 @@ public interface MangaParser : Interceptor {
|
||||
|
||||
public val domain: String
|
||||
|
||||
@Deprecated("Too complex. Use getList with filter instead")
|
||||
public suspend fun getList(query: MangaSearchQuery): List<Manga>
|
||||
|
||||
public suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
|
||||
/**
|
||||
* Parse details for [Manga]: chapters list, description, large cover, etc.
|
||||
* Must return the same manga, may change any fields excepts id, url and source
|
||||
@@ -79,13 +85,4 @@ public interface MangaParser : Interceptor {
|
||||
*/
|
||||
@InternalParsersApi
|
||||
public suspend fun resolveLink(resolver: LinkResolver, link: HttpUrl): Manga?
|
||||
|
||||
@Deprecated("Use getList(query: MangaSearchQuery) instead")
|
||||
public suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(convertToMangaSearchQuery(offset, order, filter))
|
||||
}
|
||||
|
||||
@Deprecated("Please check searchQueryCapabilities")
|
||||
public val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = searchQueryCapabilities.toMangaListFilterCapabilities()
|
||||
}
|
||||
|
||||
@@ -11,27 +11,28 @@ import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities
|
||||
import org.koitharu.kotatsu.parsers.network.OkHttpWebClient
|
||||
import org.koitharu.kotatsu.parsers.network.WebClient
|
||||
import org.koitharu.kotatsu.parsers.util.FaviconParser
|
||||
import org.koitharu.kotatsu.parsers.util.LinkResolver
|
||||
import org.koitharu.kotatsu.parsers.util.RelatedMangaFinder
|
||||
import org.koitharu.kotatsu.parsers.util.toAbsoluteUrl
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@InternalParsersApi
|
||||
public abstract class AbstractMangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi public val context: MangaLoaderContext,
|
||||
public final override val source: MangaParserSource,
|
||||
) : MangaParser {
|
||||
|
||||
public final override val searchQueryCapabilities: MangaSearchQueryCapabilities
|
||||
get() = filterCapabilities.toMangaSearchQueryCapabilities()
|
||||
|
||||
public override val config: MangaSourceConfig by lazy { context.getConfig(source) }
|
||||
|
||||
public open val sourceLocale: Locale
|
||||
get() = if (source.locale.isEmpty()) Locale.ROOT else Locale(source.locale)
|
||||
|
||||
protected open val userAgentKey: ConfigKey.UserAgent = ConfigKey.UserAgent(context.getDefaultUserAgent())
|
||||
|
||||
protected val sourceContentRating: ContentRating?
|
||||
get() = if (source.contentType == ContentType.HENTAI) {
|
||||
ContentRating.ADULT
|
||||
@@ -39,10 +40,10 @@ public abstract class AbstractMangaParser @InternalParsersApi constructor(
|
||||
null
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
protected val isNsfwSource: Boolean = source.contentType == ContentType.HENTAI
|
||||
|
||||
protected open val userAgentKey: ConfigKey.UserAgent = ConfigKey.UserAgent(context.getDefaultUserAgent())
|
||||
|
||||
@Deprecated("Override intercept() instead")
|
||||
override fun getRequestHeaders(): Headers = Headers.Builder()
|
||||
.add("User-Agent", config[userAgentKey])
|
||||
.build()
|
||||
@@ -56,12 +57,22 @@ public abstract class AbstractMangaParser @InternalParsersApi constructor(
|
||||
return SortOrder.entries.first { it in supported }
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
|
||||
@JvmField
|
||||
protected val webClient: WebClient = OkHttpWebClient(context.httpClient, source)
|
||||
|
||||
@Deprecated("Please check searchQueryCapabilities")
|
||||
final override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = super.filterCapabilities
|
||||
/**
|
||||
* Search list of manga by specified searchQuery
|
||||
*
|
||||
* @param query searchQuery
|
||||
*/
|
||||
public final override suspend fun getList(query: MangaSearchQuery): List<Manga> = getList(
|
||||
offset = query.offset,
|
||||
order = query.order ?: defaultSortOrder,
|
||||
filter = convertToMangaListFilter(query),
|
||||
)
|
||||
|
||||
/**
|
||||
* Fetch direct link to the page image.
|
||||
|
||||
@@ -11,34 +11,38 @@ import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities
|
||||
import org.koitharu.kotatsu.parsers.network.OkHttpWebClient
|
||||
import org.koitharu.kotatsu.parsers.network.WebClient
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@InternalParsersApi
|
||||
public abstract class LegacyMangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi public val context: MangaLoaderContext,
|
||||
public final override val source: MangaParserSource,
|
||||
@Deprecated("Too complex. Use AbstractMangaParser instead")
|
||||
internal abstract class FlexibleMangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi val context: MangaLoaderContext,
|
||||
final override val source: MangaParserSource,
|
||||
) : MangaParser {
|
||||
|
||||
public final override val searchQueryCapabilities: MangaSearchQueryCapabilities
|
||||
get() = filterCapabilities.toMangaSearchQueryCapabilities()
|
||||
override val config: MangaSourceConfig by lazy { context.getConfig(source) }
|
||||
|
||||
abstract override val filterCapabilities: MangaListFilterCapabilities
|
||||
|
||||
public override val config: MangaSourceConfig by lazy { context.getConfig(source) }
|
||||
|
||||
public open val sourceLocale: Locale
|
||||
open val sourceLocale: Locale
|
||||
get() = if (source.locale.isEmpty()) Locale.ROOT else Locale(source.locale)
|
||||
|
||||
protected val isNsfwSource: Boolean = source.contentType == ContentType.HENTAI
|
||||
|
||||
protected open val userAgentKey: ConfigKey.UserAgent = ConfigKey.UserAgent(context.getDefaultUserAgent())
|
||||
|
||||
final override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = searchQueryCapabilities.toMangaListFilterCapabilities()
|
||||
|
||||
protected val sourceContentRating: ContentRating?
|
||||
get() = if (source.contentType == ContentType.HENTAI) {
|
||||
ContentRating.ADULT
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
|
||||
@Deprecated("Override intercept() instead")
|
||||
override fun getRequestHeaders(): Headers = Headers.Builder()
|
||||
.add("User-Agent", config[userAgentKey])
|
||||
.build()
|
||||
@@ -46,49 +50,37 @@ public abstract class LegacyMangaParser @InternalParsersApi constructor(
|
||||
/**
|
||||
* Used as fallback if value of `order` passed to [getList] is null
|
||||
*/
|
||||
public open val defaultSortOrder: SortOrder
|
||||
open val defaultSortOrder: SortOrder
|
||||
get() {
|
||||
val supported = availableSortOrders
|
||||
return SortOrder.entries.first { it in supported }
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
|
||||
@JvmField
|
||||
protected val webClient: WebClient = OkHttpWebClient(context.httpClient, source)
|
||||
|
||||
/**
|
||||
* Search list of manga by specified searchQuery
|
||||
*
|
||||
* @param query searchQuery
|
||||
*/
|
||||
public final override suspend fun getList(query: MangaSearchQuery): List<Manga> = getList(
|
||||
offset = query.offset,
|
||||
order = query.order ?: defaultSortOrder,
|
||||
filter = convertToMangaListFilter(query),
|
||||
)
|
||||
|
||||
abstract override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
|
||||
/**
|
||||
* Fetch direct link to the page image.
|
||||
*/
|
||||
public override suspend fun getPageUrl(page: MangaPage): String = page.url.toAbsoluteUrl(domain)
|
||||
override suspend fun getPageUrl(page: MangaPage): String = page.url.toAbsoluteUrl(domain)
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(convertToMangaSearchQuery(offset, order, filter))
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse favicons from the main page of the source`s website
|
||||
*/
|
||||
public override suspend fun getFavicons(): Favicons {
|
||||
override suspend fun getFavicons(): Favicons {
|
||||
return FaviconParser(webClient, domain).parseFavicons()
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
public override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
keys.add(configKeyDomain)
|
||||
}
|
||||
|
||||
public override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
return RelatedMangaFinder(listOf(this)).invoke(seed)
|
||||
}
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.SearchableField
|
||||
import org.koitharu.kotatsu.parsers.util.Paginator
|
||||
|
||||
@InternalParsersApi
|
||||
public abstract class LegacyPagedMangaParser(
|
||||
@Deprecated("Too complex. Use PagedMangaParser instead")
|
||||
internal abstract class FlexiblePagedMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) @JvmField public val pageSize: Int,
|
||||
searchPageSize: Int = pageSize,
|
||||
) : LegacyMangaParser(context, source) {
|
||||
) : FlexibleMangaParser(context, source) {
|
||||
|
||||
@JvmField
|
||||
protected val paginator: Paginator = Paginator(pageSize)
|
||||
@@ -23,34 +22,38 @@ public abstract class LegacyPagedMangaParser(
|
||||
@JvmField
|
||||
protected val searchPaginator: Paginator = Paginator(searchPageSize)
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(
|
||||
paginator = if (filter.query.isNullOrEmpty()) {
|
||||
final override suspend fun getList(query: MangaSearchQuery): List<Manga> {
|
||||
var containTitleNameCriteria = false
|
||||
query.criteria.forEach {
|
||||
if (it.field == SearchableField.TITLE_NAME) {
|
||||
containTitleNameCriteria = true
|
||||
}
|
||||
}
|
||||
|
||||
return searchManga(
|
||||
paginator = if (containTitleNameCriteria) {
|
||||
paginator
|
||||
} else {
|
||||
searchPaginator
|
||||
},
|
||||
offset = offset,
|
||||
order = order,
|
||||
filter = filter,
|
||||
query = query,
|
||||
)
|
||||
}
|
||||
|
||||
public abstract suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
public abstract suspend fun getListPage(query: MangaSearchQuery, page: Int): List<Manga>
|
||||
|
||||
protected fun setFirstPage(firstPage: Int, firstPageForSearch: Int = firstPage) {
|
||||
paginator.firstPage = firstPage
|
||||
searchPaginator.firstPage = firstPageForSearch
|
||||
}
|
||||
|
||||
private suspend fun getList(
|
||||
private suspend fun searchManga(
|
||||
paginator: Paginator,
|
||||
offset: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
query: MangaSearchQuery,
|
||||
): List<Manga> {
|
||||
val offset: Int = query.offset
|
||||
val page = paginator.getPage(offset)
|
||||
val list = getListPage(page, order, filter)
|
||||
val list = getListPage(query, page)
|
||||
paginator.onListReceived(offset, page, list.size)
|
||||
return list
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
@InternalParsersApi
|
||||
public abstract class LegacySinglePageMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
) : LegacyMangaParser(context, source) {
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
if (offset > 0) {
|
||||
return emptyList()
|
||||
}
|
||||
return getList(order, filter)
|
||||
}
|
||||
|
||||
public abstract suspend fun getList(order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
}
|
||||
@@ -18,6 +18,7 @@ internal class MangaParserWrapper(
|
||||
override val authorizationProvider: MangaParserAuthProvider?
|
||||
get() = delegate as? MangaParserAuthProvider
|
||||
|
||||
@Deprecated("Too complex. Use getList with filter instead")
|
||||
override suspend fun getList(query: MangaSearchQuery): List<Manga> = withContext(Dispatchers.Default) {
|
||||
if (!query.skipValidation) {
|
||||
searchQueryCapabilities.validate(query)
|
||||
@@ -25,6 +26,14 @@ internal class MangaParserWrapper(
|
||||
delegate.getList(query)
|
||||
}
|
||||
|
||||
override suspend fun getList(
|
||||
offset: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
): List<Manga> = withContext(Dispatchers.Default) {
|
||||
delegate.getList(offset, order, filter)
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga = withContext(Dispatchers.Default) {
|
||||
delegate.getDetails(manga)
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import androidx.annotation.VisibleForTesting
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.SearchableField
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
import org.koitharu.kotatsu.parsers.util.Paginator
|
||||
|
||||
@InternalParsersApi
|
||||
@@ -23,38 +23,34 @@ public abstract class PagedMangaParser(
|
||||
@JvmField
|
||||
protected val searchPaginator: Paginator = Paginator(searchPageSize)
|
||||
|
||||
final override suspend fun getList(query: MangaSearchQuery): List<Manga> {
|
||||
var containTitleNameCriteria = false
|
||||
query.criteria.forEach {
|
||||
if (it.field == SearchableField.TITLE_NAME) {
|
||||
containTitleNameCriteria = true
|
||||
}
|
||||
}
|
||||
|
||||
return searchManga(
|
||||
paginator = if (containTitleNameCriteria) {
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(
|
||||
paginator = if (filter.query.isNullOrEmpty()) {
|
||||
paginator
|
||||
} else {
|
||||
searchPaginator
|
||||
},
|
||||
query = query,
|
||||
offset = offset,
|
||||
order = order,
|
||||
filter = filter,
|
||||
)
|
||||
}
|
||||
|
||||
public abstract suspend fun getListPage(query: MangaSearchQuery, page: Int): List<Manga>
|
||||
public abstract suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
|
||||
protected fun setFirstPage(firstPage: Int, firstPageForSearch: Int = firstPage) {
|
||||
paginator.firstPage = firstPage
|
||||
searchPaginator.firstPage = firstPageForSearch
|
||||
}
|
||||
|
||||
private suspend fun searchManga(
|
||||
private suspend fun getList(
|
||||
paginator: Paginator,
|
||||
query: MangaSearchQuery,
|
||||
offset: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
): List<Manga> {
|
||||
val offset: Int = query.offset
|
||||
val page = paginator.getPage(offset)
|
||||
val list = getListPage(query, page)
|
||||
val list = getListPage(page, order, filter)
|
||||
paginator.onListReceived(offset, page, list.size)
|
||||
return list
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ package org.koitharu.kotatsu.parsers.core
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
@InternalParsersApi
|
||||
public abstract class SinglePageMangaParser(
|
||||
@@ -12,12 +13,12 @@ public abstract class SinglePageMangaParser(
|
||||
source: MangaParserSource,
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
final override suspend fun getList(query: MangaSearchQuery): List<Manga> {
|
||||
if (query.offset > 0) {
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
if (offset > 0) {
|
||||
return emptyList()
|
||||
}
|
||||
return getSinglePageList(query)
|
||||
return getList(order, filter)
|
||||
}
|
||||
|
||||
public abstract suspend fun getSinglePageList(searchQuery: MangaSearchQuery): List<Manga>
|
||||
public abstract suspend fun getList(order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import java.util.*
|
||||
|
||||
@Deprecated("Please check new searchManga method and MangaSearchQuery class")
|
||||
public data class MangaListFilter(
|
||||
@JvmField val query: String? = null,
|
||||
@JvmField val tags: Set<MangaTag> = emptySet(),
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
|
||||
@Deprecated("Please check new MangaSearchQueryCapabilities class")
|
||||
public data class MangaListFilterCapabilities @InternalParsersApi constructor(
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
* @property offset The offset number for paginated search results (optional).
|
||||
*/
|
||||
|
||||
@Deprecated("Too complex. Use MangaListFilter instead")
|
||||
@ConsistentCopyVisibility
|
||||
public data class MangaSearchQuery private constructor(
|
||||
@JvmField public val criteria: Set<QueryCriteria<*>>,
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.collection.ArraySet
|
||||
import org.koitharu.kotatsu.parsers.model.search.QueryCriteria.*
|
||||
import org.koitharu.kotatsu.parsers.util.mapToSet
|
||||
|
||||
@Deprecated("Too complex. Use MangaListFilterCapabilities instead")
|
||||
@ExposedCopyVisibility
|
||||
public data class MangaSearchQueryCapabilities internal constructor(
|
||||
public val capabilities: Set<SearchCapability>,
|
||||
|
||||
@@ -7,6 +7,7 @@ package org.koitharu.kotatsu.parsers.model.search
|
||||
* @param T The type of value associated with the search criterion.
|
||||
* @property field The field to which this search criterion applies.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public sealed interface QueryCriteria<T> {
|
||||
|
||||
public val field: SearchableField
|
||||
|
||||
@@ -21,6 +21,7 @@ import kotlin.reflect.KClass
|
||||
* - `true` if this field can be used with other search criteria.
|
||||
* - `false` if using this field requires it to be the only criterion in query.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public data class SearchCapability(
|
||||
/** The searchable field that this capability applies to. */
|
||||
@JvmField public val field: SearchableField,
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.*
|
||||
*
|
||||
* @property type The Java class representing the expected type of values for this field.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public enum class SearchableField(public val type: Class<*>) {
|
||||
TITLE_NAME(String::class.java),
|
||||
TAG(MangaTag::class.java),
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -20,7 +20,7 @@ import javax.crypto.spec.IvParameterSpec
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
@MangaSourceParser("BATOTO", "Bato.To")
|
||||
internal class BatoToParser(context: MangaLoaderContext) : LegacyPagedMangaParser(
|
||||
internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
context = context,
|
||||
source = MangaParserSource.BATOTO,
|
||||
pageSize = 60,
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.*
|
||||
@@ -20,7 +20,7 @@ private const val CHAPTERS_LIMIT = 99999
|
||||
|
||||
@MangaSourceParser("COMICK_FUN", "ComicK")
|
||||
internal class ComickFunParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.COMICK_FUN, 20) {
|
||||
PagedMangaParser(context, MangaParserSource.COMICK_FUN, 20) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("comick.io")
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.AuthRequiredException
|
||||
import org.koitharu.kotatsu.parsers.exception.TooManyRequestExceptions
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
@@ -32,7 +32,7 @@ private val TAG_PREFIXES = arrayOf("male:", "female:", "other:")
|
||||
@MangaSourceParser("EXHENTAI", "ExHentai", type = ContentType.HENTAI)
|
||||
internal class ExHentaiParser(
|
||||
context: MangaLoaderContext,
|
||||
) : LegacyPagedMangaParser(context, MangaParserSource.EXHENTAI, pageSize = 25), MangaParserAuthProvider, Interceptor {
|
||||
) : PagedMangaParser(context, MangaParserSource.EXHENTAI, pageSize = 25), MangaParserAuthProvider, Interceptor {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = setOf(SortOrder.NEWEST)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.jsoup.Jsoup
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.getStringOrNull
|
||||
@@ -30,7 +30,7 @@ import kotlin.math.min
|
||||
|
||||
@OptIn(ExperimentalUnsignedTypes::class)
|
||||
@MangaSourceParser("HITOMILA", "Hitomi.La", type = ContentType.HENTAI)
|
||||
internal class HitomiLaParser(context: MangaLoaderContext) : LegacyMangaParser(context, MangaParserSource.HITOMILA) {
|
||||
internal class HitomiLaParser(context: MangaLoaderContext) : AbstractMangaParser(context, MangaParserSource.HITOMILA) {
|
||||
override val configKeyDomain = ConfigKey.Domain("hitomi.la")
|
||||
|
||||
private val cdnDomain = "gold-usergeneratedcontent.net"
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.all
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.*
|
||||
import org.koitharu.kotatsu.parsers.util.generateUid
|
||||
@@ -15,7 +15,7 @@ import java.util.Locale
|
||||
|
||||
@MangaSourceParser("HOLOEARTH", "HoloEarth")
|
||||
internal class HoloEarthParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.HOLOEARTH, 3) {
|
||||
PagedMangaParser(context, MangaParserSource.HOLOEARTH, 3) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain("holoearth.com")
|
||||
|
||||
@@ -8,14 +8,14 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("IMHENTAI", "ImHentai", type = ContentType.HENTAI)
|
||||
internal class ImHentai(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.IMHENTAI, pageSize = 20) {
|
||||
PagedMangaParser(context, MangaParserSource.IMHENTAI, pageSize = 20) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> =
|
||||
EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY, SortOrder.RATING)
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.jsoup.HttpStatusException
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -24,7 +24,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
@Broken("Need to fix getPages, most manga don't have chapter images due to faulty fetch logic")
|
||||
@MangaSourceParser("KOHARU", "Schale.network", type = ContentType.HENTAI)
|
||||
internal class Koharu(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.KOHARU, 24) {
|
||||
PagedMangaParser(context, MangaParserSource.KOHARU, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("niyaniya.moe")
|
||||
private val apiSuffix = "api.schale.network"
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.NotFoundException
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
@@ -21,7 +21,7 @@ import javax.crypto.spec.SecretKeySpec
|
||||
internal abstract class LineWebtoonsParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
) : LegacyMangaParser(context, source) {
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.FlexibleMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
@@ -34,7 +34,7 @@ private const val SERVER_DATA = "data"
|
||||
private const val SERVER_DATA_SAVER = "data-saver"
|
||||
|
||||
@MangaSourceParser("MANGADEX", "MangaDex")
|
||||
internal class MangaDexParser(context: MangaLoaderContext) : AbstractMangaParser(context, MangaParserSource.MANGADEX) {
|
||||
internal class MangaDexParser(context: MangaLoaderContext) : FlexibleMangaParser(context, MangaParserSource.MANGADEX) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("mangadex.org")
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
@@ -28,7 +28,7 @@ internal abstract class MangaFireParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
private val siteLang: String,
|
||||
) : LegacyPagedMangaParser(context, source, 30), Interceptor, MangaParserAuthProvider {
|
||||
) : PagedMangaParser(context, source, 30), Interceptor, MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("mangafire.to")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlinx.coroutines.coroutineScope
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
@@ -15,7 +15,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAPARK", "MangaPark")
|
||||
internal class MangaPark(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAPARK, pageSize = 36) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAPARK, pageSize = 36) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(
|
||||
"mangapark.net",
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.asTypedList
|
||||
@@ -25,7 +25,7 @@ internal abstract class MangaPlusParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
private val sourceLang: String,
|
||||
) : LegacySinglePageMangaParser(context, source), Interceptor {
|
||||
) : SinglePageMangaParser(context, source), Interceptor {
|
||||
|
||||
private val apiUrl = "https://jumpg-webapi.tokyo-cdn.com/api"
|
||||
override val configKeyDomain = ConfigKey.Domain("mangaplus.shueisha.co.jp")
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Bitmap
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
@@ -23,7 +23,7 @@ import kotlin.math.min
|
||||
|
||||
@MangaSourceParser("MANGAREADERTO", "MangaReader.To")
|
||||
internal class MangaReaderToParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAREADERTO, 16),
|
||||
PagedMangaParser(context, MangaParserSource.MANGAREADERTO, 16),
|
||||
Interceptor, MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("mangareader.to")
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.koitharu.kotatsu.parsers.site.all
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MANHWA210", "Manhwa210", type = ContentType.MANHWA)
|
||||
internal class Manhwa210(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.MANHWA210, 60) {
|
||||
internal class Manhwa210(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MANHWA210, 60) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("manhwa210.com")
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.koitharu.kotatsu.parsers.site.all
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MISSKON", "MissKon", type = ContentType.OTHER)
|
||||
internal class Misskon(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.MISSKON, 24) {
|
||||
internal class Misskon(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MISSKON, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("misskon.com")
|
||||
|
||||
@@ -145,4 +145,4 @@ internal class Misskon(context: MangaLoaderContext) : LegacyPagedMangaParser(con
|
||||
}
|
||||
return pages
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MULTPORN", "Multporn")
|
||||
internal class Multporn(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MULTPORN, 42) {
|
||||
PagedMangaParser(context, MangaParserSource.MULTPORN, 42) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("multporn.net")
|
||||
|
||||
@@ -226,4 +226,4 @@ internal class Multporn(context: MangaLoaderContext) :
|
||||
document.select(".$className a").map { it.text().trim() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -17,7 +17,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
|
||||
@Broken // TODO: Fix tags, genres
|
||||
@MangaSourceParser("MYREADINGMANGA", "MyReadingManga")
|
||||
internal class MyReadingManga(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.MYREADINGMANGA, 20) {
|
||||
internal class MyReadingManga(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MYREADINGMANGA, 20) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("myreadingmanga.info")
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -19,7 +19,7 @@ internal abstract class NineMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
defaultDomain: String,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize = 26), Interceptor {
|
||||
) : PagedMangaParser(context, source, pageSize = 26), Interceptor {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(defaultDomain)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.asTypedList
|
||||
@@ -23,7 +23,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("NINENINENINEHENTAI", "AnimeH", type = ContentType.HENTAI)
|
||||
internal class NineNineNineHentaiParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.NINENINENINEHENTAI, PAGE_SIZE), Interceptor {
|
||||
PagedMangaParser(context, MangaParserSource.NINENINENINEHENTAI, PAGE_SIZE), Interceptor {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("animeh.to")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -17,7 +17,7 @@ import java.util.EnumSet
|
||||
internal abstract class WebtoonsParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
) : LegacyMangaParser(context, source) {
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("webtoons.com")
|
||||
|
||||
@@ -35,10 +35,11 @@ internal abstract class WebtoonsParser(
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
override val userAgentKey = ConfigKey.UserAgent("Mozilla/5.0 (Linux; Android 12; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36")
|
||||
override val userAgentKey =
|
||||
ConfigKey.UserAgent("Mozilla/5.0 (Linux; Android 12; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36")
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = availableTags()
|
||||
availableTags = availableTags(),
|
||||
)
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
@@ -57,7 +58,7 @@ internal abstract class WebtoonsParser(
|
||||
else -> tag
|
||||
}
|
||||
|
||||
private suspend fun fetchEpisodes(titleNo: Long) : List<MangaChapter> {
|
||||
private suspend fun fetchEpisodes(titleNo: Long): List<MangaChapter> {
|
||||
val url = "https://$mobileApiDomain/api/v1/webtoon/$titleNo/episodes?pageSize=99999"
|
||||
val json = webClient.httpGet(url).parseJson()
|
||||
|
||||
@@ -98,7 +99,7 @@ internal abstract class WebtoonsParser(
|
||||
val description = listOf(
|
||||
doc.select("meta[property='og:description']").attr("content"),
|
||||
doc.select("#_asideDetail p.summary").text(),
|
||||
doc.select(".detail_header .summary").text()
|
||||
doc.select(".detail_header .summary").text(),
|
||||
).firstOrNull { it.isNotBlank() }.orEmpty()
|
||||
|
||||
val coverUrl = doc.select("meta[property=\"og:image\"]").attr("content").let { url ->
|
||||
@@ -108,7 +109,7 @@ internal abstract class WebtoonsParser(
|
||||
val author = listOf(
|
||||
doc.select("meta[property='com-linewebtoon:webtoon:author']").attr("content"),
|
||||
doc.select(".detail_header .info .author").firstOrNull()?.text(),
|
||||
doc.select(".author_area").text()
|
||||
doc.select(".author_area").text(),
|
||||
).firstOrNull { !it.isNullOrBlank() && it != "null" }
|
||||
|
||||
val genreElements = doc.select(".detail_header .info .genre").ifEmpty {
|
||||
@@ -185,6 +186,7 @@ internal abstract class WebtoonsParser(
|
||||
val searchUrl = "https://$domain/$languageCode/search?keyword=${filter.query.urlEncoded()}"
|
||||
webClient.httpGet(searchUrl).parseHtml()
|
||||
}
|
||||
|
||||
filter.tags.isNotEmpty() -> {
|
||||
val selectedGenre = filter.tags.first()
|
||||
val genreUrlPath = genreUrlMap[selectedGenre.key] ?: selectedGenre.key
|
||||
@@ -192,6 +194,7 @@ internal abstract class WebtoonsParser(
|
||||
val genreUrl = "https://$domain/$languageCode/genres/$genreUrlPath?sortOrder=$sortParam"
|
||||
webClient.httpGet(genreUrl).parseHtml()
|
||||
}
|
||||
|
||||
else -> {
|
||||
val rankingType = when (order) {
|
||||
SortOrder.POPULARITY -> "popular"
|
||||
@@ -212,7 +215,11 @@ internal abstract class WebtoonsParser(
|
||||
.take(20)
|
||||
}
|
||||
|
||||
private fun createMangaFromElement(element: Element, source: MangaParserSource, selectedGenre: MangaTag? = null): Manga {
|
||||
private fun createMangaFromElement(
|
||||
element: Element,
|
||||
source: MangaParserSource,
|
||||
selectedGenre: MangaTag? = null,
|
||||
): Manga {
|
||||
val href = element.absUrl("href")
|
||||
val titleNo = extractTitleNoFromUrl(href)
|
||||
val title = element.select(".title, .card_title").text()
|
||||
@@ -258,7 +265,7 @@ internal abstract class WebtoonsParser(
|
||||
id = generateUid("${chapter.id}-$i"),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.json.JSONArray
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
@@ -16,7 +16,7 @@ internal abstract class AnimeBootstrapParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 24,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.mapJSON
|
||||
@@ -19,7 +19,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("FLIXSCANS", "FlixScans.net", "ar")
|
||||
internal class FlixScans(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.FLIXSCANS, 18) {
|
||||
PagedMangaParser(context, MangaParserSource.FLIXSCANS, 18) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED)
|
||||
override val configKeyDomain = ConfigKey.Domain("flixscans.net")
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("MANGASTORM", "MangaStorm", "ar")
|
||||
internal class MangaStorm(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGASTORM, 30) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGASTORM, 30) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.POPULARITY, SortOrder.UPDATED)
|
||||
override val configKeyDomain = ConfigKey.Domain("mangastorm.org")
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -15,7 +15,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("TEAMXNOVEL", "TeamXNovel", "ar")
|
||||
internal class TeamXNovel(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.TEAMXNOVEL, 10) {
|
||||
PagedMangaParser(context, MangaParserSource.TEAMXNOVEL, 10) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.generateUid
|
||||
import org.koitharu.kotatsu.parsers.util.getDomain
|
||||
@@ -21,7 +21,7 @@ import java.util.*
|
||||
|
||||
@Broken
|
||||
@MangaSourceParser("ANIBEL", "Anibel", "be")
|
||||
internal class AnibelParser(context: MangaLoaderContext) : LegacyMangaParser(context, MangaParserSource.ANIBEL) {
|
||||
internal class AnibelParser(context: MangaLoaderContext) : AbstractMangaParser(context, MangaParserSource.ANIBEL) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("anibel.net")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.cupfox
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
@@ -13,7 +13,7 @@ internal abstract class CupFoxParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 24,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.asTypedList
|
||||
@@ -18,7 +18,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("ASURASCANS", "AsuraComic", "en")
|
||||
internal class AsuraScansParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.ASURASCANS, pageSize = 30) {
|
||||
PagedMangaParser(context, MangaParserSource.ASURASCANS, pageSize = 30) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("asuracomic.net")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -18,7 +18,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("BATCAVE", "BatCave", "en", ContentType.COMICS)
|
||||
internal class BatCave(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.BATCAVE, 20) {
|
||||
PagedMangaParser(context, MangaParserSource.BATCAVE, 20) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("batcave.biz")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -11,7 +11,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("BEETOON", "BeeToon.net", "en")
|
||||
internal class BeeToon(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.BEETOON, pageSize = 30) {
|
||||
PagedMangaParser(context, MangaParserSource.BEETOON, pageSize = 30) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED, SortOrder.POPULARITY)
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("CLONEMANGA", "CloneManga", "en")
|
||||
internal class CloneMangaParser(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.CLONEMANGA) {
|
||||
SinglePageMangaParser(context, MangaParserSource.CLONEMANGA) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = Collections.singleton(
|
||||
SortOrder.POPULARITY,
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("COMICEXTRA", "ComicExtra", "en", ContentType.COMICS)
|
||||
internal class ComicExtra(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.COMICEXTRA, 36) {
|
||||
PagedMangaParser(context, MangaParserSource.COMICEXTRA, 36) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("azcomix.me")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.collection.arraySetOf
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.jsoup.nodes.Element
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("DEMONICSCANS", "DemonicScans", "en")
|
||||
internal class DemonicScans(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.DEMONICSCANS, 25) {
|
||||
PagedMangaParser(context, MangaParserSource.DEMONICSCANS, 25) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("demonicscans.org")
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -19,7 +19,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("DYNASTYSCANS", "DynastyScans", "en")
|
||||
internal class DynastyScans(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.DYNASTYSCANS, 117) {
|
||||
PagedMangaParser(context, MangaParserSource.DYNASTYSCANS, 117) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("dynasty-scans.com")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.*
|
||||
@@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
@MangaSourceParser("FLAMECOMICS", "FlameComics", "en")
|
||||
internal class FlameComics(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.FLAMECOMICS) {
|
||||
SinglePageMangaParser(context, MangaParserSource.FLAMECOMICS) {
|
||||
|
||||
private val commonPrefix = suspendLazy(initializer = ::fetchCommonPrefix)
|
||||
private val removeSpecialCharsRegex = Regex("[^A-Za-z0-9 ]")
|
||||
@@ -235,6 +235,6 @@ internal class FlameComics(context: MangaLoaderContext) :
|
||||
private fun String.toMangaTag() = MangaTag(
|
||||
title = this.toTitleCase(sourceLocale),
|
||||
key = this.lowercase().trim(),
|
||||
source = source
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.asTypedList
|
||||
@@ -20,7 +20,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("FLIXSCANSORG", "FlixScans.org", "en")
|
||||
internal class FlixScansOrg(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.FLIXSCANSORG, 18) {
|
||||
PagedMangaParser(context, MangaParserSource.FLIXSCANSORG, 18) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED)
|
||||
override val configKeyDomain = ConfigKey.Domain("flixscans.org")
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.jsoup.HttpStatusException
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
@@ -22,7 +22,7 @@ private const val SERVER_DATA = ""
|
||||
|
||||
@MangaSourceParser("HENTALK", "Hentalk", "en", type = ContentType.HENTAI)
|
||||
internal class Hentalk(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.HENTALK, 24) {
|
||||
PagedMangaParser(context, MangaParserSource.HENTALK, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("hentalk.pw", "fakku.cc")
|
||||
override val userAgentKey = ConfigKey.UserAgent(UserAgents.KOTATSU)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package org.koitharu.kotatsu.parsers.site.en.MTL
|
||||
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
@@ -11,118 +8,121 @@ import org.koitharu.kotatsu.parsers.model.search.SearchCapability
|
||||
import org.koitharu.kotatsu.parsers.model.search.SearchableField
|
||||
import org.koitharu.kotatsu.parsers.model.search.QueryCriteria.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.FlexiblePagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
internal abstract class MTLParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String
|
||||
): PagedMangaParser(context, source, 24) {
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
) : FlexiblePagedMangaParser(context, source, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.NEWEST
|
||||
SortOrder.NEWEST,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions(): MangaListFilterOptions = MangaListFilterOptions()
|
||||
override suspend fun getFilterOptions(): MangaListFilterOptions = MangaListFilterOptions()
|
||||
|
||||
override val searchQueryCapabilities = MangaSearchQueryCapabilities(
|
||||
override val searchQueryCapabilities = MangaSearchQueryCapabilities(
|
||||
SearchCapability(
|
||||
field = SearchableField.TITLE_NAME,
|
||||
criteriaTypes = setOf(Match::class),
|
||||
isMultiple = false
|
||||
)
|
||||
isMultiple = false,
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(query: MangaSearchQuery, page: Int): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
append("/search")
|
||||
append("?")
|
||||
when (query.order) {
|
||||
SortOrder.POPULARITY -> append("sort_by=views")
|
||||
SortOrder.UPDATED -> append("sort_by=recent")
|
||||
else -> append("sort_by=recent")
|
||||
}
|
||||
if (page > 1) {
|
||||
append("&page=")
|
||||
append(page)
|
||||
}
|
||||
query.criteria.find { it.field == SearchableField.TITLE_NAME }?.let { criteria ->
|
||||
when (criteria) {
|
||||
is Match -> {
|
||||
append("&q=")
|
||||
append(criteria.value.toString())
|
||||
}
|
||||
override suspend fun getListPage(query: MangaSearchQuery, page: Int): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
append("/search")
|
||||
append("?")
|
||||
when (query.order) {
|
||||
SortOrder.POPULARITY -> append("sort_by=views")
|
||||
SortOrder.UPDATED -> append("sort_by=recent")
|
||||
else -> append("sort_by=recent")
|
||||
}
|
||||
if (page > 1) {
|
||||
append("&page=")
|
||||
append(page)
|
||||
}
|
||||
query.criteria.find { it.field == SearchableField.TITLE_NAME }?.let { criteria ->
|
||||
when (criteria) {
|
||||
is Match -> {
|
||||
append("&q=")
|
||||
append(criteria.value.toString())
|
||||
}
|
||||
|
||||
is Include,
|
||||
is Exclude,
|
||||
is Range -> Unit // Not supported for this field
|
||||
}
|
||||
}
|
||||
}
|
||||
is Range,
|
||||
-> Unit // Not supported for this field
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
return doc.select("div.grid.grid-cols-1.sm\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4.gap-8.p-6 > div").map { div ->
|
||||
val href = div.selectFirst("a")?.attr("href") ?: throw ParseException("Link not found", url)
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
coverUrl = div.selectFirst("a > div > img")?.src().orEmpty(),
|
||||
title = div.selectFirst("div > a > h3")?.text().orEmpty(),
|
||||
altTitles = emptySet(),
|
||||
rating = RATING_UNKNOWN,
|
||||
tags = emptySet(),
|
||||
authors = emptySet(),
|
||||
state = null,
|
||||
source = source,
|
||||
contentRating = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
return doc.select("div.grid.grid-cols-1.sm\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4.gap-8.p-6 > div")
|
||||
.map { div ->
|
||||
val href = div.selectFirst("a")?.attr("href") ?: throw ParseException("Link not found", url)
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
coverUrl = div.selectFirst("a > div > img")?.src().orEmpty(),
|
||||
title = div.selectFirst("div > a > h3")?.text().orEmpty(),
|
||||
altTitles = emptySet(),
|
||||
rating = RATING_UNKNOWN,
|
||||
tags = emptySet(),
|
||||
authors = emptySet(),
|
||||
state = null,
|
||||
source = source,
|
||||
contentRating = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val altTitles = doc.select("p:contains(Alternative Title)").firstOrNull()?.text()
|
||||
?.substringAfter("Alternative Title:")
|
||||
?.removeSurrounding("[", "]")
|
||||
?.split(",")
|
||||
?.map { it.trim().removeSurrounding("'", "'") }
|
||||
?.toSet()
|
||||
?: emptySet()
|
||||
|
||||
val description = doc.select("p:contains(Synopsis)").firstOrNull()?.text()
|
||||
?.substringAfter("Synopsis:").orEmpty()
|
||||
|
||||
val authors = doc.select("p:contains(Author:)").firstOrNull()?.text()
|
||||
?.substringAfter("Author:")
|
||||
|
||||
val state = when (doc.select("p:contains(Status:)").firstOrNull()?.text()?.contains("Ongoing") == true) {
|
||||
true -> MangaState.ONGOING
|
||||
false -> MangaState.FINISHED
|
||||
}
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val altTitles = doc.select("p:contains(Alternative Title)").firstOrNull()?.text()
|
||||
?.substringAfter("Alternative Title:")
|
||||
?.removeSurrounding("[", "]")
|
||||
?.split(",")
|
||||
?.map { it.trim().removeSurrounding("'", "'") }
|
||||
?.toSet()
|
||||
?: emptySet()
|
||||
|
||||
val chaptersRoot = doc.selectFirst("section.bg-gray-800.rounded-lg.shadow-md.mt-8.p-6")
|
||||
?: throw ParseException("Chapters not found", manga.url)
|
||||
|
||||
val chapters = chaptersRoot.select("ul > li").mapNotNull { li ->
|
||||
val link = li.selectFirst("a") ?: return@mapNotNull null
|
||||
val href = link.attrAsRelativeUrl("href")
|
||||
val title = link.text()
|
||||
val number = title.substringAfter("Chapter ").substringBefore(" ").toFloatOrNull() ?: 0f
|
||||
|
||||
val dateString = li.select("span.text-gray-400").firstOrNull()?.text()?.trim() ?: ""
|
||||
val uploadDate = if (dateString.isNotEmpty()) parseChapterDate(dateString) else 0L
|
||||
val description = doc.select("p:contains(Synopsis)").firstOrNull()?.text()
|
||||
?.substringAfter("Synopsis:").orEmpty()
|
||||
|
||||
MangaChapter(
|
||||
val authors = doc.select("p:contains(Author:)").firstOrNull()?.text()
|
||||
?.substringAfter("Author:")
|
||||
|
||||
val state = when (doc.select("p:contains(Status:)").firstOrNull()?.text()?.contains("Ongoing") == true) {
|
||||
true -> MangaState.ONGOING
|
||||
false -> MangaState.FINISHED
|
||||
}
|
||||
|
||||
val chaptersRoot = doc.selectFirst("section.bg-gray-800.rounded-lg.shadow-md.mt-8.p-6")
|
||||
?: throw ParseException("Chapters not found", manga.url)
|
||||
|
||||
val chapters = chaptersRoot.select("ul > li").mapNotNull { li ->
|
||||
val link = li.selectFirst("a") ?: return@mapNotNull null
|
||||
val href = link.attrAsRelativeUrl("href")
|
||||
val title = link.text()
|
||||
val number = title.substringAfter("Chapter ").substringBefore(" ").toFloatOrNull() ?: 0f
|
||||
|
||||
val dateString = li.select("span.text-gray-400").firstOrNull()?.text()?.trim() ?: ""
|
||||
val uploadDate = if (dateString.isNotEmpty()) parseChapterDate(dateString) else 0L
|
||||
|
||||
MangaChapter(
|
||||
id = generateUid(href),
|
||||
title = title,
|
||||
number = number,
|
||||
@@ -131,66 +131,69 @@ internal abstract class MTLParser(
|
||||
scanlator = null,
|
||||
uploadDate = uploadDate,
|
||||
branch = null,
|
||||
source = source
|
||||
source = source,
|
||||
)
|
||||
}.toList()
|
||||
}.toList()
|
||||
|
||||
return manga.copy(
|
||||
return manga.copy(
|
||||
description = description,
|
||||
authors = setOfNotNull(authors),
|
||||
state = state,
|
||||
altTitles = altTitles,
|
||||
chapters = chapters.reversed()
|
||||
chapters = chapters.reversed(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val jsonText = doc.selectFirst("div#json-data")?.text()
|
||||
?: throw ParseException("JSON data not found", chapter.url)
|
||||
|
||||
val imgUrls = Regex(""""img_url":\s*"([^"]+)"""").findAll(jsonText)
|
||||
.map { it.groupValues[1] }
|
||||
.toList()
|
||||
|
||||
return imgUrls.map { imgUrl ->
|
||||
val fullUrl = "https://$imgUrl"
|
||||
MangaPage(
|
||||
id = generateUid(fullUrl),
|
||||
url = fullUrl,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val jsonText = doc.selectFirst("div#json-data")?.text()
|
||||
?: throw ParseException("JSON data not found", chapter.url)
|
||||
|
||||
private fun parseChapterDate(dateString: String): Long {
|
||||
val calendar = Calendar.getInstance()
|
||||
return when {
|
||||
"minute" in dateString -> {
|
||||
val minutes = dateString.substringBefore(" minute").toInt()
|
||||
calendar.add(Calendar.MINUTE, -minutes)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
"hour" in dateString -> {
|
||||
val hours = dateString.substringBefore(" hour").toInt()
|
||||
calendar.add(Calendar.HOUR_OF_DAY, -hours)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
"day" in dateString -> {
|
||||
val days = dateString.substringBefore(" day").toInt()
|
||||
calendar.add(Calendar.DAY_OF_YEAR, -days)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
else -> {
|
||||
try {
|
||||
val sdf = SimpleDateFormat("dd MMMM yyyy", Locale.ENGLISH)
|
||||
sdf.timeZone = TimeZone.getTimeZone("UTC")
|
||||
sdf.parse(dateString)?.time ?: 0L
|
||||
} catch (e: Exception) {
|
||||
0L
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val imgUrls = Regex(""""img_url":\s*"([^"]+)"""").findAll(jsonText)
|
||||
.map { it.groupValues[1] }
|
||||
.toList()
|
||||
|
||||
return imgUrls.map { imgUrl ->
|
||||
val fullUrl = "https://$imgUrl"
|
||||
MangaPage(
|
||||
id = generateUid(fullUrl),
|
||||
url = fullUrl,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseChapterDate(dateString: String): Long {
|
||||
val calendar = Calendar.getInstance()
|
||||
return when {
|
||||
"minute" in dateString -> {
|
||||
val minutes = dateString.substringBefore(" minute").toInt()
|
||||
calendar.add(Calendar.MINUTE, -minutes)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
|
||||
"hour" in dateString -> {
|
||||
val hours = dateString.substringBefore(" hour").toInt()
|
||||
calendar.add(Calendar.HOUR_OF_DAY, -hours)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
|
||||
"day" in dateString -> {
|
||||
val days = dateString.substringBefore(" day").toInt()
|
||||
calendar.add(Calendar.DAY_OF_YEAR, -days)
|
||||
calendar.timeInMillis
|
||||
}
|
||||
|
||||
else -> {
|
||||
try {
|
||||
val sdf = SimpleDateFormat("dd MMMM yyyy", Locale.ENGLISH)
|
||||
sdf.timeZone = TimeZone.getTimeZone("UTC")
|
||||
sdf.parse(dateString)?.time ?: 0L
|
||||
} catch (e: Exception) {
|
||||
0L
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlinx.coroutines.coroutineScope
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAGEKO", "MangaGeko", "en")
|
||||
internal class MangaGeko(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAGEKO, 30) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAGEKO, 30) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> =
|
||||
EnumSet.of(SortOrder.POPULARITY, SortOrder.UPDATED, SortOrder.NEWEST)
|
||||
|
||||
@@ -6,14 +6,14 @@ import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAKAWAII_EN", "MangaKawaii En", "en")
|
||||
internal class MangaKawaiiEn(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAKAWAII_EN, 50) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAKAWAII_EN, 50) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("www.mangakawaii.io")
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -10,7 +10,7 @@ import org.jsoup.nodes.Document
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAPILL", "MangaPill", "en")
|
||||
internal class MangaPill(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.MANGAPILL, 50) {
|
||||
internal class MangaPill(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MANGAPILL, 50) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("mangapill.com")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGATOWN", "MangaTown", "en")
|
||||
internal class MangaTownParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGATOWN, 30) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGATOWN, 30) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("www.mangatown.com")
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -17,7 +17,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("MANGAOWL", "MangaOwl.to", "en")
|
||||
internal class Mangaowl(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAOWL, pageSize = 24) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAOWL, pageSize = 24) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.POPULARITY,
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.collection.ArrayMap
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANHWA18COM", "Manhwa18.com", "en", type = ContentType.HENTAI)
|
||||
internal class Manhwa18Com(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANHWA18COM, pageSize = 18, searchPageSize = 18) {
|
||||
PagedMangaParser(context, MangaParserSource.MANHWA18COM, pageSize = 18, searchPageSize = 18) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("manhwa18.com")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.collection.ArrayMap
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANHWA18", "Manhwa18.net", "en", type = ContentType.HENTAI)
|
||||
internal class Manhwa18Parser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANHWA18, pageSize = 18, searchPageSize = 18) {
|
||||
PagedMangaParser(context, MangaParserSource.MANHWA18, pageSize = 18, searchPageSize = 18) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("manhwa18.net")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANHWASMEN", "ManhwasMen", "en", type = ContentType.HENTAI)
|
||||
internal class ManhwasMen(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANHWASMEN, pageSize = 30, searchPageSize = 30) {
|
||||
PagedMangaParser(context, MangaParserSource.MANHWASMEN, pageSize = 30, searchPageSize = 30) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("manhwas.men")
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MYCOMICLIST", "MyComicList", "en", ContentType.COMICS)
|
||||
internal class MyComicList(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MYCOMICLIST, 24) {
|
||||
PagedMangaParser(context, MangaParserSource.MYCOMICLIST, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("mycomiclist.org")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("PO2SCANS", "Po2Scans", "en")
|
||||
internal class Po2Scans(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.PO2SCANS) {
|
||||
SinglePageMangaParser(context, MangaParserSource.PO2SCANS) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.ALPHABETICAL)
|
||||
override val configKeyDomain = ConfigKey.Domain("po2scans.com")
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
@@ -17,7 +17,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("PURURIN", "Pururin", "en", ContentType.HENTAI)
|
||||
internal class Pururin(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.PURURIN, pageSize = 20) {
|
||||
PagedMangaParser(context, MangaParserSource.PURURIN, pageSize = 20) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("pururin.to")
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("READONEPIECE", "ReadOnePiece", "en")
|
||||
internal class ReadOnePiece(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.READONEPIECE) {
|
||||
SinglePageMangaParser(context, MangaParserSource.READONEPIECE) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain("ww11.readonepiece.com")
|
||||
@@ -26,7 +26,7 @@ internal class ReadOnePiece(context: MangaLoaderContext) :
|
||||
val doc = webClient.httpGet("https://$domain").parseHtml()
|
||||
val root = doc.body().selectFirstOrThrow("nav ul")
|
||||
val manga = root.select("li")
|
||||
|
||||
|
||||
return manga.mapNotNull { li ->
|
||||
val a = li.selectFirst("a") ?: return@mapNotNull null
|
||||
val href = a.attrAsRelativeUrlOrNull("href").takeIf { ref -> ref != "/" }
|
||||
|
||||
@@ -4,13 +4,13 @@ import androidx.collection.arraySetOf
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("ROLIASCAN", "Rolia Scan", "en")
|
||||
internal class RoliaScan(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.ROLIASCAN, 25) {
|
||||
internal class RoliaScan(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.ROLIASCAN, 25) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("roliascan.com")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.FlexiblePagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities
|
||||
@@ -18,14 +18,13 @@ import org.koitharu.kotatsu.parsers.util.parseHtml
|
||||
import org.koitharu.kotatsu.parsers.util.selectFirstOrThrow
|
||||
import org.koitharu.kotatsu.parsers.util.urlEncoded
|
||||
import org.koitharu.kotatsu.parsers.util.tryParse
|
||||
import org.koitharu.kotatsu.parsers.util.mapChapters
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
@MangaSourceParser("VIOLETSCANS", "VioletScans", "en")
|
||||
internal class VioletScans(context: MangaLoaderContext):
|
||||
PagedMangaParser(context, MangaParserSource.VIOLETSCANS, 12) {
|
||||
|
||||
internal class VioletScans(context: MangaLoaderContext) :
|
||||
FlexiblePagedMangaParser(context, MangaParserSource.VIOLETSCANS, 12) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("violetscans.com")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
@@ -55,6 +54,7 @@ internal class VioletScans(context: MangaLoaderContext):
|
||||
searchParameter = criterion.value.toString()
|
||||
}
|
||||
}
|
||||
|
||||
is QueryCriteria.Exclude<*> -> null
|
||||
is QueryCriteria.Range<*> -> null
|
||||
is QueryCriteria.Include<*> -> null
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.en
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("VYMANGA", "VyManga", "en")
|
||||
internal class VyManga(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.VYMANGA, pageSize = 36) {
|
||||
PagedMangaParser(context, MangaParserSource.VYMANGA, pageSize = 36) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("vymanga.net")
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.ContentRating.SAFE
|
||||
import org.koitharu.kotatsu.parsers.model.ContentRating.SUGGESTIVE
|
||||
@@ -22,7 +22,7 @@ import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("WEEBCENTRAL", "Weeb Central", "en")
|
||||
internal class WeebCentral(context: MangaLoaderContext) : LegacyMangaParser(context, MangaParserSource.WEEBCENTRAL),
|
||||
internal class WeebCentral(context: MangaLoaderContext) : AbstractMangaParser(context, MangaParserSource.WEEBCENTRAL),
|
||||
MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("weebcentral.com")
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.koitharu.kotatsu.parsers.site.es
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("DRAGONTRANSLATION", "Dragon Translation", "es")
|
||||
internal class DragonTranslationParser(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.DRAGONTRANSLATION, 30) {
|
||||
internal class DragonTranslationParser(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.DRAGONTRANSLATION, 30) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("dragontranslation.net")
|
||||
|
||||
@@ -169,4 +169,4 @@ internal class DragonTranslationParser(context: MangaLoaderContext) : LegacyPage
|
||||
else -> 0L
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import kotlinx.coroutines.coroutineScope
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -16,7 +16,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("TEMPLESCANESP", "TempleScanEsp", "es", ContentType.HENTAI)
|
||||
internal class TempleScanEsp(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.TEMPLESCANESP) {
|
||||
SinglePageMangaParser(context, MangaParserSource.TEMPLESCANESP) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.NEWEST_ASC)
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("TUMANGAONLINE", "TuMangaOnline", "es")
|
||||
internal class TuMangaOnlineParser(context: MangaLoaderContext) : LegacyPagedMangaParser(
|
||||
internal class TuMangaOnlineParser(context: MangaLoaderContext) : PagedMangaParser(
|
||||
context,
|
||||
source = MangaParserSource.TUMANGAONLINE,
|
||||
pageSize = 24,
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlinx.coroutines.coroutineScope
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -17,7 +17,7 @@ internal abstract class FmreaderParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 20,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.json.JSONArray
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -16,7 +16,7 @@ internal abstract class FoolSlideParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 25,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -19,7 +19,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("BENTOMANGA", "BentoManga", "fr")
|
||||
internal class BentomangaParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.BENTOMANGA, 10) {
|
||||
PagedMangaParser(context, MangaParserSource.BENTOMANGA, 10) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -16,7 +16,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("FURYOSOCIETY", "FuryoSociety", "fr")
|
||||
internal class FuryoSociety(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.FURYOSOCIETY) {
|
||||
SinglePageMangaParser(context, MangaParserSource.FURYOSOCIETY) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.ALPHABETICAL, SortOrder.UPDATED)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.mapJSON
|
||||
@@ -16,7 +16,7 @@ import java.util.*
|
||||
@Broken("images canvas need to refactor")
|
||||
@MangaSourceParser("LEGACY_SCANS", "LegacyScans", "fr")
|
||||
internal class LegacyScansParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.LEGACY_SCANS, 18) {
|
||||
PagedMangaParser(context, MangaParserSource.LEGACY_SCANS, 18) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("legacy-scans.com")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@Broken
|
||||
@MangaSourceParser("LIRESCAN", "LireScan", "fr")
|
||||
internal class LireScan(context: MangaLoaderContext) : LegacyPagedMangaParser(context, MangaParserSource.LIRESCAN, 20) {
|
||||
internal class LireScan(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.LIRESCAN, 20) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(SortOrder.UPDATED)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -17,7 +17,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("LUGNICASCANS", "LugnicaScans", "fr")
|
||||
internal class LugnicaScans(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.LUGNICASCANS, 10) {
|
||||
PagedMangaParser(context, MangaParserSource.LUGNICASCANS, 10) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("lugnica-scans.com")
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAKAWAII", "MangaKawaii Fr", "fr")
|
||||
internal class MangaKawaii(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAKAWAII, 50) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAKAWAII, 50) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("www.mangakawaii.io")
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -23,7 +23,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("MANGAMANA", "MangaMana", "fr")
|
||||
internal class MangaMana(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.MANGAMANA, 25) {
|
||||
PagedMangaParser(context, MangaParserSource.MANGAMANA, 25) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("www.manga-mana.com")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.json.JSONArray
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.getFloatOrDefault
|
||||
@@ -18,7 +18,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("PHENIXSCANS", "PhenixScans", "fr")
|
||||
internal class PhenixscansParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.PHENIXSCANS, 18) {
|
||||
PagedMangaParser(context, MangaParserSource.PHENIXSCANS, 18) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("phenix-scans.com")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.koitharu.kotatsu.parsers.Broken
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -16,7 +16,7 @@ import java.util.*
|
||||
@Broken
|
||||
@MangaSourceParser("SCANS_MANGAS_ME", "ScansMangas.me", "fr")
|
||||
internal class ScansMangasMe(context: MangaLoaderContext) :
|
||||
LegacySinglePageMangaParser(context, MangaParserSource.SCANS_MANGAS_ME) {
|
||||
SinglePageMangaParser(context, MangaParserSource.SCANS_MANGAS_ME) {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.ALPHABETICAL,
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.fr
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("SCANTRADUNION", "ScantradUnion", "fr")
|
||||
internal class ScantradUnion(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.SCANTRADUNION, 10) {
|
||||
PagedMangaParser(context, MangaParserSource.SCANTRADUNION, 10) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("scantrad-union.com")
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -20,7 +20,7 @@ internal abstract class FuzzyDoodleParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 24,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -2,129 +2,129 @@ package org.koitharu.kotatsu.parsers.site.gallery
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
internal abstract class GalleryParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String
|
||||
) : LegacyMangaParser(context, source) {
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val availableSortOrders: Set<SortOrder>
|
||||
get() = EnumSet.of(SortOrder.NEWEST, SortOrder.POPULARITY)
|
||||
override val availableSortOrders: Set<SortOrder>
|
||||
get() = EnumSet.of(SortOrder.NEWEST, SortOrder.POPULARITY)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = true,
|
||||
)
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions(): MangaListFilterOptions = MangaListFilterOptions()
|
||||
override suspend fun getFilterOptions(): MangaListFilterOptions = MangaListFilterOptions()
|
||||
|
||||
override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = urlBuilder().apply {
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> addQueryParameter("search", filter.query)
|
||||
filter.tags.isNotEmpty() -> addPathSegments(filter.tags.first().key)
|
||||
order == SortOrder.POPULARITY -> addPathSegment("hot")
|
||||
}
|
||||
override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = urlBuilder().apply {
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> addQueryParameter("search", filter.query)
|
||||
filter.tags.isNotEmpty() -> addPathSegments(filter.tags.first().key)
|
||||
order == SortOrder.POPULARITY -> addPathSegment("hot")
|
||||
}
|
||||
|
||||
addQueryParameter("start", offset.toString())
|
||||
}.build()
|
||||
addQueryParameter("start", offset.toString())
|
||||
}.build()
|
||||
|
||||
val content = webClient.httpGet(url).parseHtml()
|
||||
val currentPage = content.selectFirst("a.pagination-link.is-current")?.text()?.toIntOrNull()
|
||||
val titlePage = content.selectFirst("head > title")?.text()
|
||||
?.substringAfter("page ", "")
|
||||
?.substringBefore(" ", "")
|
||||
?.toIntOrNull()
|
||||
val content = webClient.httpGet(url).parseHtml()
|
||||
val currentPage = content.selectFirst("a.pagination-link.is-current")?.text()?.toIntOrNull()
|
||||
val titlePage = content.selectFirst("head > title")?.text()
|
||||
?.substringAfter("page ", "")
|
||||
?.substringBefore(" ", "")
|
||||
?.toIntOrNull()
|
||||
|
||||
if (titlePage != null && currentPage != titlePage) return emptyList()
|
||||
if (titlePage != null && currentPage != titlePage) return emptyList()
|
||||
|
||||
return content.select("div.items-row").map { el ->
|
||||
val titleEl = el.selectFirstOrThrow("div.page-header a.item-link")
|
||||
val relUrl = titleEl.attrOrThrow("href")
|
||||
Manga(
|
||||
id = generateUid(relUrl),
|
||||
url = relUrl,
|
||||
title = titleEl.text(),
|
||||
altTitles = emptySet(),
|
||||
publicUrl = relUrl.toAbsoluteUrl(domain),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = el.selectFirst("div.item-thumb img")?.attr("src"),
|
||||
tags = el.select("div.item-tags > a.tag").mapNotNullToSet { tagEl ->
|
||||
MangaTag(
|
||||
title = tagEl.text(),
|
||||
key = tagEl.attrAsRelativeUrlOrNull("href")
|
||||
?.removePrefix("/") ?: return@mapNotNullToSet null,
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
state = MangaState.FINISHED,
|
||||
authors = emptySet(),
|
||||
largeCoverUrl = null,
|
||||
description = null,
|
||||
chapters = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
return content.select("div.items-row").map { el ->
|
||||
val titleEl = el.selectFirstOrThrow("div.page-header a.item-link")
|
||||
val relUrl = titleEl.attrOrThrow("href")
|
||||
Manga(
|
||||
id = generateUid(relUrl),
|
||||
url = relUrl,
|
||||
title = titleEl.text(),
|
||||
altTitles = emptySet(),
|
||||
publicUrl = relUrl.toAbsoluteUrl(domain),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = el.selectFirst("div.item-thumb img")?.attr("src"),
|
||||
tags = el.select("div.item-tags > a.tag").mapNotNullToSet { tagEl ->
|
||||
MangaTag(
|
||||
title = tagEl.text(),
|
||||
key = tagEl.attrAsRelativeUrlOrNull("href")
|
||||
?.removePrefix("/") ?: return@mapNotNullToSet null,
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
state = MangaState.FINISHED,
|
||||
authors = emptySet(),
|
||||
largeCoverUrl = null,
|
||||
description = null,
|
||||
chapters = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val content = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val description = content.selectFirst("div.article-info")?.text()?.trim() ?: ""
|
||||
val df = SimpleDateFormat("HH:mm dd-MM-yyyy")
|
||||
val time = content.selectFirst("div.article-info > small")?.text()?.trim()
|
||||
val chapters = content.selectFirst("nav.pagination")?.select("a.pagination-link")
|
||||
?.mapChapters { index, element ->
|
||||
val relUrl = element.attrAsRelativeUrl("href")
|
||||
MangaChapter(
|
||||
id = generateUid(relUrl),
|
||||
title = null,
|
||||
number = index + 1f,
|
||||
volume = 0,
|
||||
url = relUrl,
|
||||
scanlator = null,
|
||||
uploadDate = df.tryParse(time),
|
||||
branch = null,
|
||||
source = source,
|
||||
)
|
||||
}.orEmpty()
|
||||
return manga.copy(chapters = chapters, description = description)
|
||||
}
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val content = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val description = content.selectFirst("div.article-info")?.text()?.trim() ?: ""
|
||||
val df = SimpleDateFormat("HH:mm dd-MM-yyyy")
|
||||
val time = content.selectFirst("div.article-info > small")?.text()?.trim()
|
||||
val chapters = content.selectFirst("nav.pagination")?.select("a.pagination-link")
|
||||
?.mapChapters { index, element ->
|
||||
val relUrl = element.attrAsRelativeUrl("href")
|
||||
MangaChapter(
|
||||
id = generateUid(relUrl),
|
||||
title = null,
|
||||
number = index + 1f,
|
||||
volume = 0,
|
||||
url = relUrl,
|
||||
scanlator = null,
|
||||
uploadDate = df.tryParse(time),
|
||||
branch = null,
|
||||
source = source,
|
||||
)
|
||||
}.orEmpty()
|
||||
return manga.copy(chapters = chapters, description = description)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val content = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return content.selectFirstOrThrow("div.article-fulltext").select("p > img").mapNotNull { el ->
|
||||
val url = el.attrOrNull("src") ?: return@mapNotNull null
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val content = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return content.selectFirstOrThrow("div.article-fulltext").select("p > img").mapNotNull { el ->
|
||||
val url = el.attrOrNull("src") ?: return@mapNotNull null
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
protected suspend fun fetchTags(): Set<MangaTag> {
|
||||
val root = webClient.httpGet("https://$domain").parseHtml()
|
||||
return root.select("div#navbar-main a.navbar-item").map { a ->
|
||||
MangaTag(
|
||||
title = a.text(),
|
||||
key = a.attr("href").removePrefix("/"),
|
||||
source = source,
|
||||
)
|
||||
}.toSet()
|
||||
}
|
||||
}
|
||||
protected suspend fun fetchTags(): Set<MangaTag> {
|
||||
val root = webClient.httpGet("https://$domain").parseHtml()
|
||||
return root.select("div#navbar-main a.navbar-item").map { a ->
|
||||
MangaTag(
|
||||
title = a.text(),
|
||||
key = a.attr("href").removePrefix("/"),
|
||||
source = source,
|
||||
)
|
||||
}.toSet()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
@@ -19,7 +19,7 @@ internal abstract class GalleryAdultsParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 20,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
@@ -14,7 +14,7 @@ internal abstract class GattsuParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 20,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.guya
|
||||
import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.generateUid
|
||||
import org.koitharu.kotatsu.parsers.util.parseJson
|
||||
@@ -15,7 +15,7 @@ internal abstract class GuyaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
) : LegacySinglePageMangaParser(context, source) {
|
||||
) : SinglePageMangaParser(context, source) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.*
|
||||
@@ -16,7 +16,7 @@ internal abstract class HeanCms(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 20,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.koitharu.kotatsu.parsers.site.heancmsalt
|
||||
import org.koitharu.kotatsu.parsers.ErrorMessages
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -17,7 +17,7 @@ internal abstract class HeanCmsAlt(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 18,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import okhttp3.Headers
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
@@ -20,7 +20,7 @@ internal abstract class HotComicsParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 24,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -12,7 +12,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("DOUJINDESU", "DoujinDesu.tv", "id")
|
||||
internal class DoujinDesuParser(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.DOUJINDESU, pageSize = 18) {
|
||||
PagedMangaParser(context, MangaParserSource.DOUJINDESU, pageSize = 18) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain("doujindesu.tv")
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.koitharu.kotatsu.parsers.site.id
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("HENTAICROT", "HentaiCrot", "id", ContentType.HENTAI)
|
||||
internal class HentaiCrot(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.HENTAICROT, 8) {
|
||||
PagedMangaParser(context, MangaParserSource.HENTAICROT, 8) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("hentaicrot.com")
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -16,7 +16,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("KUMAPAGE", "Kumapage", "id")
|
||||
internal class Kumapage(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.KUMAPAGE, 14) {
|
||||
PagedMangaParser(context, MangaParserSource.KUMAPAGE, 14) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain("www.kumapage.com")
|
||||
@@ -196,4 +196,4 @@ internal class Kumapage(context: MangaLoaderContext) :
|
||||
}
|
||||
}.toSet()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.koitharu.kotatsu.parsers.site.id
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("PIXHENTAI", "PixHentai", "id", ContentType.HENTAI)
|
||||
internal class PixHentai(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.PIXHENTAI, 8) {
|
||||
PagedMangaParser(context, MangaParserSource.PIXHENTAI, 8) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("pixhentai.com")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.*
|
||||
@@ -13,7 +13,7 @@ import java.util.*
|
||||
|
||||
@MangaSourceParser("SHINIGAMI", "Shinigami", "id")
|
||||
internal class Shinigami(context: MangaLoaderContext) :
|
||||
LegacyPagedMangaParser(context, MangaParserSource.SHINIGAMI, 24) {
|
||||
PagedMangaParser(context, MangaParserSource.SHINIGAMI, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("id.shinigami.asia")
|
||||
private val apiSuffix = "api.shngm.io/v1"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package org.koitharu.kotatsu.parsers.site.iken
|
||||
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.json.JSONObject
|
||||
import org.json.JSONArray
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.*
|
||||
@@ -20,7 +19,7 @@ internal abstract class IkenParser(
|
||||
domain: String,
|
||||
pageSize: Int = 18,
|
||||
protected val useAPI: Boolean = false
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
@@ -247,4 +246,4 @@ internal abstract class IkenParser(
|
||||
item.getString("url")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.AbstractMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.AuthRequiredException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
@@ -16,7 +16,7 @@ private const val STATUS_FINISHED = "完結"
|
||||
|
||||
@MangaSourceParser("NICOVIDEO_SEIGA", "NicoVideo Seiga", "ja")
|
||||
internal class NicovideoSeigaParser(context: MangaLoaderContext) :
|
||||
LegacyMangaParser(context, MangaParserSource.NICOVIDEO_SEIGA),
|
||||
AbstractMangaParser(context, MangaParserSource.NICOVIDEO_SEIGA),
|
||||
MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("nicovideo.jp")
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacySinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.SinglePageMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -17,7 +17,7 @@ internal abstract class KeyoappParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
) : LegacySinglePageMangaParser(context, source) {
|
||||
) : SinglePageMangaParser(context, source) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.json.JSONObject
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.LegacyPagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.DateFormat
|
||||
@@ -20,7 +20,7 @@ internal abstract class LikeMangaParser(
|
||||
source: MangaParserSource,
|
||||
domain: String,
|
||||
pageSize: Int = 36,
|
||||
) : LegacyPagedMangaParser(context, source, pageSize) {
|
||||
) : PagedMangaParser(context, source, pageSize) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain(domain)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user