boommanga removed (#5289)

This commit is contained in:
Aria Moradi 2021-01-02 01:06:24 +03:30 committed by GitHub
parent 9b2650074d
commit df39844d0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 0 additions and 227 deletions

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.kanade.tachiyomi.extension" />

View File

@ -1,12 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'BoomManga, ManManga, TwinsComics'
pkgNameSuffix = 'all.boommanga'
extClass = '.BoomMangaFactory'
extVersionCode = 3
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

View File

@ -1,132 +0,0 @@
package eu.kanade.tachiyomi.extension.all.boommanga
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 eu.kanade.tachiyomi.util.asJsoup
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
open class BoomManga(
override val name: String,
override val baseUrl: String,
override val lang: String
) : ParsedHttpSource() {
// override val name = "BoomManga"
// override val baseUrl = "https://m.boommanga.com/"
// override val lang = "en"
override val supportsLatest = true
override fun popularMangaRequest(page: Int) = GET("$baseUrl/category?sort=heat&page=$page", headers)
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/category?sort=new&page=$page", headers)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = HttpUrl.parse("$baseUrl/search?keyword=$query&page=$page")?.newBuilder()
return GET(url.toString(), headers)
}
override fun popularMangaSelector() = ".vertical-list > li"
override fun searchMangaSelector() = ".vertical-list2 > li"
override fun latestUpdatesSelector() = popularMangaSelector()
override fun chapterListSelector() = ".chapters > li"
override fun popularMangaNextPageSelector() = "script:containsData(next_page_url):not(script:containsData(false))"
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsRequest(manga: SManga) = GET(manga.url, headers)
override fun chapterListRequest(manga: SManga) = mangaDetailsRequest(manga)
override fun pageListRequest(chapter: SChapter) = GET(chapter.url, headers)
override fun popularMangaFromElement(element: Element) = mangaFromElement(element)
override fun latestUpdatesFromElement(element: Element) = mangaFromElement(element)
private fun mangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.url = element.select("a").attr("href")
manga.title = element.select("h4").text().trim()
manga.thumbnail_url = element.select("img").attr("src")
return manga
}
override fun searchMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.url = element.select("a").first().attr("href")
manga.title = element.select("h4").text().trim()
manga.author = element.select("p").first().text().trim()
manga.thumbnail_url = element.select("img").attr("src")
return manga
}
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
chapter.url = element.select("a").attr("href")
chapter.chapter_number = element.select("[data-num]").attr("data-num").toFloat()
val date = element.select(".date").text()
if (date.isNotBlank()) { chapter.date_upload = parseDate(date) }
chapter.name = nameselector(element).trim()
return chapter
}
open fun nameselector(element: Element) = element.select(".name").text()
override fun chapterListParse(response: Response): List<SChapter> {
return super.chapterListParse(response).reversed()
}
private fun parseDate(date: String): Long {
return SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.US).parse(date)?.time ?: 0L
}
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
manga.author = authorget(document)?.trim()
manga.artist = authorget(document)?.trim()
manga.description = document.select(".inner-text").text().trim()
manga.thumbnail_url = thumbnailget(document)
manga.genre = genreget(document)
manga.status = statusget(document)
return manga
}
open fun authorget(document: Document) = document.select(".comic-info").first()?.text()?.substringAfter("")?.substringBefore("HEAT")
open fun thumbnailget(document: Document) = document.select(".cover img").attr("src")
open fun genreget(document: Document) = document.select(".comic-info p").first().text()
open fun statusget(document: Document) = SManga.UNKNOWN
override fun pageListParse(response: Response): List<Page> {
val body = response.asJsoup()
val pages = mutableListOf<Page>()
val elements = body.select("img[data-src]")
for (i in 0 until elements.size) {
pages.add(Page(i, "", getImage(elements[i])))
}
return pages
}
private fun getImage(element: Element): String {
var url =
when {
element.attr("data-src").endsWith(".jpg") || element.attr("data-src").endsWith(".png") || element.attr("data-src").endsWith(".jpeg") -> element.attr("data-src")
element.attr("src").endsWith(".jpg") || element.attr("src").endsWith(".png") || element.attr("src").endsWith(".jpeg") -> element.attr("src")
else -> element.attr("data-src")
}
if (url.startsWith("//")) {
url = "https:$url"
}
return url
}
override fun pageListParse(document: Document) = throw Exception("Not used")
override fun imageUrlRequest(page: Page) = throw Exception("Not used")
override fun imageUrlParse(document: Document) = throw Exception("Not used")
}

View File

@ -1,81 +0,0 @@
package eu.kanade.tachiyomi.extension.all.boommanga
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.SManga
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
class BoomMangaFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
BoomMangacom(),
ManManga(),
TwinsComics(),
BoomMangazh(),
ManMangazh(),
TwinsComicszh()
)
}
class BoomMangacom : BoomManga("BoomManga", "https://m.boommanga.com", "en")
class ManManga : BoomManga("ManManga", "https://m.manmanga.com", "en") {
override fun nameselector(element: Element) = element.select("a").attr("alt")
override fun authorget(document: Document) = document.select(".author").text().substringAfter("").trim()
override fun thumbnailget(document: Document) = document.select(".bg-box .bg").attr("style").substringAfter("'").substringBefore("'")
override fun genreget(document: Document) = document.select(".tags span").joinToString(", ") {
it.text().trim()
}
override fun statusget(document: Document) = when (document.select(".type").text().substringAfter("").trim()) {
"Ongoing" -> SManga.ONGOING
"Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
}
class TwinsComics : BoomManga("TwinsComics", "https://m.twinscomics.com", "en") {
override fun nameselector(element: Element) = element.select("a").attr("alt")
override fun authorget(document: Document) = document.select(".author").text().substringAfter("").trim()
override fun thumbnailget(document: Document) = document.select(".bg-box .bg").attr("style").substringAfter("'").substringBefore("'")
override fun genreget(document: Document) = document.select(".tags span").joinToString(", ") {
it.text().trim()
}
override fun statusget(document: Document) = when (document.select(".type").text().substringAfter("").trim()) {
"Ongoing" -> SManga.ONGOING
"Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
}
class BoomMangazh : BoomManga("BoomManga", "https://m.boommanga.com/cn", "zh")
class ManMangazh : BoomManga("ManManga", "https://m.manmanga.com/cn", "zh") {
override fun nameselector(element: Element) = element.select("a").attr("alt")
override fun authorget(document: Document) = document.select(".author").text().substringAfter("").trim()
override fun thumbnailget(document: Document) = document.select(".bg-box .bg").attr("style").substringAfter("'").substringBefore("'")
override fun genreget(document: Document) = document.select(".tags span").joinToString(", ") {
it.text().trim()
}
override fun statusget(document: Document) = when (document.select(".type").text().substringAfter("").trim()) {
"连载中" -> SManga.ONGOING
// "Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
}
class TwinsComicszh : BoomManga("TwinsComics", "https://m.twinscomics.com/cn", "zh") {
override fun nameselector(element: Element) = element.select("a").attr("alt")
override fun authorget(document: Document) = document.select(".author").text().substringAfter("").trim()
override fun thumbnailget(document: Document) = document.select(".bg-box .bg").attr("style").substringAfter("'").substringBefore("'")
override fun genreget(document: Document) = document.select(".tags span").joinToString(", ") {
it.text().trim()
}
override fun statusget(document: Document) = when (document.select(".type").text().substringAfter("").trim()) {
"连载中" -> SManga.ONGOING
// "Completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
}