diff --git a/src/ar/mangaalarab/AndroidManifest.xml b/src/ar/mangaalarab/AndroidManifest.xml new file mode 100644 index 000000000..30deb7f79 --- /dev/null +++ b/src/ar/mangaalarab/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/src/ar/mangaalarab/build.gradle b/src/ar/mangaalarab/build.gradle new file mode 100644 index 000000000..dd613de3d --- /dev/null +++ b/src/ar/mangaalarab/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'مانجا العرب' + pkgNameSuffix = 'ar.mangaalarab' + extClass = '.MangaAlarab' + extVersionCode = 1 + libVersion = '1.2' +} + +apply from: "$rootDir/common.gradle" diff --git a/src/ar/mangaalarab/res/mipmap-hdpi/ic_launcher.png b/src/ar/mangaalarab/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..92ef8fed7 Binary files /dev/null and b/src/ar/mangaalarab/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/ar/mangaalarab/res/mipmap-mdpi/ic_launcher.png b/src/ar/mangaalarab/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..ae10567e6 Binary files /dev/null and b/src/ar/mangaalarab/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/ar/mangaalarab/res/mipmap-xhdpi/ic_launcher.png b/src/ar/mangaalarab/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..0dcd70cc1 Binary files /dev/null and b/src/ar/mangaalarab/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/ar/mangaalarab/res/mipmap-xxhdpi/ic_launcher.png b/src/ar/mangaalarab/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..2565d71ef Binary files /dev/null and b/src/ar/mangaalarab/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/ar/mangaalarab/res/mipmap-xxxhdpi/ic_launcher.png b/src/ar/mangaalarab/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..011196ed8 Binary files /dev/null and b/src/ar/mangaalarab/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/ar/mangaalarab/res/web_hi_res_512.png b/src/ar/mangaalarab/res/web_hi_res_512.png new file mode 100644 index 000000000..947d07111 Binary files /dev/null and b/src/ar/mangaalarab/res/web_hi_res_512.png differ diff --git a/src/ar/mangaalarab/src/eu/kanade/tachiyomi/extension/ar/mangaalarab/MangaAlarab.kt b/src/ar/mangaalarab/src/eu/kanade/tachiyomi/extension/ar/mangaalarab/MangaAlarab.kt new file mode 100644 index 000000000..9e7806fc1 --- /dev/null +++ b/src/ar/mangaalarab/src/eu/kanade/tachiyomi/extension/ar/mangaalarab/MangaAlarab.kt @@ -0,0 +1,100 @@ +package eu.kanade.tachiyomi.extension.ar.mangaalarab + +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 org.jsoup.nodes.Document +import org.jsoup.nodes.Element + +class MangaAlarab : ParsedHttpSource() { + + override val name = "MangaAlarab" + + override val baseUrl = "https://mangaalarab.com" + + override val lang = "ar" + + override val supportsLatest = true + + // Popular + + override fun popularMangaRequest(page: Int): Request { + return GET("$baseUrl/manga?page=$page") + } + + override fun popularMangaSelector() = "article" + + override fun popularMangaFromElement(element: Element): SManga { + return SManga.create().apply { + element.select("a").let { + setUrlWithoutDomain(it.attr("abs:href")) + title = element.select("h3").text() + thumbnail_url = element.select("figure img").attr("data-src") + } + } + } + + override fun popularMangaNextPageSelector() = "a[rel=next]" + + // Latest + + override fun latestUpdatesRequest(page: Int): Request { + return GET(baseUrl) + } + + override fun latestUpdatesSelector() = popularMangaSelector() + + override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element) + + override fun latestUpdatesNextPageSelector(): String? = null + + // Search + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + return GET("$baseUrl/search?q=$query&page=$page", headers) + } + + override fun searchMangaSelector() = popularMangaSelector() + + override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) + + override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() + + // Details + + override fun mangaDetailsParse(document: Document): SManga { + return SManga.create().apply { + document.select("article").first().let { info -> + + description = info.select("p.text-sm").text() + } + } + } + + // Chapters + + override fun chapterListSelector() = "div.chapters-container > div > a" + + override fun chapterFromElement(element: Element): SChapter { + return SChapter.create().apply { + name = "${element.text()}" + setUrlWithoutDomain(element.attr("href")) + } + } + + // Pages + + override fun pageListParse(document: Document): List { + return document.select("div.container > div > div > img").mapIndexed { i, img -> + Page(i, "", img.attr("abs:src")) + } + } + + override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used") + + override fun getFilterList() = FilterList() +}