anitubeinua: Fix posters for recommendations and reformat code
This commit is contained in:
parent
0c99673a58
commit
d2baf99a12
1 changed files with 171 additions and 195 deletions
|
@ -12,7 +12,6 @@ import com.lagradost.models.Ajax
|
||||||
import com.lagradost.models.Link
|
import com.lagradost.models.Link
|
||||||
import com.lagradost.models.PlayerJson
|
import com.lagradost.models.PlayerJson
|
||||||
import com.lagradost.models.videoConstructor
|
import com.lagradost.models.videoConstructor
|
||||||
import java.util.*
|
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
|
@ -49,8 +48,9 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
private fun Element.toSearchResponse(): AnimeSearchResponse {
|
private fun Element.toSearchResponse(): AnimeSearchResponse {
|
||||||
val title = this.selectFirst(".story_c h2 a, div.text_content a")?.text()?.trim().toString()
|
val title = this.selectFirst(".story_c h2 a, div.text_content a")?.text()?.trim().toString()
|
||||||
val href = this.selectFirst(".story_c h2 a, div.text_content a")?.attr("href").toString()
|
val href = this.selectFirst(".story_c h2 a, div.text_content a")?.attr("href").toString()
|
||||||
val posterUrl =
|
var posterUrl = this.selectFirst(".story_c_l span.story_post img")?.attr("src")
|
||||||
mainUrl + this.selectFirst(".story_c_l span.story_post img, a img")?.attr("src")
|
// For recommendations
|
||||||
|
if (posterUrl.isNullOrEmpty()) posterUrl = this.selectFirst("a img")?.attr("data-src")
|
||||||
|
|
||||||
var isSub = this.select(".box .sub").isNotEmpty()
|
var isSub = this.select(".box .sub").isNotEmpty()
|
||||||
var isDub = this.select(".box .ukr").isNotEmpty()
|
var isDub = this.select(".box .ukr").isNotEmpty()
|
||||||
|
@ -59,7 +59,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
isDub = true
|
isDub = true
|
||||||
}
|
}
|
||||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||||
this.posterUrl = posterUrl
|
this.posterUrl = mainUrl + posterUrl
|
||||||
addDubStatus(isDub, isSub)
|
addDubStatus(isDub, isSub)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,9 +72,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
mapOf(
|
mapOf(
|
||||||
"do" to "search",
|
"do" to "search",
|
||||||
"subaction" to "search",
|
"subaction" to "search",
|
||||||
"story" to query.replace(" ", "+")
|
"story" to query.replace(" ", "+")))
|
||||||
)
|
|
||||||
)
|
|
||||||
.document
|
.document
|
||||||
|
|
||||||
return document.select("article.story").map { it.toSearchResponse() }
|
return document.select("article.story").map { it.toSearchResponse() }
|
||||||
|
@ -88,8 +86,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
|
|
||||||
// Parse info
|
// Parse info
|
||||||
val title = document.selectFirst(".story_c h2")?.text()?.trim().toString()
|
val title = document.selectFirst(".story_c h2")?.text()?.trim().toString()
|
||||||
val poster =
|
val poster = mainUrl + document.selectFirst(".story_c_left span.story_post img")?.attr("src")
|
||||||
mainUrl + document.selectFirst(".story_c_left span.story_post img")?.attr("src")
|
|
||||||
val tags = someInfo.select("a[href*=/anime/]").map { it.text() }
|
val tags = someInfo.select("a[href*=/anime/]").map { it.text() }
|
||||||
val year = someInfo.select("a[href*=/xfsearch/year/]").text().toIntOrNull()
|
val year = someInfo.select("a[href*=/xfsearch/year/]").text().toIntOrNull()
|
||||||
|
|
||||||
|
@ -97,8 +94,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
val description = document.selectFirst("div.my-text")?.text()?.trim()
|
val description = document.selectFirst("div.my-text")?.text()?.trim()
|
||||||
// val author = someInfo.select("strong:contains(Студія:)").next().html()
|
// val author = someInfo.select("strong:contains(Студія:)").next().html()
|
||||||
val trailer = document.selectFirst(".rcol a.rollover")?.attr("href").toString()
|
val trailer = document.selectFirst(".rcol a.rollover")?.attr("href").toString()
|
||||||
val rating =
|
val rating = document.selectFirst(".lexington-box > div:last-child span")?.text().toRatingInt()
|
||||||
document.selectFirst(".lexington-box > div:last-child span")?.text().toRatingInt()
|
|
||||||
|
|
||||||
val recommendations = document.select(".horizontal ul li").map { it.toSearchResponse() }
|
val recommendations = document.select(".horizontal ul li").map { it.toSearchResponse() }
|
||||||
|
|
||||||
|
@ -107,14 +103,17 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
val subEpisodes = mutableListOf<Episode>()
|
val subEpisodes = mutableListOf<Episode>()
|
||||||
val dubEpisodes = mutableListOf<Episode>()
|
val dubEpisodes = mutableListOf<Episode>()
|
||||||
val id = url.split("/").last().split("-").first()
|
val id = url.split("/").last().split("-").first()
|
||||||
dle_login_hash = document.body().selectFirst("script")!!.html()
|
dle_login_hash =
|
||||||
|
document
|
||||||
|
.body()
|
||||||
|
.selectFirst("script")!!
|
||||||
|
.html()
|
||||||
.substringAfterLast("dle_login_hash = '")
|
.substringAfterLast("dle_login_hash = '")
|
||||||
.substringBefore("';")
|
.substringBefore("';")
|
||||||
|
|
||||||
val ajax =
|
val ajax =
|
||||||
fromPlaylistAjax(
|
fromPlaylistAjax(
|
||||||
"$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&user_hash=$dle_login_hash"
|
"$mainUrl/engine/ajax/playlists.php?news_id=$id&xfield=playlist&user_hash=$dle_login_hash")
|
||||||
)
|
|
||||||
|
|
||||||
if (!ajax.isNullOrEmpty()) { // Ajax list
|
if (!ajax.isNullOrEmpty()) { // Ajax list
|
||||||
ajax
|
ajax
|
||||||
|
@ -127,19 +126,11 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
if (it.urls.isDub) {
|
if (it.urls.isDub) {
|
||||||
dubEpisodes.add(
|
dubEpisodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${it.name}, $id, ${it.urls.isDub}",
|
"${it.name}, $id, ${it.urls.isDub}", it.name, episode = it.numberEpisode))
|
||||||
it.name,
|
|
||||||
episode = it.numberEpisode
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
subEpisodes.add(
|
subEpisodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${it.name}, $id, ${it.urls.isDub}",
|
"${it.name}, $id, ${it.urls.isDub}", it.name, episode = it.numberEpisode))
|
||||||
it.name,
|
|
||||||
episode = it.numberEpisode
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,8 +151,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
"$varEpisodeNumber, $url",
|
"$varEpisodeNumber, $url",
|
||||||
episode.episodeName,
|
episode.episodeName,
|
||||||
episode = varEpisodeNumber,
|
episode = varEpisodeNumber,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,8 +182,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
if (dataList[1].toIntOrNull() != null) { // Its ajax list
|
if (dataList[1].toIntOrNull() != null) { // Its ajax list
|
||||||
val ajax =
|
val ajax =
|
||||||
fromPlaylistAjax(
|
fromPlaylistAjax(
|
||||||
"$mainUrl/engine/ajax/playlists.php?news_id=${dataList[1]}&xfield=playlist&user_hash=$dle_login_hash"
|
"$mainUrl/engine/ajax/playlists.php?news_id=${dataList[1]}&xfield=playlist&user_hash=$dle_login_hash")
|
||||||
)
|
|
||||||
|
|
||||||
// Filter by name and isDub
|
// Filter by name and isDub
|
||||||
ajax
|
ajax
|
||||||
|
@ -207,16 +196,14 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
source = "${it.urls.playerName} (${it.urls.name})",
|
source = "${it.urls.playerName} (${it.urls.name})",
|
||||||
streamUrl = AshdiExtractor().ParseM3U8(this.urls.url),
|
streamUrl = AshdiExtractor().ParseM3U8(this.urls.url),
|
||||||
referer = "https://tortuga.wtf/"
|
referer = "https://tortuga.wtf/")
|
||||||
)
|
|
||||||
.forEach(callback)
|
.forEach(callback)
|
||||||
}
|
}
|
||||||
it.urls.url.contains("https://ashdi.vip/vod") -> {
|
it.urls.url.contains("https://ashdi.vip/vod") -> {
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
source = "${it.urls.playerName} (${it.urls.name})",
|
source = "${it.urls.playerName} (${it.urls.name})",
|
||||||
streamUrl = AshdiExtractor().ParseM3U8(this.urls.url),
|
streamUrl = AshdiExtractor().ParseM3U8(this.urls.url),
|
||||||
referer = "https://qeruya.cyou"
|
referer = "https://qeruya.cyou")
|
||||||
)
|
|
||||||
.forEach(callback)
|
.forEach(callback)
|
||||||
}
|
}
|
||||||
it.urls.url.contains("https://www.udrop.com") -> {
|
it.urls.url.contains("https://www.udrop.com") -> {
|
||||||
|
@ -228,22 +215,21 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
isM3u8 = false,
|
isM3u8 = false,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
it.urls.url.contains("https://csst.online/embed/") || it.urls.url.contains("https://monstro.site/embed/") -> {
|
it.urls.url.contains("https://csst.online/embed/") ||
|
||||||
csstExtractor().ParseUrl(it.urls.url).split(",").forEach { csstUrl
|
it.urls.url.contains("https://monstro.site/embed/") -> {
|
||||||
->
|
csstExtractor().ParseUrl(it.urls.url).split(",").forEach { csstUrl ->
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
this.urls.url,
|
this.urls.url,
|
||||||
name = "${it.urls.playerName} (${it.urls.name}) ${csstUrl.substringBefore("]").drop(1)}",
|
name =
|
||||||
|
"${it.urls.playerName} (${it.urls.name}) ${csstUrl.substringBefore("]").drop(1)}",
|
||||||
csstUrl.substringAfter("]"),
|
csstUrl.substringAfter("]"),
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
isM3u8 = false,
|
isM3u8 = false,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it.urls.url.contains("https://www.mp4upload.com/") -> {
|
it.urls.url.contains("https://www.mp4upload.com/") -> {
|
||||||
|
@ -257,8 +243,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
extlink.quality,
|
extlink.quality,
|
||||||
extlink.type,
|
extlink.type,
|
||||||
extlink.headers,
|
extlink.headers,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
|
@ -288,16 +273,14 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
source = dub.playerName,
|
source = dub.playerName,
|
||||||
streamUrl = AshdiExtractor().ParseM3U8(this),
|
streamUrl = AshdiExtractor().ParseM3U8(this),
|
||||||
referer = "https://tortuga.wtf/"
|
referer = "https://tortuga.wtf/")
|
||||||
)
|
|
||||||
.forEach(callback)
|
.forEach(callback)
|
||||||
}
|
}
|
||||||
contains("https://ashdi.vip/vod") -> {
|
contains("https://ashdi.vip/vod") -> {
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
source = dub.playerName,
|
source = dub.playerName,
|
||||||
streamUrl = AshdiExtractor().ParseM3U8(this),
|
streamUrl = AshdiExtractor().ParseM3U8(this),
|
||||||
referer = "https://qeruya.cyou"
|
referer = "https://qeruya.cyou")
|
||||||
)
|
|
||||||
.forEach(callback)
|
.forEach(callback)
|
||||||
}
|
}
|
||||||
contains("https://www.udrop.com") -> {
|
contains("https://www.udrop.com") -> {
|
||||||
|
@ -309,21 +292,20 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
isM3u8 = false,
|
isM3u8 = false,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
contains("https://monstro.site/embed/") || contains("https://csst.online/embed/") -> {
|
contains("https://monstro.site/embed/") ||
|
||||||
|
contains("https://csst.online/embed/") -> {
|
||||||
csstExtractor().ParseUrl(this).split(",").forEach {
|
csstExtractor().ParseUrl(this).split(",").forEach {
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
dub.playerName,
|
dub.playerName,
|
||||||
name = "${dub.playerName.replace("\"", "")} ${it.substringBefore("]").drop(1)}",
|
name =
|
||||||
|
"${dub.playerName.replace("\"", "")} ${it.substringBefore("]").drop(1)}",
|
||||||
it.substringAfter("]"),
|
it.substringAfter("]"),
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
isM3u8 = false
|
isM3u8 = false))
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contains("https://www.mp4upload.com/") -> {
|
contains("https://www.mp4upload.com/") -> {
|
||||||
|
@ -337,8 +319,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
extlink.quality,
|
extlink.quality,
|
||||||
extlink.type,
|
extlink.type,
|
||||||
extlink.headers,
|
extlink.headers,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
|
@ -441,9 +422,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
url,
|
url,
|
||||||
audio.toString(),
|
audio.toString(),
|
||||||
playerName,
|
playerName,
|
||||||
)
|
)))
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnEpisodes.toList()
|
return returnEpisodes.toList()
|
||||||
|
@ -451,8 +430,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
|
|
||||||
private fun fromVideoContructor(script: Element): List<videoConstructor> {
|
private fun fromVideoContructor(script: Element): List<videoConstructor> {
|
||||||
val playerScriptRawJson = script.data().substringAfterLast(".init(").substringBefore(");")
|
val playerScriptRawJson = script.data().substringAfterLast(".init(").substringBefore(");")
|
||||||
val playerEpisodesRawJson =
|
val playerEpisodesRawJson = playerScriptRawJson.substringAfter("],").substringBeforeLast(",")
|
||||||
playerScriptRawJson.substringAfter("],").substringBeforeLast(",")
|
|
||||||
val playerNamesArray =
|
val playerNamesArray =
|
||||||
(playerScriptRawJson.substringBefore("],") + "]")
|
(playerScriptRawJson.substringBefore("],") + "]")
|
||||||
.dropLast(1)
|
.dropLast(1)
|
||||||
|
@ -472,9 +450,7 @@ class AnitubeinuaProvider : MainAPI() {
|
||||||
playerName,
|
playerName,
|
||||||
it.name,
|
it.name,
|
||||||
extractIntFromString(it.name),
|
extractIntFromString(it.name),
|
||||||
Jsoup.parse(it.code).select("iframe").attr("src")
|
Jsoup.parse(it.code).select("iframe").attr("src")))
|
||||||
)
|
|
||||||
)
|
|
||||||
// Log.d("load-debug", "$playerName ${it.name}")
|
// Log.d("load-debug", "$playerName ${it.name}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue