MMRCMS Fixes (#2333)

* MMRCMS Fixes

Updated Latest Updates
Fixed Details - Title

* Update urls

* Add Generator Warning
This commit is contained in:
happywillow0 2020-03-01 15:02:36 -05:00 committed by GitHub
parent d4986b08f5
commit 68c786e14f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 33 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: My Manga Reader CMS (Many sources)' appName = 'Tachiyomi: My Manga Reader CMS (Many sources)'
pkgNameSuffix = 'all.mmrcms' pkgNameSuffix = 'all.mmrcms'
extClass = '.MyMangaReaderCMSSources' extClass = '.MyMangaReaderCMSSources'
extVersionCode = 29 extVersionCode = 30
libVersion = '1.2' libVersion = '1.2'
} }

File diff suppressed because one or more lines are too long

View File

@ -73,6 +73,7 @@ class Generator {
map["tags"] = tags map["tags"] = tags
} }
if (!itemUrl.startsWith(it.third)) println("**Note: ${it.second} URL does not match! Check for changes: \n ${it.third} vs $itemUrl")
val toJson = Gson().toJson(map) val toJson = Gson().toJson(map)
@ -166,8 +167,8 @@ class Generator {
} }
private fun supportsLatest(third: String): Boolean { private fun supportsLatest(third: String): Boolean {
val document = getDocument("$third/filterList?page=1&sortBy=last_release&asc=false", false) ?: return false val document = getDocument("$third/latest-release?page=1", false) ?: return false
return document.select("div[class^=col-sm], div.col-xs-6").isNotEmpty() return document.select("div.mangalist div.manga-item a").isNotEmpty()
} }
private fun parseCategories(document: Document): MutableList<Map<String, String>> { private fun parseCategories(document: Document): MutableList<Map<String, String>> {
@ -231,8 +232,8 @@ class Generator {
Triple("en", "Fallen Angels", "https://manga.fascans.com"), Triple("en", "Fallen Angels", "https://manga.fascans.com"),
Triple("en", "Mangawww Reader", "https://mangawww.club"), Triple("en", "Mangawww Reader", "https://mangawww.club"),
Triple("en", "White Cloud Pavilion", "https://www.whitecloudpavilion.com/manga/free"), Triple("en", "White Cloud Pavilion", "https://www.whitecloudpavilion.com/manga/free"),
Triple("fr", "Scan FR", "https://www.scan-fr.io"), Triple("fr", "Scan FR", "https://www.scan-fr.co"),
Triple("fr", "Scan VF", "https://www.scan-vf.co"), Triple("fr", "Scan VF", "https://www.scan-vf.net"),
Triple("id", "Komikid", "https://www.komikid.com"), Triple("id", "Komikid", "https://www.komikid.com"),
Triple("pl", "ToraScans", "http://torascans.pl"), Triple("pl", "ToraScans", "http://torascans.pl"),
Triple("pt", "Comic Space", "https://www.comicspace.com.br"), Triple("pt", "Comic Space", "https://www.comicspace.com.br"),
@ -245,7 +246,7 @@ class Generator {
Triple("es", "submanga", "https://submanga.li"), Triple("es", "submanga", "https://submanga.li"),
Triple("es", "Mangadoor", "https://mangadoor.com"), Triple("es", "Mangadoor", "https://mangadoor.com"),
Triple("es", "Mangas.pw", "https://mangas.pw"), Triple("es", "Mangas.pw", "https://mangas.pw"),
Triple("es", "Tumangaonline.co", "http://tumangaonline.co"), Triple("es", "Tumangaonline.co", "http://tumangaonline.fun"),
Triple("bg", "Utsukushii", "https://manga.utsukushii-bg.com"), Triple("bg", "Utsukushii", "https://manga.utsukushii-bg.com"),
Triple("es", "Universo Yuri", "https://universoyuri.com"), Triple("es", "Universo Yuri", "https://universoyuri.com"),
Triple("pl", "Phoenix-Scans", "https://phoenix-scans.pl"), Triple("pl", "Phoenix-Scans", "https://phoenix-scans.pl"),

View File

@ -52,7 +52,7 @@ class MyMangaReaderCMSSource(override val lang: String,
return GET(url.toString(), headers) return GET(url.toString(), headers)
} }
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/filterList?page=$page&sortBy=last_release&asc=false", headers) override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/latest-release?page=$page", headers)
override fun popularMangaParse(response: Response) = internalMangaParse(response) override fun popularMangaParse(response: Response) = internalMangaParse(response)
override fun searchMangaParse(response: Response): MangasPage { override fun searchMangaParse(response: Response): MangasPage {
@ -75,7 +75,26 @@ class MyMangaReaderCMSSource(override val lang: String,
} }
} }
override fun latestUpdatesParse(response: Response) = internalMangaParse(response) override fun latestUpdatesParse(response: Response): MangasPage {
val document = response.asJsoup()
val mangas = document.select(latestUpdatesSelector()).map { element ->
latestUpdatesFromElement(element)
}.distinctBy { manga -> manga.url }
val hasNextPage = latestUpdatesNextPageSelector()?.let { selector ->
document.select(selector).first()
} != null
return MangasPage(mangas, hasNextPage)
}
private fun latestUpdatesSelector() = "div.mangalist div.manga-item"
private fun latestUpdatesNextPageSelector() = "a[rel=next]"
private fun latestUpdatesFromElement(element: Element): SManga = SManga.create().apply {
setUrlWithoutDomain(element.select("a").first().attr("abs:href"))
title = element.select("a").first().text().trim()
thumbnail_url = "$baseUrl/uploads/manga/${url.substringAfterLast('/')}/cover/cover_250x350.jpg"
}
private fun internalMangaParse(response: Response): MangasPage { private fun internalMangaParse(response: Response): MangasPage {
val document = response.asJsoup() val document = response.asJsoup()
@ -141,7 +160,7 @@ class MyMangaReaderCMSSource(override val lang: String,
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
override fun mangaDetailsParse(response: Response) = SManga.create().apply { override fun mangaDetailsParse(response: Response) = SManga.create().apply {
val document = response.asJsoup() val document = response.asJsoup()
title = document.getElementsByClass("widget-title").text().trim() title = document.getElementsByClass("widget-title").first().text().trim()
thumbnail_url = coverGuess(document.select(".row [class^=img-responsive]").firstOrNull()?.attr("abs:src"), document.location()) thumbnail_url = coverGuess(document.select(".row [class^=img-responsive]").firstOrNull()?.attr("abs:src"), document.location())
description = document.select(".row .well p").text().trim() description = document.select(".row .well p").text().trim()