mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
New providers (non-english) (#1342)
* All for one :) * moved Yomovies * small fix
This commit is contained in:
parent
54499f9e15
commit
d20d73b264
12 changed files with 606 additions and 32 deletions
|
@ -107,6 +107,7 @@ object APIHolder {
|
||||||
UakinoProvider(),
|
UakinoProvider(),
|
||||||
PhimmoichillProvider(),
|
PhimmoichillProvider(),
|
||||||
HDrezkaProvider(),
|
HDrezkaProvider(),
|
||||||
|
YomoviesProvider(),
|
||||||
|
|
||||||
|
|
||||||
// Metadata providers
|
// Metadata providers
|
||||||
|
@ -142,6 +143,8 @@ object APIHolder {
|
||||||
KuronimeProvider(),
|
KuronimeProvider(),
|
||||||
OtakudesuProvider(),
|
OtakudesuProvider(),
|
||||||
AnimeIndoProvider(),
|
AnimeIndoProvider(),
|
||||||
|
AnimeSailProvider(),
|
||||||
|
TocanimeProvider(),
|
||||||
//MultiAnimeProvider(),
|
//MultiAnimeProvider(),
|
||||||
NginxProvider(),
|
NginxProvider(),
|
||||||
OlgplyProvider(),
|
OlgplyProvider(),
|
||||||
|
|
|
@ -0,0 +1,191 @@
|
||||||
|
package com.lagradost.cloudstream3.animeproviders
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.mvvm.safeApiCall
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.Qualities
|
||||||
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
|
import com.lagradost.nicehttp.NiceResponse
|
||||||
|
import org.jsoup.Jsoup
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
|
class AnimeSailProvider : MainAPI() {
|
||||||
|
override var mainUrl = "https://111.90.143.42"
|
||||||
|
override var name = "AnimeSail"
|
||||||
|
override val hasMainPage = true
|
||||||
|
override var lang = "id"
|
||||||
|
override val hasDownloadSupport = true
|
||||||
|
|
||||||
|
override val supportedTypes = setOf(
|
||||||
|
TvType.Anime,
|
||||||
|
TvType.AnimeMovie,
|
||||||
|
TvType.OVA
|
||||||
|
)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun getType(t: String): TvType {
|
||||||
|
return if (t.contains("OVA") || t.contains("Special")) TvType.OVA
|
||||||
|
else if (t.contains("Movie")) TvType.AnimeMovie
|
||||||
|
else TvType.Anime
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getStatus(t: String): ShowStatus {
|
||||||
|
return when (t) {
|
||||||
|
"Completed" -> ShowStatus.Completed
|
||||||
|
"Ongoing" -> ShowStatus.Ongoing
|
||||||
|
else -> ShowStatus.Completed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun request(url: String, ref: String? = null): NiceResponse {
|
||||||
|
return app.get(
|
||||||
|
url,
|
||||||
|
headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"),
|
||||||
|
cookies = mapOf("_as_ipin_ct" to "ID"),
|
||||||
|
referer = ref
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getMainPage(): HomePageResponse {
|
||||||
|
val document = request(mainUrl).document
|
||||||
|
|
||||||
|
val homePageList = ArrayList<HomePageList>()
|
||||||
|
|
||||||
|
document.select(".bixbox").forEach { block ->
|
||||||
|
val header = block.select(".releases > h3").text().trim()
|
||||||
|
val animes = block.select("article").map {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
if (animes.isNotEmpty()) homePageList.add(HomePageList(header, animes))
|
||||||
|
}
|
||||||
|
|
||||||
|
return HomePageResponse(homePageList)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getProperAnimeLink(uri: String): String {
|
||||||
|
return if (uri.contains("/anime/")) {
|
||||||
|
uri
|
||||||
|
} else {
|
||||||
|
var title = uri.substringAfter("$mainUrl/")
|
||||||
|
title = when {
|
||||||
|
(title.contains("-episode")) && !(title.contains("-movie")) -> title.substringBefore(
|
||||||
|
"-episode"
|
||||||
|
)
|
||||||
|
(title.contains("-movie")) -> title.substringBefore("-movie")
|
||||||
|
else -> title
|
||||||
|
}
|
||||||
|
|
||||||
|
"$mainUrl/anime/$title"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Element.toSearchResult(): AnimeSearchResponse {
|
||||||
|
val href = getProperAnimeLink(fixUrlNull(this.selectFirst("a")?.attr("href")).toString())
|
||||||
|
val title = this.select(".tt > h2").text().trim()
|
||||||
|
val posterUrl = fixUrlNull(this.selectFirst("div.limit img")?.attr("src"))
|
||||||
|
val epNum = this.selectFirst(".tt > h2")?.text()?.let {
|
||||||
|
Regex("Episode\\s?([0-9]+)").find(it)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
||||||
|
}
|
||||||
|
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||||
|
this.posterUrl = posterUrl
|
||||||
|
addSub(epNum)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
|
val link = "$mainUrl/?s=$query"
|
||||||
|
val document = request(link).document
|
||||||
|
|
||||||
|
return document.select("div.listupd article").map {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse {
|
||||||
|
val document = request(url).document
|
||||||
|
|
||||||
|
val title = document.selectFirst("h1.entry-title")?.text().toString().trim()
|
||||||
|
val type = getType(
|
||||||
|
document.select("tbody th:contains(Tipe)").next().text()
|
||||||
|
)
|
||||||
|
val episodes = document.select("ul.daftar > li").map {
|
||||||
|
val header = it.select("a").text().trim()
|
||||||
|
val name = Regex("(Episode\\s?[0-9]+)").find(header)?.groupValues?.getOrNull(0) ?: header
|
||||||
|
val link = fixUrl(it.select("a").attr("href"))
|
||||||
|
Episode(link, name = name)
|
||||||
|
}.reversed()
|
||||||
|
|
||||||
|
return newAnimeLoadResponse(title, url, type) {
|
||||||
|
posterUrl = document.selectFirst("div.entry-content > img")?.attr("src")
|
||||||
|
this.year =
|
||||||
|
document.select("tbody th:contains(Dirilis)").next().text().trim().toIntOrNull()
|
||||||
|
addEpisodes(DubStatus.Subbed, episodes)
|
||||||
|
showStatus =
|
||||||
|
getStatus(document.select("tbody th:contains(Status)").next().text().trim())
|
||||||
|
plot = document.selectFirst("div.entry-content > p")?.text()
|
||||||
|
this.tags =
|
||||||
|
document.select("tbody th:contains(Genre)").next().select("a").map { it.text() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun loadLinks(
|
||||||
|
data: String,
|
||||||
|
isCasting: Boolean,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
): Boolean {
|
||||||
|
|
||||||
|
val document = request(data).document
|
||||||
|
|
||||||
|
document.select(".mobius > .mirror > option").apmap {
|
||||||
|
safeApiCall {
|
||||||
|
val iframe = fixUrl(
|
||||||
|
Jsoup.parse(base64Decode(it.attr("data-em"))).select("iframe").attr("src")
|
||||||
|
?: throw ErrorLoadingException("No iframe found")
|
||||||
|
)
|
||||||
|
|
||||||
|
when {
|
||||||
|
iframe.startsWith("$mainUrl/utils/player/arch/") || iframe.startsWith(
|
||||||
|
"$mainUrl/utils/player/race/"
|
||||||
|
) -> request(iframe, ref = data).document.select("source").attr("src")
|
||||||
|
.let { link ->
|
||||||
|
val source =
|
||||||
|
when {
|
||||||
|
iframe.contains("/arch/") -> "Arch"
|
||||||
|
iframe.contains("/race/") -> "Race"
|
||||||
|
else -> this.name
|
||||||
|
}
|
||||||
|
val quality = Regex("\\.([0-9]{3,4})\\.").find(link)?.groupValues?.get(1)
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
source = source,
|
||||||
|
name = source,
|
||||||
|
url = link,
|
||||||
|
referer = mainUrl,
|
||||||
|
quality = quality?.toIntOrNull() ?: Qualities.Unknown.value
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// skip for now
|
||||||
|
// iframe.startsWith("$mainUrl/utils/player/fichan/") -> ""
|
||||||
|
// iframe.startsWith("$mainUrl/utils/player/blogger/") -> ""
|
||||||
|
iframe.startsWith("$mainUrl/utils/player/framezilla/") || iframe.startsWith("https://uservideo.xyz") -> {
|
||||||
|
request(iframe, ref = data).document.select("iframe").attr("src")
|
||||||
|
.let { link ->
|
||||||
|
loadExtractor(fixUrl(link), mainUrl, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
loadExtractor(iframe, mainUrl, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -145,7 +145,7 @@ class GomunimeProvider : MainAPI() {
|
||||||
document.select(".bixbox.bxcl.epcheck > script").toString().trim()
|
document.select(".bixbox.bxcl.epcheck > script").toString().trim()
|
||||||
)?.groupValues?.get(1).toString().replace(Regex("""\\"""), "").trim()
|
)?.groupValues?.get(1).toString().replace(Regex("""\\"""), "").trim()
|
||||||
).map {
|
).map {
|
||||||
val name = it.epTitle
|
val name = Regex("(Episode\\s?[0-9]+)").find(it.epTitle.toString())?.groupValues?.getOrNull(0) ?: it.epTitle
|
||||||
val link = it.epLink
|
val link = it.epLink
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
|
|
|
@ -117,46 +117,36 @@ class NeonimeProvider : MainAPI() {
|
||||||
|
|
||||||
if (url.contains("movie") || url.contains("live-action")) {
|
if (url.contains("movie") || url.contains("live-action")) {
|
||||||
val mTitle = document.selectFirst(".sbox > .data > h1[itemprop = name]")?.text().toString().trim()
|
val mTitle = document.selectFirst(".sbox > .data > h1[itemprop = name]")?.text().toString().trim()
|
||||||
val mPoster =
|
|
||||||
document.selectFirst(".sbox > .imagen > .fix > img[itemprop = image]")?.attr("data-src")
|
|
||||||
val mTags = document.select("p.meta_dd > a").map { it.text() }
|
|
||||||
val mYear = document.selectFirst("a[href*=release-year]")!!.text().toIntOrNull()
|
|
||||||
val mDescription = document.select("div[itemprop = description]").text().trim()
|
|
||||||
val mRating = document.select("span[itemprop = ratingValue]").text().toIntOrNull()
|
|
||||||
val mTrailer = document.selectFirst("div.youtube_id iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
val mTrailer = document.selectFirst("div.youtube_id iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
||||||
|
|
||||||
return newMovieLoadResponse(name = mTitle, url = url, type = TvType.Movie, dataUrl = url) {
|
return newMovieLoadResponse(name = mTitle, url = url, type = TvType.Movie, dataUrl = url) {
|
||||||
posterUrl = mPoster
|
posterUrl = document.selectFirst(".sbox > .imagen > .fix > img[itemprop = image]")?.attr("data-src")
|
||||||
year = mYear
|
year = document.selectFirst("a[href*=release-year]")!!.text().toIntOrNull()
|
||||||
plot = mDescription
|
plot = document.select("div[itemprop = description]").text().trim()
|
||||||
rating = mRating
|
rating = document.select("span[itemprop = ratingValue]").text().toIntOrNull()
|
||||||
tags = mTags
|
tags = document.select("p.meta_dd > a").map { it.text() }
|
||||||
addTrailer(mTrailer)
|
addTrailer(mTrailer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val title = document.select("h1[itemprop = name]").text().trim()
|
val title = document.select("h1[itemprop = name]").text().trim()
|
||||||
val poster = document.selectFirst(".imagen > img")?.attr("data-src")
|
|
||||||
val tags = document.select("#info a[href*=\"-genre/\"]").map { it.text() }
|
|
||||||
val year = document.select("#info a[href*=\"-year/\"]").text().toIntOrNull()
|
|
||||||
val status = getStatus(document.select("div.metadatac > span").last()!!.text().trim())
|
|
||||||
val description = document.select("div[itemprop = description] > p").text().trim()
|
|
||||||
val trailer = document.selectFirst("div.youtube_id_tv iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
val trailer = document.selectFirst("div.youtube_id_tv iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
||||||
|
|
||||||
val episodes = document.select("ul.episodios > li").mapNotNull {
|
val episodes = document.select("ul.episodios > li").mapNotNull {
|
||||||
val name = it.selectFirst(".episodiotitle > a")!!.ownText().trim()
|
val header = it.selectFirst(".episodiotitle > a")?.ownText().toString()
|
||||||
|
val name = Regex("(Episode\\s?[0-9]+)").find(header)?.groupValues?.getOrNull(0) ?: header
|
||||||
val link = fixUrl(it.selectFirst(".episodiotitle > a")!!.attr("href"))
|
val link = fixUrl(it.selectFirst(".episodiotitle > a")!!.attr("href"))
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
|
|
||||||
return newAnimeLoadResponse(title, url, TvType.Anime) {
|
return newAnimeLoadResponse(title, url, TvType.Anime) {
|
||||||
engName = title
|
engName = title
|
||||||
posterUrl = poster
|
posterUrl = document.selectFirst(".imagen > img")?.attr("data-src")
|
||||||
this.year = year
|
year = document.select("#info a[href*=\"-year/\"]").text().toIntOrNull()
|
||||||
addEpisodes(DubStatus.Subbed, episodes)
|
addEpisodes(DubStatus.Subbed, episodes)
|
||||||
showStatus = status
|
showStatus = getStatus(document.select("div.metadatac > span").last()!!.text().trim())
|
||||||
plot = description
|
plot = document.select("div[itemprop = description] > p").text().trim()
|
||||||
this.tags = tags
|
tags = document.select("#info a[href*=\"-genre/\"]").map { it.text() }
|
||||||
addTrailer(trailer)
|
addTrailer(trailer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,16 +175,13 @@ class NontonAnimeIDProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
).parsed<EpResponse>().content
|
).parsed<EpResponse>().content
|
||||||
).select("li").map {
|
).select("li").map {
|
||||||
val engName =
|
val name = Regex("(Episode\\s?[0-9]+)").find(it.selectFirst("a")?.text().toString())?.groupValues?.getOrNull(0) ?: it.selectFirst("a")?.text()
|
||||||
document.selectFirst("div.bottomtitle:nth-child(4) > span:nth-child(1)")
|
val link = fixUrl(it.selectFirst("a")!!.attr("href"))
|
||||||
?.ownText()
|
|
||||||
val name = it.selectFirst("span.t1")!!.text().trim().replace("Episode", "$engName")
|
|
||||||
val link = it.selectFirst("a")!!.attr("href")
|
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
} else {
|
} else {
|
||||||
document.select("ul.misha_posts_wrap2 > li").map {
|
document.select("ul.misha_posts_wrap2 > li").map {
|
||||||
val name = it.select("span.t1").text().trim()
|
val name = Regex("(Episode\\s?[0-9]+)").find(it.selectFirst("a")?.text().toString())?.groupValues?.getOrNull(0) ?: it.selectFirst("a")?.text()
|
||||||
val link = it.select("a").attr("href")
|
val link = it.select("a").attr("href")
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
|
|
|
@ -143,7 +143,8 @@ class OploverzProvider : MainAPI() {
|
||||||
val trailer = document.selectFirst("a.trailerbutton")?.attr("href")
|
val trailer = document.selectFirst("a.trailerbutton")?.attr("href")
|
||||||
|
|
||||||
val episodes = document.select(".eplister > ul > li").map {
|
val episodes = document.select(".eplister > ul > li").map {
|
||||||
val name = it.select(".epl-title").text().trim()
|
val header = it.select(".epl-title").text()
|
||||||
|
val name = Regex("(Episode\\s?[0-9]+)").find(header)?.groupValues?.getOrNull(0) ?: header
|
||||||
val link = fixUrl(it.select("a").attr("href"))
|
val link = fixUrl(it.select("a").attr("href"))
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
|
|
|
@ -104,7 +104,7 @@ class OtakudesuProvider : MainAPI() {
|
||||||
val description = document.select("div.sinopc > p").text()
|
val description = document.select("div.sinopc > p").text()
|
||||||
|
|
||||||
val episodes = document.select("div.episodelist")[1].select("ul > li").mapNotNull {
|
val episodes = document.select("div.episodelist")[1].select("ul > li").mapNotNull {
|
||||||
val name = it.selectFirst("a")!!.text().trim()
|
val name = Regex("(Episode\\s?[0-9]+)").find(it.selectFirst("a")?.text().toString())?.groupValues?.getOrNull(0) ?: it.selectFirst("a")?.text()
|
||||||
val link = fixUrl(it.selectFirst("a")!!.attr("href"))
|
val link = fixUrl(it.selectFirst("a")!!.attr("href"))
|
||||||
Episode(link, name)
|
Episode(link, name)
|
||||||
}.reversed()
|
}.reversed()
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
package com.lagradost.cloudstream3.animeproviders
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.Qualities
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class TocanimeProvider : MainAPI() {
|
||||||
|
override var mainUrl = "https://tocanime.co"
|
||||||
|
override var name = "Tocanime"
|
||||||
|
override val hasMainPage = true
|
||||||
|
override var lang = "vi"
|
||||||
|
override val hasDownloadSupport = true
|
||||||
|
|
||||||
|
override val supportedTypes = setOf(
|
||||||
|
TvType.Anime,
|
||||||
|
TvType.AnimeMovie,
|
||||||
|
TvType.OVA
|
||||||
|
)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun getType(t: String): TvType {
|
||||||
|
return when {
|
||||||
|
t.contains("OVA") || t.contains("Special") -> TvType.OVA
|
||||||
|
t.contains("Movie") -> TvType.AnimeMovie
|
||||||
|
else -> TvType.Anime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getStatus(t: String): ShowStatus {
|
||||||
|
return when (t) {
|
||||||
|
"Đã hoàn thành" -> ShowStatus.Completed
|
||||||
|
"Chưa hoàn thành" -> ShowStatus.Ongoing
|
||||||
|
else -> ShowStatus.Completed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun getMainPage(): HomePageResponse {
|
||||||
|
val document = app.get(mainUrl).document
|
||||||
|
|
||||||
|
val homePageList = ArrayList<HomePageList>()
|
||||||
|
|
||||||
|
document.select("div#playlists > div").forEach { block ->
|
||||||
|
val header = block.selectFirst("h2")?.text()?.trim() ?: ""
|
||||||
|
val items = block.select("div.col-lg-3.col-md-4.col-6").map {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
if (items.isNotEmpty()) homePageList.add(HomePageList(header, items))
|
||||||
|
}
|
||||||
|
|
||||||
|
return HomePageResponse(homePageList)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Element.toSearchResult(): AnimeSearchResponse {
|
||||||
|
val title = this.selectFirst("h3 a")?.text()?.trim() ?: ""
|
||||||
|
val href = fixUrl(this.selectFirst("h3 a")!!.attr("href"))
|
||||||
|
val posterUrl = fixUrlNull(this.selectFirst("div.card-item-img")?.attr("data-original"))
|
||||||
|
val epNum = this.selectFirst("div.card-item-badget.rtl")?.text()?.let { eps ->
|
||||||
|
val num = eps.filter { it.isDigit() }.toIntOrNull()
|
||||||
|
if(eps.contains("Preview")) {
|
||||||
|
num?.minus(1)
|
||||||
|
} else {
|
||||||
|
num
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||||
|
this.posterUrl = posterUrl
|
||||||
|
addSub(epNum)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
|
val document = app.get("$mainUrl/content/search?t=kw&q=$query").document
|
||||||
|
|
||||||
|
return document.select("div.col-lg-3.col-md-4.col-6").map {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse? {
|
||||||
|
val document = app.get(url).document
|
||||||
|
|
||||||
|
val title = document.selectFirst("h1.title")?.text() ?: return null
|
||||||
|
val type =
|
||||||
|
if (document.select("div.me-list.scroller a").size == 1) TvType.AnimeMovie else TvType.Anime
|
||||||
|
val episodes = document.select("div.me-list.scroller a").mapNotNull {
|
||||||
|
Episode(fixUrl(it.attr("href")), it.text())
|
||||||
|
}.reversed()
|
||||||
|
val trailer =
|
||||||
|
document.selectFirst("div#trailer script")?.data()?.substringAfter("<iframe src=\"")
|
||||||
|
?.substringBefore("\"")
|
||||||
|
|
||||||
|
return newAnimeLoadResponse(title, url, type) {
|
||||||
|
posterUrl = fixUrlNull(document.selectFirst("img.img")?.attr("data-original"))
|
||||||
|
year = document.select("dl.movie-des dd")[1].text().split("/").last().toIntOrNull()
|
||||||
|
showStatus = getStatus(
|
||||||
|
document.select("dl.movie-des dd")[0].text()
|
||||||
|
.toString()
|
||||||
|
)
|
||||||
|
plot = document.select("div.box-content > p").text()
|
||||||
|
tags = document.select("dl.movie-des dd")[4].select("li")
|
||||||
|
.map { it.select("a").text().removeSuffix(",").trim() }
|
||||||
|
recommendations =
|
||||||
|
document.select("div.col-lg-3.col-md-4.col-6").map { it.toSearchResult() }
|
||||||
|
addEpisodes(DubStatus.Subbed, episodes)
|
||||||
|
addTrailer(trailer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun encode(input: String): String? = java.net.URLEncoder.encode(input, "utf-8")
|
||||||
|
|
||||||
|
override suspend fun loadLinks(
|
||||||
|
data: String,
|
||||||
|
isCasting: Boolean,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
): Boolean {
|
||||||
|
|
||||||
|
val document = app.get(
|
||||||
|
data,
|
||||||
|
headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"),
|
||||||
|
).document
|
||||||
|
|
||||||
|
document.select("script").apmap { script ->
|
||||||
|
if (script.data().contains("var PnPlayer=")) {
|
||||||
|
val key = script.data().substringAfter("\"btsurl\":[[").substringBefore("]}]")
|
||||||
|
.replace("]", "").replace("\"", "").split(",")
|
||||||
|
val id = data.split("_").last().substringBefore(".html")
|
||||||
|
|
||||||
|
app.get(
|
||||||
|
url = "$mainUrl/content/parseUrl?v=2&len=0&prefer=&ts=${Date().time}&item_id=$id&username=$id&sv=btsurl&${
|
||||||
|
encode(
|
||||||
|
"bts_url[]"
|
||||||
|
)
|
||||||
|
}=${
|
||||||
|
encode(
|
||||||
|
key.first()
|
||||||
|
)
|
||||||
|
}&sig=${key.last()}",
|
||||||
|
referer = data,
|
||||||
|
headers = mapOf(
|
||||||
|
"Accept" to "application/json, text/javascript, */*; q=0.01",
|
||||||
|
"X-Requested-With" to "XMLHttpRequest"
|
||||||
|
)
|
||||||
|
).parsedSafe<Responses>()?.let { res ->
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
source = this.name,
|
||||||
|
name = this.name,
|
||||||
|
url = res.formats?.auto ?: return@let,
|
||||||
|
referer = "$mainUrl/",
|
||||||
|
quality = Qualities.Unknown.value,
|
||||||
|
isM3u8 = true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
data class Formats(
|
||||||
|
@JsonProperty("auto") val auto: String?,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Responses(
|
||||||
|
@JsonProperty("formats") val formats: Formats?,
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.base64Decode
|
||||||
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
|
||||||
|
class Acefile : ExtractorApi() {
|
||||||
|
override val name = "Acefile"
|
||||||
|
override val mainUrl = "https://acefile.co"
|
||||||
|
override val requiresReferer = false
|
||||||
|
|
||||||
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
||||||
|
val sources = mutableListOf<ExtractorLink>()
|
||||||
|
app.get(url).document.select("script").map { script ->
|
||||||
|
if (script.data().contains("eval(function(p,a,c,k,e,d)")) {
|
||||||
|
val data = getAndUnpack(script.data())
|
||||||
|
val id = data.substringAfter("{\"id\":\"").substringBefore("\",")
|
||||||
|
val key = data.substringAfter("var nfck=\"").substringBefore("\";")
|
||||||
|
app.get("https://acefile.co/local/$id?key=$key").text.let {
|
||||||
|
base64Decode(
|
||||||
|
it.substringAfter("JSON.parse(atob(\"").substringBefore("\"))")
|
||||||
|
).let { res ->
|
||||||
|
sources.add(
|
||||||
|
ExtractorLink(
|
||||||
|
name,
|
||||||
|
name,
|
||||||
|
res.substringAfter("\"file\":\"").substringBefore("\","),
|
||||||
|
"$mainUrl/",
|
||||||
|
Qualities.Unknown.value,
|
||||||
|
headers = mapOf("range" to "bytes=0-")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sources
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
|
|
||||||
|
class SpeedoStream : ExtractorApi() {
|
||||||
|
override val name = "SpeedoStream"
|
||||||
|
override val mainUrl = "https://speedostream.com"
|
||||||
|
override val requiresReferer = true
|
||||||
|
|
||||||
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
||||||
|
val sources = mutableListOf<ExtractorLink>()
|
||||||
|
app.get(url, referer = referer).document.select("script").map { script ->
|
||||||
|
if (script.data().contains("jwplayer(\"vplayer\").setup(")) {
|
||||||
|
val data = script.data().substringAfter("sources: [")
|
||||||
|
.substringBefore("],").replace("file", "\"file\"").trim()
|
||||||
|
tryParseJson<File>(data)?.let {
|
||||||
|
M3u8Helper.generateM3u8(
|
||||||
|
name,
|
||||||
|
it.file,
|
||||||
|
"$mainUrl/",
|
||||||
|
).forEach { m3uData -> sources.add(m3uData) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sources
|
||||||
|
}
|
||||||
|
|
||||||
|
private data class File(
|
||||||
|
@JsonProperty("file") val file: String,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,135 @@
|
||||||
|
package com.lagradost.cloudstream3.movieproviders
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||||
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
|
import com.lagradost.cloudstream3.mvvm.safeApiCall
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
class YomoviesProvider : MainAPI() {
|
||||||
|
override var mainUrl = "https://yomovies.plus"
|
||||||
|
override var name = "Yomovies"
|
||||||
|
override val hasMainPage = true
|
||||||
|
override var lang = "hi"
|
||||||
|
override val hasDownloadSupport = true
|
||||||
|
override val supportedTypes = setOf(
|
||||||
|
TvType.Movie,
|
||||||
|
TvType.TvSeries,
|
||||||
|
)
|
||||||
|
|
||||||
|
override suspend fun getMainPage(): HomePageResponse {
|
||||||
|
val document = app.get(mainUrl).document
|
||||||
|
|
||||||
|
val homePageList = ArrayList<HomePageList>()
|
||||||
|
|
||||||
|
document.select("div.movies-list-wrap.mlw-topview,div.movies-list-wrap.mlw-latestmovie")
|
||||||
|
.forEach { block ->
|
||||||
|
val header = fixTitle(block.selectFirst("div.ml-title span")?.text() ?: "")
|
||||||
|
val items = block.select("div.ml-item").mapNotNull {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
if (items.isNotEmpty()) homePageList.add(HomePageList(header, items))
|
||||||
|
}
|
||||||
|
|
||||||
|
return HomePageResponse(homePageList)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Element.toSearchResult(): SearchResponse? {
|
||||||
|
val title = this.selectFirst("h2")?.text()?.trim() ?: return null
|
||||||
|
val href = fixUrl(this.selectFirst("a")?.attr("href").toString())
|
||||||
|
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("data-original"))
|
||||||
|
|
||||||
|
return newMovieSearchResponse(title, href, TvType.Movie) {
|
||||||
|
this.posterUrl = posterUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
|
val document = app.get("$mainUrl/?s=$query").document
|
||||||
|
|
||||||
|
return document.select("div.ml-item").mapNotNull {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse? {
|
||||||
|
val document = app.get(url).document
|
||||||
|
|
||||||
|
val title = document.selectFirst("div.mvic-desc h3")?.text()?.trim() ?: return null
|
||||||
|
val poster = fixUrlNull(document.selectFirst("div.thumb.mvic-thumb img")?.attr("src"))
|
||||||
|
val tags = document.select("div.mvici-left p:nth-child(1) a").map { it.text() }
|
||||||
|
val year = document.select("div.mvici-right p:nth-child(3) a").text().trim()
|
||||||
|
.toIntOrNull()
|
||||||
|
val tvType = if (document.selectFirst("div.les-content")
|
||||||
|
?.select("a")?.size!! <= 1
|
||||||
|
) TvType.Movie else TvType.TvSeries
|
||||||
|
val description = document.selectFirst("p.f-desc")?.text()?.trim()
|
||||||
|
val trailer = fixUrlNull(document.select("iframe#iframe-trailer").attr("src"))
|
||||||
|
val rating = document.select("div.mvici-right > div.imdb_r span").text().toRatingInt()
|
||||||
|
val actors = document.select("div.mvici-left p:nth-child(3) a").map { it.text() }
|
||||||
|
val recommendations = document.select("div.ml-item").mapNotNull {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
|
||||||
|
return if (tvType == TvType.TvSeries) {
|
||||||
|
val episodes = document.select("div.les-content a").map {
|
||||||
|
val href = it.attr("href")
|
||||||
|
val name = it.text().trim()
|
||||||
|
Episode(
|
||||||
|
data = href,
|
||||||
|
name = name,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||||
|
this.posterUrl = poster
|
||||||
|
this.year = year
|
||||||
|
this.plot = description
|
||||||
|
this.tags = tags
|
||||||
|
this.rating = rating
|
||||||
|
addActors(actors)
|
||||||
|
this.recommendations = recommendations
|
||||||
|
addTrailer(trailer)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newMovieLoadResponse(title, url, TvType.Movie, url) {
|
||||||
|
this.posterUrl = poster
|
||||||
|
this.year = year
|
||||||
|
this.plot = description
|
||||||
|
this.tags = tags
|
||||||
|
this.rating = rating
|
||||||
|
addActors(actors)
|
||||||
|
this.recommendations = recommendations
|
||||||
|
addTrailer(trailer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun loadLinks(
|
||||||
|
data: String,
|
||||||
|
isCasting: Boolean,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
): Boolean {
|
||||||
|
|
||||||
|
app.get(data).document.select("div.movieplay iframe").map { fixUrl(it.attr("src")) }
|
||||||
|
.apmap { source ->
|
||||||
|
safeApiCall {
|
||||||
|
when {
|
||||||
|
source.startsWith("https://membed.net") -> app.get(
|
||||||
|
source,
|
||||||
|
referer = "$mainUrl/"
|
||||||
|
).document.select("ul.list-server-items li")
|
||||||
|
.apmap { loadExtractor(it.attr("data-video").substringBefore("=https://msubload"), "$mainUrl/", callback) }
|
||||||
|
else -> loadExtractor(source, "$mainUrl/", callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -289,8 +289,9 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
|
||||||
DesuDrive(),
|
DesuDrive(),
|
||||||
|
|
||||||
Filesim(),
|
Filesim(),
|
||||||
|
|
||||||
Linkbox(),
|
Linkbox(),
|
||||||
|
Acefile(),
|
||||||
|
SpeedoStream(),
|
||||||
|
|
||||||
YoutubeExtractor(),
|
YoutubeExtractor(),
|
||||||
YoutubeShortLinkExtractor(),
|
YoutubeShortLinkExtractor(),
|
||||||
|
|
Loading…
Reference in a new issue