Madara - add Manga Byte (#2955)
This commit is contained in:
		
							parent
							
								
									a73d8fbd8a
								
							
						
					
					
						commit
						312fdaa7e9
					
				@ -5,7 +5,7 @@ ext {
 | 
			
		||||
    appName = 'Tachiyomi: Madara (multiple sources)'
 | 
			
		||||
    pkgNameSuffix = "all.madara"
 | 
			
		||||
    extClass = '.MadaraFactory'
 | 
			
		||||
    extVersionCode = 82
 | 
			
		||||
    extVersionCode = 83
 | 
			
		||||
    libVersion = '1.2'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -355,7 +355,7 @@ abstract class Madara(
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private fun getXhrChapters(mangaId: String): Document {
 | 
			
		||||
    protected fun getXhrChapters(mangaId: String): Document {
 | 
			
		||||
        val xhrHeaders = headersBuilder().add("Content-Type: application/x-www-form-urlencoded; charset=UTF-8").build()
 | 
			
		||||
        val body = RequestBody.create(null, "action=manga_get_chapters&manga=$mangaId")
 | 
			
		||||
        return client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, body)).execute().asJsoup()
 | 
			
		||||
 | 
			
		||||
@ -112,7 +112,8 @@ class MadaraFactory : SourceFactory {
 | 
			
		||||
        MangaRockTeam(),
 | 
			
		||||
        MixedManga(),
 | 
			
		||||
        ManhuasWorld(),
 | 
			
		||||
        ArazNovel()
 | 
			
		||||
        ArazNovel(),
 | 
			
		||||
        MangaByte()
 | 
			
		||||
    )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -597,4 +598,19 @@ class ManhuasWorld : Madara("Manhuas World", "https://manhuasworld.com", "en")
 | 
			
		||||
class ArazNovel : Madara("ArazNovel", "https://www.araznovel.com", "tr", SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())) {
 | 
			
		||||
    override fun formBuilder(page: Int, popular: Boolean): FormBody.Builder = super.formBuilder(page, popular)
 | 
			
		||||
        .add("vars[meta_query][0][0][value]", "manga")
 | 
			
		||||
    override fun chapterListParse(response: Response): List<SChapter> {
 | 
			
		||||
        return getXhrChapters(response.asJsoup().select("div#manga-chapters-holder").attr("data-id")).let { document ->
 | 
			
		||||
            document.select("li.parent").let { elements ->
 | 
			
		||||
                if (!elements.isNullOrEmpty()) {
 | 
			
		||||
                    elements.reversed()
 | 
			
		||||
                        .map { volumeElement -> volumeElement.select(chapterListSelector()).map { chapterFromElement(it) } }
 | 
			
		||||
                        .flatten()
 | 
			
		||||
                } else {
 | 
			
		||||
                    document.select(chapterListSelector()).map { chapterFromElement(it) }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class MangaByte : Madara("Manga Byte", "https://mangabyte.com", "en")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user