Add new madara source (#13808)

* Add new madara source

* Update

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:
Techeira Damián 2022-10-10 23:50:11 -03:00 committed by GitHub
parent f6c8f8135a
commit 2d22a17f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package eu.kanade.tachiyomi.extension.es.chunchunmarutranslations
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class ChunchunmaruTranslations : Madara(
"Chunchunmaru Translations",
"https://chunchunmarutl.com",
"es",
SimpleDateFormat("dd 'de' MMMMM 'de' yyyy", Locale("es"))
) {
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=views", headers)
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=latest", headers)
override fun chapterFromElement(element: Element): SChapter {
return super.chapterFromElement(element).apply {
chapter_number = name.split(" ").getOrNull(1)?.toFloatOrNull() ?: -1f
}
}
override fun chapterListParse(response: Response): List<SChapter> {
// Sorting list because they are in packs
return super.chapterListParse(response).sortedBy {
it.chapter_number
}
}
}

View File

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