diff --git a/src/pt/animesgratis/build.gradle b/src/pt/animesgratis/build.gradle index a5401609cc..c794b9114a 100644 --- a/src/pt/animesgratis/build.gradle +++ b/src/pt/animesgratis/build.gradle @@ -1,9 +1,9 @@ ext { - extName = 'AnimesOnline' - extClass = '.AnimesOnline' + extName = 'Bakashi' + extClass = '.Bakashi' themePkg = 'dooplay' - baseUrl = 'https://animesonline.nz' - overrideVersionCode = 9 + baseUrl = 'https://bakashi.tv' + overrideVersionCode = 10 } apply from: "$rootDir/common.gradle" @@ -14,4 +14,4 @@ dependencies { implementation(project(":lib:streamwish-extractor")) implementation(project(":lib:mixdrop-extractor")) implementation(project(":lib:streamtape-extractor")) -} \ No newline at end of file +} diff --git a/src/pt/animesgratis/res/mipmap-hdpi/ic_launcher.png b/src/pt/animesgratis/res/mipmap-hdpi/ic_launcher.png index ee3ee073e9..64569bfbe9 100644 Binary files a/src/pt/animesgratis/res/mipmap-hdpi/ic_launcher.png and b/src/pt/animesgratis/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/pt/animesgratis/res/mipmap-mdpi/ic_launcher.png b/src/pt/animesgratis/res/mipmap-mdpi/ic_launcher.png index 9964868db4..3dd37e28e1 100644 Binary files a/src/pt/animesgratis/res/mipmap-mdpi/ic_launcher.png and b/src/pt/animesgratis/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/pt/animesgratis/res/mipmap-xhdpi/ic_launcher.png b/src/pt/animesgratis/res/mipmap-xhdpi/ic_launcher.png index dab9987857..b7983ef97f 100644 Binary files a/src/pt/animesgratis/res/mipmap-xhdpi/ic_launcher.png and b/src/pt/animesgratis/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/pt/animesgratis/res/mipmap-xxhdpi/ic_launcher.png b/src/pt/animesgratis/res/mipmap-xxhdpi/ic_launcher.png index f5bea39c06..9a21504ce8 100644 Binary files a/src/pt/animesgratis/res/mipmap-xxhdpi/ic_launcher.png and b/src/pt/animesgratis/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/pt/animesgratis/res/mipmap-xxxhdpi/ic_launcher.png b/src/pt/animesgratis/res/mipmap-xxxhdpi/ic_launcher.png index 88c91dab39..4bb9c4c9a9 100644 Binary files a/src/pt/animesgratis/res/mipmap-xxxhdpi/ic_launcher.png and b/src/pt/animesgratis/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/AnimesOnline.kt b/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/Bakashi.kt similarity index 75% rename from src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/AnimesOnline.kt rename to src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/Bakashi.kt index 2b2a63176a..a10701cbd6 100644 --- a/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/AnimesOnline.kt +++ b/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/Bakashi.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.animeextension.pt.animesgratis -import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.AnimesOnlinePlayerExtractor +import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.NoaExtractor import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.RuplayExtractor import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.Video @@ -11,26 +11,24 @@ import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor 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.HttpUrl.Companion.toHttpUrl import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element -class AnimesOnline : DooPlay( +class Bakashi : DooPlay( "pt-BR", - "AnimesOnline", - "https://animesonline.nz", + "Bakashi", + "https://bakashi.tv", ) { override val id: Long = 2969482460524685571L // ============================== Popular =============================== - override fun popularAnimeSelector() = "div.sidebar.right article > a" - override fun popularAnimeRequest(page: Int) = GET("$baseUrl/animes/") + override fun popularAnimeSelector() = "div.items.featured article div.poster" + override fun popularAnimeRequest(page: Int) = GET("$baseUrl/animes/", headers) // =============================== Search =============================== override fun searchAnimeSelector() = "div.result-item article div.thumbnail > a" @@ -64,7 +62,7 @@ class AnimesOnline : DooPlay( override val prefQualityEntries = prefQualityValues private val ruplayExtractor by lazy { RuplayExtractor(client) } - private val animesOnlineExtractor by lazy { AnimesOnlinePlayerExtractor(client) } + private val noaExtractor by lazy { NoaExtractor(client, headers) } private val bloggerExtractor by lazy { BloggerExtractor(client) } private val filemoonExtractor by lazy { FilemoonExtractor(client) } private val streamTapeExtractor by lazy { StreamTapeExtractor(client) } @@ -79,45 +77,29 @@ class AnimesOnline : DooPlay( "streamwish" in name -> streamWishExtractor.videosFromUrl(url) "filemoon" in name -> filemoonExtractor.videosFromUrl(url) "mixdrop" in name -> mixDropExtractor.videoFromUrl(url) - "streamtape" in name -> - streamTapeExtractor.videoFromUrl(url) - ?.let(::listOf) - ?: emptyList() - "/player1/" in url || "/player2/" in url -> - animesOnlineExtractor.videosFromUrl(url) + "streamtape" in name -> streamTapeExtractor.videosFromUrl(url) + "/noance/" in url || "/noa" in url -> noaExtractor.videosFromUrl(url) "/player/" in url -> bloggerExtractor.videosFromUrl(url, headers) else -> emptyList() } } private fun getPlayerUrl(player: Element): String? { - val body = FormBody.Builder() - .add("action", "doo_player_ajax") - .add("post", player.attr("data-post")) - .add("nume", player.attr("data-nume")) - .add("type", player.attr("data-type")) - .build() - - return client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", headers, body)) - .execute() - .let { response -> - response.body.string() - .substringAfter("\"embed_url\":\"") - .substringBefore("\",") - .replace("\\", "") - .takeIf(String::isNotBlank) - ?.let { - when { - it.contains("$baseUrl/aviso/") -> - it.toHttpUrl().queryParameter("url") - else -> it - } - } + val playerId = player.attr("data-nume") + val iframe = player.root().selectFirst("div#source-player-$playerId iframe") + + return iframe?.attr("src")?.takeIf(String::isNotBlank) + ?.let { + when { + it.contains("/aviso/") -> + it.toHttpUrl().queryParameter("url") + else -> it + } } } // ============================== Filters =============================== - override fun genresListRequest() = GET("$baseUrl/animes/") + override fun genresListRequest() = popularAnimeRequest(0) override fun genresListSelector() = "div.filter > div.select:first-child option:not([disabled])" override fun genresListParse(document: Document): Array> { diff --git a/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/AnimesOnlinePlayerExtractor.kt b/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/NoaExtractor.kt similarity index 80% rename from src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/AnimesOnlinePlayerExtractor.kt rename to src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/NoaExtractor.kt index cd0dcb5d2f..83b334d069 100644 --- a/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/AnimesOnlinePlayerExtractor.kt +++ b/src/pt/animesgratis/src/eu/kanade/tachiyomi/animeextension/pt/animesgratis/extractors/NoaExtractor.kt @@ -2,9 +2,10 @@ package eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.network.GET +import okhttp3.Headers import okhttp3.OkHttpClient -class AnimesOnlinePlayerExtractor(private val client: OkHttpClient) { +class NoaExtractor(private val client: OkHttpClient, private val headers: Headers) { fun videosFromUrl(url: String): List