Add Haoman6 (#11381)
This commit is contained in:
		
							parent
							
								
									05c00f1760
								
							
						
					
					
						commit
						3bf4b091d7
					
				
							
								
								
									
										2
									
								
								src/zh/haoman6/AndroidManifest.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								src/zh/haoman6/AndroidManifest.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<manifest package="eu.kanade.tachiyomi.extension" />
 | 
			
		||||
							
								
								
									
										11
									
								
								src/zh/haoman6/build.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/zh/haoman6/build.gradle
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
apply plugin: 'com.android.application'
 | 
			
		||||
apply plugin: 'kotlin-android'
 | 
			
		||||
 | 
			
		||||
ext {
 | 
			
		||||
    extName = 'Haoman6'
 | 
			
		||||
    pkgNameSuffix = 'zh.haoman6'
 | 
			
		||||
    extClass = '.Haoman6'
 | 
			
		||||
    extVersionCode = 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
apply from: "$rootDir/common.gradle"
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-hdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-hdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 2.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-mdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-mdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1.5 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 3.6 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 6.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xxxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/mipmap-xxxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 8.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/zh/haoman6/res/web_hi_res_512.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/zh/haoman6/res/web_hi_res_512.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 24 KiB  | 
@ -0,0 +1,82 @@
 | 
			
		||||
package eu.kanade.tachiyomi.extension.zh.haoman6
 | 
			
		||||
 | 
			
		||||
import eu.kanade.tachiyomi.network.GET
 | 
			
		||||
import eu.kanade.tachiyomi.source.model.FilterList
 | 
			
		||||
import eu.kanade.tachiyomi.source.model.Page
 | 
			
		||||
import eu.kanade.tachiyomi.source.model.SChapter
 | 
			
		||||
import eu.kanade.tachiyomi.source.model.SManga
 | 
			
		||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
 | 
			
		||||
import okhttp3.Request
 | 
			
		||||
import okhttp3.Response
 | 
			
		||||
import org.jsoup.nodes.Document
 | 
			
		||||
import org.jsoup.nodes.Element
 | 
			
		||||
 | 
			
		||||
class Haoman6 : ParsedHttpSource() {
 | 
			
		||||
    override val name: String = "好漫6"
 | 
			
		||||
    override val lang: String = "zh"
 | 
			
		||||
    override val supportsLatest: Boolean = false
 | 
			
		||||
    override val baseUrl: String = "https://www.haoman6.com"
 | 
			
		||||
 | 
			
		||||
    // Popular
 | 
			
		||||
 | 
			
		||||
    override fun popularMangaRequest(page: Int) = GET("$baseUrl/custom/hot", headers)
 | 
			
		||||
    override fun popularMangaNextPageSelector(): String? = null
 | 
			
		||||
    override fun popularMangaSelector(): String = "div.top-list__box > div.top-list__box-item"
 | 
			
		||||
    override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply {
 | 
			
		||||
        title = element.select("p.comic__title > a").text()
 | 
			
		||||
        setUrlWithoutDomain(element.select("p.comic__title > a").attr("abs:href"))
 | 
			
		||||
        thumbnail_url = element.select("img").attr("abs:data-original")
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Latest
 | 
			
		||||
 | 
			
		||||
    override fun latestUpdatesRequest(page: Int) = throw Exception("Not used")
 | 
			
		||||
    override fun latestUpdatesNextPageSelector() = throw Exception("Not used")
 | 
			
		||||
    override fun latestUpdatesSelector() = throw Exception("Not used")
 | 
			
		||||
    override fun latestUpdatesFromElement(element: Element) = throw Exception("Not used")
 | 
			
		||||
 | 
			
		||||
    // Search
 | 
			
		||||
 | 
			
		||||
    override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
 | 
			
		||||
        return GET("$baseUrl/search/$query/$page", headers)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun searchMangaNextPageSelector(): String? = "div#Pagination a.next"
 | 
			
		||||
    override fun searchMangaSelector(): String = "div.common-comic-item"
 | 
			
		||||
    override fun searchMangaFromElement(element: Element): SManga = SManga.create().apply {
 | 
			
		||||
        title = element.select("p.comic__title > a").text()
 | 
			
		||||
        setUrlWithoutDomain(element.select("p.comic__title > a").attr("abs:href"))
 | 
			
		||||
        thumbnail_url = element.select("img").attr("abs:data-original")
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Details
 | 
			
		||||
 | 
			
		||||
    override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
 | 
			
		||||
        title = document.select("div.de-info__box > p.comic-title").text()
 | 
			
		||||
        thumbnail_url = document.select("div.de-info__cover > img").attr("abs:src")
 | 
			
		||||
        author = document.select("div.comic-author > span.name > a").text()
 | 
			
		||||
        artist = author
 | 
			
		||||
        genre = document.select("div.comic-status > span.text:nth-child(1) a").eachText().joinToString(", ")
 | 
			
		||||
        description = document.select("div.comic-intro > p.intro-total").text()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Chapters
 | 
			
		||||
 | 
			
		||||
    override fun chapterListSelector(): String = "ul.chapter__list-box > li"
 | 
			
		||||
    override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
 | 
			
		||||
        setUrlWithoutDomain(element.select("a").attr("abs:href"))
 | 
			
		||||
        name = element.select("a").text()
 | 
			
		||||
    }
 | 
			
		||||
    override fun chapterListParse(response: Response): List<SChapter> {
 | 
			
		||||
        return super.chapterListParse(response).reversed()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Pages
 | 
			
		||||
 | 
			
		||||
    override fun pageListParse(document: Document): List<Page> {
 | 
			
		||||
        return document.select("div.rd-article__pic > img.lazy-read")
 | 
			
		||||
            .mapIndexed { i, el -> Page(i, "", el.attr("abs:echo-pc")) }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun imageUrlParse(document: Document): String = throw Exception("Not Used")
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user