Manga Weeaboo: migrate to Madara (#9500)

This commit is contained in:
ObserverOfTime 2021-10-18 12:14:38 +03:00 committed by GitHub
parent 050fd89919
commit 17f0fa1889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 8 additions and 120 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,7 @@
package eu.kanade.tachiyomi.extension.en.mangaweeaboo
import eu.kanade.tachiyomi.multisrc.madara.Madara
class MangaWeeaboo : Madara("Manga Weeaboo", "https://mangaweeaboo.com", "en") {
override val useNewChapterEndpoint = true
}

View File

@ -423,6 +423,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("مانجا عرب تيم Manga Arab Team", "https://mangaarbteam.com", "ar", className = "MangaArabTeam", overrideVersionCode = 1),
SingleLang("مانجا ليك", "https://mangalek.com", "ar", className = "Mangalek", overrideVersionCode = 1),
SingleLang("مانجا لينك", "https://mangalink.io", "ar", className = "MangaLinkio", overrideVersionCode = 2),
SingleLang("Manga Weeaboo", "https://mangaweeaboo.com", "en", overrideVersionCode = 1),
)
companion object {

View File

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

View File

@ -1,11 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'Manga Weeaboo'
pkgNameSuffix = 'en.mangaweeaboo'
extClass = '.MangaWeeaboo'
extVersionCode = 1
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View File

@ -1,107 +0,0 @@
package eu.kanade.tachiyomi.extension.en.mangaweeaboo
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 org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class MangaWeeaboo : ParsedHttpSource() {
override val name = "Manga Weeaboo"
override val baseUrl = "https://mangaweeaboo.com"
override val lang = "en"
override val supportsLatest = false
override fun popularMangaRequest(page: Int) =
GET("$baseUrl/all/", headers)
override fun popularMangaSelector() = ".pt-cv-ifield"
override fun popularMangaNextPageSelector(): String? = null
override fun popularMangaFromElement(element: Element) =
SManga.create().apply {
element.selectFirst(".pt-cv-title > a").let {
title = it.text()
setUrlWithoutDomain(it.attr("href"))
}
thumbnail_url = element.selectFirst(".lazyload").attr("data-src")
}
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) =
GET("$baseUrl/page/$page/?s=$query", headers)
override fun searchMangaSelector() = ".post-content:not(:contains(Updates))"
override fun searchMangaNextPageSelector() = ".pagination .next"
override fun searchMangaFromElement(element: Element) =
SManga.create().apply {
element.selectFirst(".entry-title > a").let {
title = it.text()
setUrlWithoutDomain(it.attr("href"))
}
thumbnail_url = element.selectFirst(".lazyload").attr("data-src")
}
override fun mangaDetailsParse(document: Document) =
SManga.create().apply {
title = document.selectFirst(".elementor-heading-title").text()
description = document.selectFirst(".elementor-tab-content > p").text()
document.selectFirst(".elementor-icon-list-item:nth-child(1)").text()
.let { if (it != "Alternate: Updating") description += "\n\n$it" }
thumbnail_url = document.selectFirst(".size-full.lazyload").attr("data-src")
author = document.selectFirst(".elementor-icon-list-item:nth-child(2)")
.text().substringAfter("Author: ").takeIf { it != "Updating" }
artist = author
status = when (document.selectFirst(".elementor-icon-list-item:nth-child(3)").text()) {
"Status: Ongoing" -> SManga.ONGOING
else -> SManga.UNKNOWN
}
genre = document.selectFirst(".elementor-icon-list-item:nth-child(4)")
.text().substringAfter("Genres: ").takeIf { it != "Updating" }
}
override fun chapterListSelector() = ".insideframe li:contains(Chapter)"
override fun chapterFromElement(element: Element) =
SChapter.create().apply {
element.selectFirst("a").let {
setUrlWithoutDomain(it.attr("href"))
chapter_number = it.text().substringAfterLast(' ').toFloat()
name = "Chapter %.0f".format(chapter_number)
}
date_upload = dateFormat.parse(element.selectFirst(".date").text())?.time ?: 0L
}
override fun pageListParse(document: Document) =
document.select(".elementor-widget-container > .attachment-full")
.mapIndexed { idx, img -> Page(idx, "", img.attr("data-src")) }
override fun latestUpdatesRequest(page: Int) =
throw UnsupportedOperationException("Not used")
override fun latestUpdatesSelector() = ""
override fun latestUpdatesNextPageSelector(): String? = null
override fun latestUpdatesFromElement(element: Element) =
throw UnsupportedOperationException("Not used")
override fun imageUrlParse(document: Document) =
throw UnsupportedOperationException("Not used")
companion object {
private val dateFormat by lazy {
SimpleDateFormat("dd/MM/yyyy", Locale.ROOT)
}
}
}