Fix pages not loading at YaoiToshokan (#3877)

Fix pages not loading at YaoiToshokan
This commit is contained in:
Alessandro Jean 2020-07-23 13:19:05 -03:00 committed by GitHub
parent 4f46c13e95
commit 31e72707bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Madara (multiple sources)'
pkgNameSuffix = "all.madara"
extClass = '.MadaraFactory'
extVersionCode = 121
extVersionCode = 122
libVersion = '1.2'
}

View File

@ -682,16 +682,22 @@ class TeabeerComics : Madara("Teabeer Comics", "https://teabeercomics.com", "en"
class KingzManga : Madara("KingzManga", "https://kingzmanga.com", "ar")
class YaoiToshokan : Madara("Yaoi Toshokan", "https://www.yaoitoshokan.com.br", "pt-BR") {
override val popularMangaUrlSelector = "div.post-title a:not([target])" // Page has custom link to scan website
override fun chapterListParse(response: Response): List<SChapter> { // Chapters are listed old to new
class YaoiToshokan : Madara("Yaoi Toshokan", "https://yaoitoshokan.com.br", "pt-BR", SimpleDateFormat("dd MMM yyyy", Locale("pt", "BR"))) {
// Page has custom link to scan website.
override val popularMangaUrlSelector = "div.post-title a:not([target])"
// Chapters are listed old to new.
override fun chapterListParse(response: Response): List<SChapter> {
return super.chapterListParse(response).reversed()
}
override fun pageListParse(document: Document): List<Page> {
return document.select(pageListParseSelector).mapIndexed { index, element ->
Page(index, "", element.select("img").attr("data-src").trim()) // had to add trim because of white space in source
}
return document.select(pageListParseSelector)
.mapIndexed { index, element ->
// Had to add trim because of white space in source.
val imageUrl = element.select("img").attr("data-src").trim()
Page(index, document.location(), imageUrl)
}
}
}