diff --git a/src/pt/animesbr/build.gradle b/src/pt/animesbr/build.gradle new file mode 100644 index 0000000000..c66bc9eb16 --- /dev/null +++ b/src/pt/animesbr/build.gradle @@ -0,0 +1,15 @@ +ext { + extName = 'AnimesBr' + extClass = '.AnimesBr' + themePkg = 'dooplay' + baseUrl = 'https://animesbr.tv' + overrideVersionCode = 1 + isNsfw = true +} + +apply from: "$rootDir/common.gradle" + +dependencies { + implementation("dev.datlag.jsunpacker:jsunpacker:1.0.1") + implementation(project(":lib:vidmoly-extractor")) +} diff --git a/src/pt/animesbr/res/mipmap-hdpi/ic_launcher.png b/src/pt/animesbr/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..4b1f5cae0a Binary files /dev/null and b/src/pt/animesbr/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/pt/animesbr/res/mipmap-mdpi/ic_launcher.png b/src/pt/animesbr/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..d32cf0ce2a Binary files /dev/null and b/src/pt/animesbr/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/pt/animesbr/res/mipmap-xhdpi/ic_launcher.png b/src/pt/animesbr/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..6df7154c82 Binary files /dev/null and b/src/pt/animesbr/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/pt/animesbr/res/mipmap-xxhdpi/ic_launcher.png b/src/pt/animesbr/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..324750a1f8 Binary files /dev/null and b/src/pt/animesbr/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/pt/animesbr/res/mipmap-xxxhdpi/ic_launcher.png b/src/pt/animesbr/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..986f334ee7 Binary files /dev/null and b/src/pt/animesbr/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/pt/animesbr/src/eu/kanade/tachiyomi/animeextension/pt/animesbr/AnimesBr.kt b/src/pt/animesbr/src/eu/kanade/tachiyomi/animeextension/pt/animesbr/AnimesBr.kt new file mode 100644 index 0000000000..921fa3a85c --- /dev/null +++ b/src/pt/animesbr/src/eu/kanade/tachiyomi/animeextension/pt/animesbr/AnimesBr.kt @@ -0,0 +1,174 @@ +package eu.kanade.tachiyomi.animeextension.pt.animesbr + +import androidx.preference.ListPreference +import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.animeextension.pt.animesbr.extractors.FourNimesExtractor +import eu.kanade.tachiyomi.animeextension.pt.animesbr.extractors.RuplayExtractor +import eu.kanade.tachiyomi.animesource.model.SAnime +import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.lib.vidmolyextractor.VidMolyExtractor +import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.util.asJsoup +import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking +import okhttp3.FormBody +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element + +class AnimesBr : DooPlay( + "pt-BR", + "Animes BR", + "https://animesbr.tv", +) { + + // ============================== Popular =============================== + override fun popularAnimeSelector() = "article.w_item_b > a" + + override fun popularAnimeRequest(page: Int) = GET(baseUrl, headers) + + // =============================== Latest =============================== + override val latestUpdatesPath = "episodios" + + override fun latestUpdatesNextPageSelector() = "div.pagination > a.arrow_pag > i.fa-caret-right" + + // =============================== Search =============================== + + // =========================== Anime Details ============================ + override val additionalInfoSelector = "div.wp-content" + + override fun Document.getDescription(): String { + return select("$additionalInfoSelector p") + .first { !it.text().contains("Todos os Episódios") } + ?.let { it.text() + "\n" } + ?: "" + } + + override fun animeDetailsParse(document: Document): SAnime { + val doc = getRealAnimeDoc(document) + val sheader = doc.selectFirst("div.sheader")!! + return SAnime.create().apply { + setUrlWithoutDomain(doc.location()) + sheader.selectFirst("div.poster > img")!!.let { + thumbnail_url = it.getImageUrl() + title = it.attr("alt").ifEmpty { + sheader.selectFirst("div.data > h1")!!.text() + }.replace("Todos os Episódios", "").trim() + } + + genre = sheader.select("div.data div.sgeneros > a") + .eachText() + .joinToString() + + doc.selectFirst("div#info")?.let { info -> + description = buildString { + append(doc.getDescription()) + additionalInfoItems.forEach { + info.getInfo(it)?.let(::append) + } + } + } + } + } + + // ============================ Video Links ============================= + override fun videoListParse(response: Response): List