diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index 1f77be2d8..19cbb74af 100644 --- a/src/all/madara/build.gradle +++ b/src/all/madara/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Madara (multiple sources)' pkgNameSuffix = "all.madara" extClass = '.MadaraFactory' - extVersionCode = 119 + extVersionCode = 120 libVersion = '1.2' } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt index 25acb7c2b..a5a78efb4 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt @@ -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") { diff --git a/src/ar/mangazen/build.gradle b/src/ar/mangazen/build.gradle new file mode 100644 index 000000000..e55e74a6b --- /dev/null +++ b/src/ar/mangazen/build.gradle @@ -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" diff --git a/src/ar/mangazen/res/mipmap-hdpi/ic_launcher.png b/src/ar/mangazen/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 000000000..f0f45cb6b Binary files /dev/null and b/src/ar/mangazen/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/ar/mangazen/res/mipmap-mdpi/ic_launcher.png b/src/ar/mangazen/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 000000000..d1e28e8bf Binary files /dev/null and b/src/ar/mangazen/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/ar/mangazen/res/mipmap-xhdpi/ic_launcher.png b/src/ar/mangazen/res/mipmap-xhdpi/ic_launcher.png new file mode 100755 index 000000000..2de05349e Binary files /dev/null and b/src/ar/mangazen/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/ar/mangazen/res/mipmap-xxhdpi/ic_launcher.png b/src/ar/mangazen/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 000000000..4b0a43847 Binary files /dev/null and b/src/ar/mangazen/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/ar/mangazen/res/mipmap-xxxhdpi/ic_launcher.png b/src/ar/mangazen/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 000000000..47c9f27a5 Binary files /dev/null and b/src/ar/mangazen/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/ar/mangazen/res/web_hi_res_512.png b/src/ar/mangazen/res/web_hi_res_512.png new file mode 100755 index 000000000..1bb9d873b Binary files /dev/null and b/src/ar/mangazen/res/web_hi_res_512.png differ diff --git a/src/ar/mangazen/src/eu/kanade/tachiyomi/extension/ar/mangazen/MangaZen.kt b/src/ar/mangazen/src/eu/kanade/tachiyomi/extension/ar/mangazen/MangaZen.kt new file mode 100644 index 000000000..f0abd8cc2 --- /dev/null +++ b/src/ar/mangazen/src/eu/kanade/tachiyomi/extension/ar/mangazen/MangaZen.kt @@ -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 { + 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() +}