Override manga details parsing (#8493)
This commit is contained in:
		
							parent
							
								
									98a385ca5d
								
							
						
					
					
						commit
						76ff5c9090
					
				
							
								
								
									
										49
									
								
								multisrc/overrides/madara/manhwanelo/src/ManhwaNelo.kt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								multisrc/overrides/madara/manhwanelo/src/ManhwaNelo.kt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,49 @@
 | 
			
		||||
package eu.kanade.tachiyomi.extension.en.manhwanelo
 | 
			
		||||
 | 
			
		||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
 | 
			
		||||
import eu.kanade.tachiyomi.source.model.SManga
 | 
			
		||||
import org.jsoup.nodes.Document
 | 
			
		||||
import java.util.Locale
 | 
			
		||||
 | 
			
		||||
class ManhwaNelo : Madara("ManhwaNelo", "https://manhwanelo.com", "en") {
 | 
			
		||||
 | 
			
		||||
    override fun mangaDetailsParse(document: Document): SManga {
 | 
			
		||||
        val manga = SManga.create()
 | 
			
		||||
        with(document) {
 | 
			
		||||
            select("div.detailsingle h1").first()?.let {
 | 
			
		||||
                manga.title = it.ownText()
 | 
			
		||||
            }
 | 
			
		||||
            select("div.author a").eachText().filter {
 | 
			
		||||
                it.notUpdating()
 | 
			
		||||
            }.joinToString().takeIf { it.isNotBlank() }?.let {
 | 
			
		||||
                manga.author = it
 | 
			
		||||
                // Site does not separate artist and author
 | 
			
		||||
                manga.artist = manga.author
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            select("div.description-summary div.summary__content").let {
 | 
			
		||||
                if (it.select("p").text().isNotEmpty()) {
 | 
			
		||||
                    manga.description = it.select("p").joinToString(separator = "\n\n") { p ->
 | 
			
		||||
                        p.text().replace("<br>", "\n")
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    manga.description = it.text()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            select("div.summary_image img").first()?.let {
 | 
			
		||||
                manga.thumbnail_url = imageFromElement(it)
 | 
			
		||||
            }
 | 
			
		||||
            select("div.status p").let {
 | 
			
		||||
                manga.status = when (it.text().substringAfter("| ")) {
 | 
			
		||||
                    "end" -> SManga.COMPLETED
 | 
			
		||||
                    "on-going" -> SManga.ONGOING
 | 
			
		||||
                    else -> SManga.UNKNOWN
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            manga.genre = select("div.genres a")
 | 
			
		||||
                .joinToString(", ") { element -> element.text().toLowerCase(Locale.ROOT) }
 | 
			
		||||
 | 
			
		||||
            return manga
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -256,7 +256,7 @@ class MadaraGenerator : ThemeSourceGenerator {
 | 
			
		||||
        SingleLang("Manhwa.biz", "https://manhwa.biz", "en", isNsfw = true, className = "Manhwabiz"),
 | 
			
		||||
        SingleLang("ManhwaBookShelf", "https://manhwabookshelf.com", "en"),
 | 
			
		||||
        SingleLang("Manhwafull", "https://manhwafull.com", "en"),
 | 
			
		||||
        SingleLang("ManhwaNelo", "https://manhwanelo.com", "en"),
 | 
			
		||||
        SingleLang("ManhwaNelo", "https://manhwanelo.com", "en", overrideVersionCode = 1),
 | 
			
		||||
        SingleLang("ManhwaPool", "https://manhwapool.com", "en"),
 | 
			
		||||
        SingleLang("Manhwatop", "https://manhwatop.com", "en", overrideVersionCode = 1),
 | 
			
		||||
        SingleLang("Manhwahentai.me", "https://manhwahentai.me", "en", className = "ManhwahentaiMe", isNsfw = true, overrideVersionCode = 1),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user