Move MangaZen to seperate extension (#3838)

* Move MangaZen to seperate extension

* Correct ID

* Don't need to hardcode ID

Co-authored-by: snakedoc83 <mikepeterson83@gmail.com>
This commit is contained in:
AbdullahM0hamed 2020-07-20 10:17:14 +01:00 committed by GitHub
parent 32e76591a3
commit 541ae41f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Madara (multiple sources)'
pkgNameSuffix = "all.madara"
extClass = '.MadaraFactory'
extVersionCode = 119
extVersionCode = 120
libVersion = '1.2'
}

View File

@ -139,7 +139,6 @@ class MadaraFactory : SourceFactory {
RenaScans(),
WebtoonXYZ(),
ManhwaTime(),
MangaZen(),
QueensManga(),
DropeScan(),
TheTopComic(),
@ -1011,8 +1010,6 @@ class WebtoonXYZ : Madara("WebtoonXYZ", "https://www.webtoon.xyz", "en")
class ManhwaTime : Madara("ManhwaTime", "https://manhwatime.xyz", "en")
class MangaZen : Madara("MangaZen", "https://manga-zen.com/", "ar")
class MangaReadOrg : Madara("MangaRead.org", "https://www.mangaread.org", "en", SimpleDateFormat("dd.MM.yyy", Locale.US))
class TurkceManga : Madara("Türkçe Manga", "https://turkcemanga.com", "tr") {

View File

@ -0,0 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'MangaZen'
pkgNameSuffix = 'ar.mangazen'
extClass = '.MangaZen'
extVersionCode = 1
libVersion = '1.2'
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,86 @@
package eu.kanade.tachiyomi.extension.ar.mangazen
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.util.Locale
import java.text.SimpleDateFormat
class MangaZen: ParsedHttpSource() {
override val baseUrl = "https://manga-zen.com"
override val lang = "ar"
override val name = "MangaZen"
override val supportsLatest = true
override fun popularMangaRequest(page: Int) = GET("$baseUrl/قائمة-المانجا/page/$page", headers)
override fun popularMangaSelector() = "a[title][alt]"
override fun popularMangaFromElement(element: Element) = SManga.create().apply {
setUrlWithoutDomain(element.attr("href"))
title = element.attr("title")
thumbnail_url = element.select("img").attr("abs:src").substringBeforeLast("?quality")
}
override fun popularMangaNextPageSelector() = "div.pagination:not(:has(span:last-child))"
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/قائمة-المانجا/page/$page/?order=update", headers)
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/قائمة-المانجا/page/$page/?title=$query", headers)
override fun searchMangaSelector() = popularMangaSelector()
override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element)
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
description = document.select("div.desc").text()
genre = document.select("div.genre-info > a[itemprop=genre]").joinToString { it.text() }
status = parseStatus(document.select("div.spe").first().text())
}
private fun parseStatus(status: String) = when {
status.contains("مستمر") -> SManga.ONGOING
else -> SManga.COMPLETED
}
override fun chapterListSelector() = "div.epsleft"
override fun chapterFromElement(element: Element) = SChapter.create().apply {
setUrlWithoutDomain(element.select("a").attr("href"))
name = element.select("a").text().trim()
date_upload = dateFormat.parse(element.select("span.date").text().trim())?.time ?: 0
}
companion object {
val dateFormat by lazy {
SimpleDateFormat("MMM dd, yyyy", Locale("ar"))
}
}
override fun pageListParse(document: Document): List<Page> {
return document.select("noscript > img#imagech").mapIndexed { i, element ->
Page(i, "", element.attr("abs:src"))
}
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not Used")
override fun getFilterList() = FilterList()
}