Compare commits
2 Commits
55d4ae23c5
...
2ff510b3d5
Author | SHA1 | Date |
---|---|---|
beerpsi | 2ff510b3d5 | |
rtlow | aa224e18d6 |
|
@ -9,7 +9,7 @@ import okhttp3.Request
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class NetTruyen : WPComics("NetTruyen", "https://www.nettruyenbing.com", "vi", SimpleDateFormat("dd/MM/yy", Locale.getDefault()), null) {
|
class NetTruyen : WPComics("NetTruyen", "https://www.nettruyenclub.com", "vi", SimpleDateFormat("dd/MM/yy", Locale.getDefault()), null) {
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().add("Referer", baseUrl).build())
|
override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().add("Referer", baseUrl).build())
|
||||||
override fun getFilterList(): FilterList {
|
override fun getFilterList(): FilterList {
|
||||||
|
|
|
@ -12,7 +12,7 @@ class WPComicsGenerator : ThemeSourceGenerator {
|
||||||
override val baseVersionCode: Int = 2
|
override val baseVersionCode: Int = 2
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("NetTruyen", "https://www.nettruyenbing.com", "vi", overrideVersionCode = 20),
|
SingleLang("NetTruyen", "https://www.nettruyenclub.com", "vi", overrideVersionCode = 21),
|
||||||
SingleLang("NhatTruyen", "https://nhattruyenmax.com", "vi", overrideVersionCode = 13),
|
SingleLang("NhatTruyen", "https://nhattruyenmax.com", "vi", overrideVersionCode = 13),
|
||||||
SingleLang("TruyenChon", "http://truyenchon.com", "vi", overrideVersionCode = 3),
|
SingleLang("TruyenChon", "http://truyenchon.com", "vi", overrideVersionCode = 3),
|
||||||
SingleLang("XOXO Comics", "https://xoxocomic.com", "en", className = "XoxoComics", overrideVersionCode = 3),
|
SingleLang("XOXO Comics", "https://xoxocomic.com", "en", className = "XoxoComics", overrideVersionCode = 3),
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'Dynasty'
|
extName = 'Dynasty'
|
||||||
pkgNameSuffix = 'en.dynasty'
|
pkgNameSuffix = 'en.dynasty'
|
||||||
extClass = '.DynastyFactory'
|
extClass = '.DynastyFactory'
|
||||||
extVersionCode = 21
|
extVersionCode = 22
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -12,7 +12,9 @@ class DynastyAnthologies : DynastyScans() {
|
||||||
|
|
||||||
override val searchPrefix = "anthologies"
|
override val searchPrefix = "anthologies"
|
||||||
|
|
||||||
override fun popularMangaInitialUrl() = "$baseUrl/anthologies?view=cover"
|
override val categoryPrefix = "Anthology"
|
||||||
|
|
||||||
|
override fun popularMangaInitialUrl() = ""
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
return GET("$baseUrl/search?q=$query&classes%5B%5D=Anthology&sort=&page=$page", headers)
|
return GET("$baseUrl/search?q=$query&classes%5B%5D=Anthology&sort=&page=$page", headers)
|
||||||
|
|
|
@ -13,9 +13,9 @@ import org.jsoup.nodes.Element
|
||||||
class DynastyChapters : DynastyScans() {
|
class DynastyChapters : DynastyScans() {
|
||||||
override val name = "Dynasty-Chapters"
|
override val name = "Dynasty-Chapters"
|
||||||
override val searchPrefix = "chapters"
|
override val searchPrefix = "chapters"
|
||||||
|
override val categoryPrefix = "Chapter"
|
||||||
override fun popularMangaInitialUrl() = ""
|
override fun popularMangaInitialUrl() = ""
|
||||||
|
|
||||||
private fun popularMangaInitialUrl(page: Int) = "$baseUrl/search?q=&classes%5B%5D=Chapter&page=$page=$&sort="
|
|
||||||
private fun latestUpdatesInitialUrl(page: Int) = "$baseUrl/search?q=&classes%5B%5D=Chapter&page=$page=$&sort=created_at"
|
private fun latestUpdatesInitialUrl(page: Int) = "$baseUrl/search?q=&classes%5B%5D=Chapter&page=$page=$&sort=created_at"
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
|
@ -76,23 +76,15 @@ class DynastyChapters : DynastyScans() {
|
||||||
return chapter
|
return chapter
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
|
||||||
return GET(popularMangaInitialUrl(page), headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun latestUpdatesRequest(page: Int): Request {
|
override fun latestUpdatesRequest(page: Int): Request {
|
||||||
return GET(latestUpdatesInitialUrl(page), headers)
|
return GET(latestUpdatesInitialUrl(page), headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaNextPageSelector() = searchMangaNextPageSelector()
|
|
||||||
override fun latestUpdatesNextPageSelector() = searchMangaNextPageSelector()
|
override fun latestUpdatesNextPageSelector() = searchMangaNextPageSelector()
|
||||||
|
|
||||||
override fun popularMangaSelector() = searchMangaSelector()
|
|
||||||
override fun latestUpdatesSelector() = searchMangaSelector()
|
override fun latestUpdatesSelector() = searchMangaSelector()
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element) = searchMangaFromElement(element)
|
|
||||||
override fun latestUpdatesFromElement(element: Element) = searchMangaFromElement(element)
|
override fun latestUpdatesFromElement(element: Element) = searchMangaFromElement(element)
|
||||||
|
|
||||||
override fun popularMangaParse(response: Response) = searchMangaParse(response)
|
|
||||||
override fun latestUpdatesParse(response: Response) = searchMangaParse(response)
|
override fun latestUpdatesParse(response: Response) = searchMangaParse(response)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@ class DynastyDoujins : DynastyScans() {
|
||||||
|
|
||||||
override val searchPrefix = "doujins"
|
override val searchPrefix = "doujins"
|
||||||
|
|
||||||
override fun popularMangaInitialUrl() = "$baseUrl/doujins?view=cover"
|
override val categoryPrefix = "Doujin"
|
||||||
|
override fun popularMangaInitialUrl() = ""
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element): SManga {
|
override fun popularMangaFromElement(element: Element): SManga {
|
||||||
return super.popularMangaFromElement(element).apply {
|
return super.popularMangaFromElement(element).apply {
|
||||||
|
@ -51,7 +52,7 @@ class DynastyDoujins : DynastyScans() {
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
|
|
||||||
val chapters = document.select(chapterListSelector()).map { chapterFromElement(it) }.toMutableList()
|
val chapters = try { document.select(chapterListSelector()).map { chapterFromElement(it) }.toMutableList() } catch (e: IndexOutOfBoundsException) { mutableListOf() }
|
||||||
|
|
||||||
document.select("a.thumbnail img").let { images ->
|
document.select("a.thumbnail img").let { images ->
|
||||||
if (images.isNotEmpty()) {
|
if (images.isNotEmpty()) {
|
||||||
|
|
|
@ -12,7 +12,9 @@ class DynastyIssues : DynastyScans() {
|
||||||
|
|
||||||
override val searchPrefix = "issues"
|
override val searchPrefix = "issues"
|
||||||
|
|
||||||
override fun popularMangaInitialUrl() = "$baseUrl/issues?view=cover"
|
override val categoryPrefix = "Issue"
|
||||||
|
|
||||||
|
override fun popularMangaInitialUrl() = ""
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
return GET("$baseUrl/search?q=$query&classes%5B%5D=Issue&sort=&page=$page", headers)
|
return GET("$baseUrl/search?q=$query&classes%5B%5D=Issue&sort=&page=$page", headers)
|
||||||
|
|
|
@ -39,6 +39,8 @@ abstract class DynastyScans : ParsedHttpSource() {
|
||||||
|
|
||||||
open val searchPrefix = ""
|
open val searchPrefix = ""
|
||||||
|
|
||||||
|
open val categoryPrefix = ""
|
||||||
|
|
||||||
private var parent: List<Node> = ArrayList()
|
private var parent: List<Node> = ArrayList()
|
||||||
|
|
||||||
private var list = InternalList(ArrayList(), "")
|
private var list = InternalList(ArrayList(), "")
|
||||||
|
@ -49,11 +51,13 @@ abstract class DynastyScans : ParsedHttpSource() {
|
||||||
|
|
||||||
private val json: Json by injectLazy()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
|
protected fun popularMangaInitialUrl(page: Int) = "$baseUrl/search?q=&classes%5B%5D=$categoryPrefix&page=$page=$&sort="
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
return GET(popularMangaInitialUrl(), headers)
|
return GET(popularMangaInitialUrl(page), headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaSelector() = "ul.thumbnails > li.span2"
|
override fun popularMangaSelector() = searchMangaSelector()
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element): SManga {
|
override fun popularMangaFromElement(element: Element): SManga {
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
|
@ -62,12 +66,7 @@ abstract class DynastyScans : ParsedHttpSource() {
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaParse(response: Response): MangasPage {
|
override fun popularMangaParse(response: Response) = searchMangaParse(response)
|
||||||
val mangas = response.asJsoup().select(popularMangaSelector()).map { element ->
|
|
||||||
popularMangaFromElement(element)
|
|
||||||
}
|
|
||||||
return MangasPage(mangas, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||||
if (query.startsWith("manga:")) {
|
if (query.startsWith("manga:")) {
|
||||||
|
@ -249,7 +248,7 @@ abstract class DynastyScans : ParsedHttpSource() {
|
||||||
|
|
||||||
data class Validate(val _isManga: Boolean, val _pos: Int)
|
data class Validate(val _isManga: Boolean, val _pos: Int)
|
||||||
|
|
||||||
override fun popularMangaNextPageSelector() = ""
|
override fun popularMangaNextPageSelector() = searchMangaNextPageSelector()
|
||||||
override fun latestUpdatesSelector() = ""
|
override fun latestUpdatesSelector() = ""
|
||||||
override fun latestUpdatesNextPageSelector() = ""
|
override fun latestUpdatesNextPageSelector() = ""
|
||||||
override fun imageUrlParse(document: Document): String = ""
|
override fun imageUrlParse(document: Document): String = ""
|
||||||
|
|
|
@ -14,7 +14,9 @@ class DynastySeries : DynastyScans() {
|
||||||
|
|
||||||
override val searchPrefix = "series"
|
override val searchPrefix = "series"
|
||||||
|
|
||||||
override fun popularMangaInitialUrl() = "$baseUrl/series?view=cover"
|
override val categoryPrefix = "Series"
|
||||||
|
|
||||||
|
override fun popularMangaInitialUrl() = ""
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
return GET("$baseUrl/search?q=$query&classes%5B%5D=Series&sort=&page=$page", headers)
|
return GET("$baseUrl/search?q=$query&classes%5B%5D=Series&sort=&page=$page", headers)
|
||||||
|
|
Loading…
Reference in New Issue