Add ComicLatest (#3790)

* Add ComicLatest

* Minor edit

* Update build.gradle

Co-authored-by: snakedoc83 <mikepeterson83@gmail.com>
This commit is contained in:
AbdullahM0hamed 2020-07-15 11:13:52 +01:00 committed by GitHub
parent 7777858e80
commit 97472230c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'WP-Comics' extName = 'WP-Comics'
pkgNameSuffix = 'all.wpcomics' pkgNameSuffix = 'all.wpcomics'
extClass = '.WPComicsFactory' extClass = '.WPComicsFactory'
extVersionCode = 10 extVersionCode = 11
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -24,7 +24,8 @@ class WPComicsFactory : SourceFactory {
XoxoComics(), XoxoComics(),
NhatTruyen(), NhatTruyen(),
NetTruyen(), NetTruyen(),
TruyenChon() TruyenChon(),
ComicLatest()
) )
} }
@ -106,3 +107,32 @@ private class TruyenChon : WPComics("TruyenChon", "http://truyenchon.com", "vi",
) )
} }
} }
private class ComicLatest : WPComics("ComicLatest", "https://comiclatest.com", "en", SimpleDateFormat("MM/dd/yyyy", Locale.US), null) {
//Hot only has one page
override val popularPath = "popular-comics"
override fun popularMangaFromElement(element: Element) = SManga.create().apply {
element.select("h3 a").let {
title = it.text()
setUrlWithoutDomain(it.attr("href"))
}
thumbnail_url = element.select("img").attr("data-original")
}
override fun chapterListParse(response: Response): List<SChapter> {
val chapters = mutableListOf<SChapter>()
fun parseChapters(document: Document) {
document.select(chapterListSelector()).map { chapters.add(chapterFromElement(it)) }
document.select("ul.pagination a[rel=next]").firstOrNull()?.let { a ->
parseChapters(client.newCall(GET(a.attr("abs:href"), headers)).execute().asJsoup())
}
}
parseChapters(response.asJsoup())
return chapters
}
override fun pageListRequest(chapter: SChapter) = GET("$baseUrl${chapter.url}/all", headers)
}