MangaPro URL change and theme change to Madara (#13939)

* MangaPro URL change and theme change to Madara

* Update versionId

Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com>

Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com>
This commit is contained in:
Suyash Mittal 2022-10-22 07:11:36 +05:30 committed by GitHub
parent bb2d763405
commit 8eb7980779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 52 deletions

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -0,0 +1,17 @@
package eu.kanade.tachiyomi.extension.ar.mangaproz
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
class MangaPro : Madara("Manga Pro", "https://manga-pro.com", "ar") {
// Theme changed from MangaThemesia to Madara.
override val versionId = 2
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.rateLimit(4)
.build()
}

View File

@ -1,51 +0,0 @@
package eu.kanade.tachiyomi.extension.ar.mangaproz
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.OkHttpClient
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.concurrent.TimeUnit
class MangaPro : MangaThemesia("Manga Pro", "https://mangaprotm.com", "ar") {
override val id: Long = 964048798769065340
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.rateLimit(4)
.build()
override fun chapterListParse(response: Response): List<SChapter> =
super.chapterListParse(response).filter { it.url.isNotEmpty() }
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select(".lchx > a, span.leftoff a, div.eph-num > a").first()
val chapter = SChapter.create()
// ignore chapters that are protected behind ads shortners.
if (urlElement.attr("href").startsWith(baseUrl))
chapter.setUrlWithoutDomain(urlElement.attr("href"))
else
chapter.setUrlWithoutDomain("")
chapter.name = if (urlElement.select("span.chapternum")
.isNotEmpty()
) urlElement.select("span.chapternum").text() else urlElement.text()
chapter.name = chapter.name.replace("-*free".toRegex(RegexOption.IGNORE_CASE), "")
chapter.date_upload =
element.select("span.rightoff, time, span.chapterdate").firstOrNull()?.text()
.parseChapterDate()
return chapter
}
override fun mangaDetailsParse(document: Document): SManga =
super.mangaDetailsParse(document).apply {
document.selectFirst(seriesDetailsSelector)?.let { infoElement ->
thumbnail_url = infoElement.select(seriesThumbnailSelector).attr("abs:data-lazy-src")
}
}
}

View File

@ -202,6 +202,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Manga Mitsu", "https://mangamitsu.com", "en", isNsfw = true, overrideVersionCode = 2),
SingleLang("Manga One Love", "https://mangaonelove.site/", "ru", isNsfw = true),
SingleLang("Manga Online Team", "https://mangaonlineteam.com", "en"),
SingleLang("Manga Pro", "https://manga-pro.com", "ar", pkgName = "mangaproz", overrideVersionCode = 4),
SingleLang("Manga Queen", "https://mangaqueen.net", "en"),
SingleLang("Manga Read", "https://mangaread.co", "en", overrideVersionCode = 1),
SingleLang("Manga Rock Team", "https://mangarockteam.com", "en", overrideVersionCode = 1),

View File

@ -52,7 +52,6 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("Legion Scan", "https://legionscans.com", "es"),
SingleLang("LianScans", "https://www.lianscans.my.id", "id", isNsfw = true),
SingleLang("Magus Manga", "https://magusmanga.com", "ar"),
SingleLang("Manga Pro", "https://mangaprotm.com", "ar", pkgName = "mangaproz", overrideVersionCode = 3),
SingleLang("Manga Raw.org", "https://mangaraw.org", "ja", className = "MangaRawOrg", overrideVersionCode = 1),
SingleLang("Mangacim", "https://www.mangacim.com", "tr", overrideVersionCode = 1),
SingleLang("MangaKita", "https://mangakita.net", "id", overrideVersionCode = 1),