Initial commit

This commit is contained in:
almightyhak 2024-06-20 11:54:12 +07:00
commit 98ed7e8839
2263 changed files with 108711 additions and 0 deletions

View file

@ -0,0 +1,13 @@
ext {
extName = 'AnimeSAGA'
extClass = '.AnimeSAGA'
themePkg = 'dooplay'
baseUrl = 'https://www.animesaga.in'
overrideVersionCode = 9
}
apply from: "$rootDir/common.gradle"
dependencies {
implementation(project(":lib:chillx-extractor"))
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,62 @@
package eu.kanade.tachiyomi.animeextension.hi.animesaga
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.chillxextractor.ChillxExtractor
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.FormBody
import okhttp3.Response
import org.jsoup.nodes.Element
class AnimeSAGA : DooPlay(
"hi",
"AnimeSAGA",
"https://www.animesaga.in",
) {
private val videoHost = "https://cdn.animesaga.in"
// ============================== Popular ===============================
override fun popularAnimeSelector() = "div.top-imdb-list > div.top-imdb-item"
// ============================ Video Links =============================
override fun videoListParse(response: Response): List<Video> {
val playerUrls = response.asJsoup()
.select("ul#playeroptionsul li:not([id=player-option-trailer])")
.map(::getPlayerUrl)
return playerUrls.flatMap { url ->
runCatching {
getPlayerVideos(url)
}.getOrElse { emptyList() }
}
}
private val chillxExtractor by lazy { ChillxExtractor(client, headers) }
private fun getPlayerVideos(url: String): List<Video> {
return when {
videoHost in url -> chillxExtractor.videoFromUrl(url, "$baseUrl/")
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("\\", "")
}
}
}