2022-10-17 04:24:09 +00:00
|
|
|
|
package com.hexated
|
|
|
|
|
|
2022-12-07 15:06:48 +00:00
|
|
|
|
import android.util.Log
|
2022-10-27 08:46:19 +00:00
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty
|
2022-10-17 08:03:20 +00:00
|
|
|
|
import com.lagradost.cloudstream3.*
|
|
|
|
|
import com.lagradost.cloudstream3.utils.*
|
2022-10-27 08:46:19 +00:00
|
|
|
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
2022-11-02 06:56:24 +00:00
|
|
|
|
import com.lagradost.nicehttp.Requests
|
|
|
|
|
import com.lagradost.nicehttp.Session
|
|
|
|
|
import com.google.gson.JsonParser
|
2022-12-09 08:44:01 +00:00
|
|
|
|
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
2022-11-27 06:41:05 +00:00
|
|
|
|
import com.lagradost.cloudstream3.network.CloudflareKiller
|
2022-12-09 20:54:40 +00:00
|
|
|
|
import com.lagradost.nicehttp.RequestBodyTypes
|
2022-11-09 00:26:07 +00:00
|
|
|
|
import kotlinx.coroutines.delay
|
2022-12-10 12:25:28 +00:00
|
|
|
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
2022-12-09 20:54:40 +00:00
|
|
|
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
2022-11-02 06:56:24 +00:00
|
|
|
|
import okhttp3.RequestBody.Companion.toRequestBody
|
2022-10-17 04:24:09 +00:00
|
|
|
|
|
2022-11-02 06:56:24 +00:00
|
|
|
|
val session = Session(Requests().baseClient)
|
|
|
|
|
|
2022-10-17 04:24:09 +00:00
|
|
|
|
object SoraExtractor : SoraStream() {
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
/*
|
2022-10-17 04:24:09 +00:00
|
|
|
|
suspend fun invokeLocalSources(
|
|
|
|
|
url: String,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val doc = app.get(
|
|
|
|
|
url,
|
|
|
|
|
headers = mapOf("User-Agent" to RandomUserAgent.getRandomUserAgent())
|
|
|
|
|
).document
|
|
|
|
|
val script = doc.select("script").find { it.data().contains("\"sources\":[") }?.data()
|
|
|
|
|
val sourcesData = script?.substringAfter("\"sources\":[")?.substringBefore("],")
|
|
|
|
|
val subData = script?.substringAfter("\"subtitles\":[")?.substringBefore("],")
|
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
tryParseJson<List<Sources>>("[$sourcesData]")?.map { source ->
|
2022-10-17 04:24:09 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
this.name,
|
|
|
|
|
this.name,
|
|
|
|
|
source.url ?: return@map null,
|
|
|
|
|
"$mainServerAPI/",
|
|
|
|
|
source.quality?.toIntOrNull() ?: Qualities.Unknown.value,
|
|
|
|
|
isM3u8 = source.isM3U8,
|
|
|
|
|
headers = mapOf("Origin" to mainServerAPI)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
tryParseJson<List<Subtitles>>("[$subData]")?.map { sub ->
|
2022-10-17 04:24:09 +00:00
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
sub.lang.toString(),
|
|
|
|
|
sub.url ?: return@map null
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
*/
|
2022-10-17 04:24:09 +00:00
|
|
|
|
|
|
|
|
|
suspend fun invokeTwoEmbed(
|
|
|
|
|
id: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$twoEmbedAPI/embed/tmdb/movie?id=$id"
|
|
|
|
|
} else {
|
|
|
|
|
"$twoEmbedAPI/embed/tmdb/tv?id=$id&s=$season&e=$episode"
|
|
|
|
|
}
|
|
|
|
|
val document = app.get(url).document
|
|
|
|
|
val captchaKey =
|
|
|
|
|
document.select("script[src*=https://www.google.com/recaptcha/api.js?render=]")
|
|
|
|
|
.attr("src").substringAfter("render=")
|
|
|
|
|
|
|
|
|
|
document.select(".dropdown-menu a[data-id]").map { it.attr("data-id") }.apmap { serverID ->
|
|
|
|
|
val token = APIHolder.getCaptchaToken(url, captchaKey)
|
|
|
|
|
app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$twoEmbedAPI/ajax/embed/play?id=$serverID&_token=$token", referer = url
|
2022-10-17 04:24:09 +00:00
|
|
|
|
).parsedSafe<EmbedJson>()?.let { source ->
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val link = source.link ?: return@let
|
|
|
|
|
if (link.contains("rabbitstream")) {
|
|
|
|
|
val rabbitId = link.substringAfterLast("/").substringBefore("?")
|
|
|
|
|
app.get(
|
|
|
|
|
"https://rabbitstream.net/ajax/embed-5/getSources?id=$rabbitId",
|
|
|
|
|
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
|
|
|
|
).parsedSafe<RabbitSources>()?.tracks?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
sub.label.toString(), sub.file ?: return@map null
|
2022-10-29 19:32:17 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
loadExtractor(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
link, twoEmbedAPI, subtitleCallback, callback
|
2022-10-29 19:32:17 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
2022-10-17 04:24:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-17 05:01:44 +00:00
|
|
|
|
suspend fun invokeVidSrc(
|
2022-10-17 04:24:09 +00:00
|
|
|
|
id: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
2022-10-17 04:28:32 +00:00
|
|
|
|
"$vidSrcAPI/embed/$id"
|
2022-10-17 04:24:09 +00:00
|
|
|
|
} else {
|
2022-10-17 04:28:32 +00:00
|
|
|
|
"$vidSrcAPI/embed/$id/${season}-${episode}"
|
2022-10-17 04:24:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-17 09:33:40 +00:00
|
|
|
|
loadExtractor(url, null, subtitleCallback) { link ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
link.name,
|
|
|
|
|
link.name,
|
|
|
|
|
link.url,
|
|
|
|
|
link.referer,
|
2022-11-12 12:08:52 +00:00
|
|
|
|
if (link.name == "VidSrc") Qualities.P1080.value else link.quality,
|
2022-10-17 09:33:40 +00:00
|
|
|
|
link.isM3u8,
|
|
|
|
|
link.headers,
|
|
|
|
|
link.extractorData
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
2022-10-17 04:24:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-17 08:03:20 +00:00
|
|
|
|
suspend fun invokeOlgply(
|
|
|
|
|
id: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-10-17 05:01:44 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val url = "$olgplyAPI/${id}${season?.let { "/$it" } ?: ""}${episode?.let { "/$it" } ?: ""}"
|
2022-10-17 08:03:20 +00:00
|
|
|
|
loadLinksWithWebView(url, callback)
|
2022-10-17 05:01:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-17 08:03:20 +00:00
|
|
|
|
suspend fun invokeDbgo(
|
|
|
|
|
id: String? = null,
|
2022-10-17 05:01:44 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-10-17 08:03:20 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
2022-10-17 05:01:44 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-10-17 09:03:17 +00:00
|
|
|
|
|
2022-11-07 10:16:02 +00:00
|
|
|
|
val iframeDbgo: String?
|
2022-10-17 09:03:17 +00:00
|
|
|
|
val script = if (season == null) {
|
|
|
|
|
val doc = app.get("$dbgoAPI/imdb.php?id=$id").document
|
|
|
|
|
iframeDbgo = doc.select("div.myvideo iframe").attr("src")
|
|
|
|
|
app.get(iframeDbgo, referer = "$dbgoAPI/").document.select("script")
|
|
|
|
|
.find { it.data().contains("CDNplayerConfig =") }?.data()
|
2022-10-17 08:03:20 +00:00
|
|
|
|
} else {
|
2022-10-17 09:03:17 +00:00
|
|
|
|
val doc = app.get("$dbgoAPI/tv-imdb.php?id=$id&s=$season").document
|
|
|
|
|
iframeDbgo = doc.select("div.myvideo iframe").attr("src")
|
|
|
|
|
val token = app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
iframeDbgo, referer = "$dbgoAPI/"
|
2022-10-17 09:03:17 +00:00
|
|
|
|
).document.selectFirst("select#translator-name option")?.attr("data-token")
|
|
|
|
|
app.get("https://voidboost.net/serial/$token/iframe?s=$season&e=$episode&h=dbgo.fun").document.select(
|
|
|
|
|
"script"
|
2022-12-21 21:49:12 +00:00
|
|
|
|
).find { it.data().contains("CDNplayerConfig =") }?.data()
|
2022-10-17 08:03:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val source =
|
|
|
|
|
Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script.toString())?.groupValues?.get(
|
|
|
|
|
1
|
2022-11-12 12:08:52 +00:00
|
|
|
|
) ?: return
|
2022-10-17 08:03:20 +00:00
|
|
|
|
val subtitle =
|
|
|
|
|
Regex("['|\"]subtitle['|\"]:\\s['|\"](\\S+?)['|\"]").find(script.toString())?.groupValues?.get(
|
|
|
|
|
1
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-07 10:16:02 +00:00
|
|
|
|
val ref = getBaseUrl(iframeDbgo)
|
2022-11-12 12:08:52 +00:00
|
|
|
|
decryptStreamUrl(source).split(",").map { links ->
|
2022-10-17 08:03:20 +00:00
|
|
|
|
val quality =
|
|
|
|
|
Regex("\\[([0-9]*p.*?)]").find(links)?.groupValues?.getOrNull(1).toString().trim()
|
2022-12-21 21:49:12 +00:00
|
|
|
|
links.replace("[$quality]", "").split(" or ").map { it.trim() }.map { link ->
|
|
|
|
|
val name = if (link.contains(".m3u8")) "Dbgo (Main)" else "Dbgo (Backup)"
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
name,
|
|
|
|
|
name,
|
|
|
|
|
link,
|
|
|
|
|
"$ref/",
|
|
|
|
|
getQuality(quality),
|
|
|
|
|
isM3u8 = link.contains(".m3u8"),
|
|
|
|
|
headers = mapOf(
|
|
|
|
|
"Origin" to ref
|
2022-10-17 08:03:20 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
2022-12-21 21:49:12 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
2022-10-17 08:03:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
subtitle?.split(",")?.map { sub ->
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val language = Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1).toString()
|
2022-10-17 08:03:20 +00:00
|
|
|
|
val link = sub.replace("[$language]", "").trim()
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
language, link
|
2022-10-17 08:03:20 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-18 00:20:30 +00:00
|
|
|
|
suspend fun invoke123Movie(
|
2022-10-18 01:13:02 +00:00
|
|
|
|
tmdbId: Int? = null,
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-10-18 00:20:30 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-10-18 16:16:43 +00:00
|
|
|
|
val url = if (season == null) {
|
2022-10-18 01:13:02 +00:00
|
|
|
|
"$movie123API/imdb.php?imdb=$imdbId&server=vcu"
|
|
|
|
|
} else {
|
|
|
|
|
"$movie123API/tmdb_api.php?se=$season&ep=$episode&tmdb=$tmdbId&server_name=vcu"
|
|
|
|
|
}
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val iframe = app.get(url).document.selectFirst("iframe")?.attr("src") ?: return
|
2022-10-18 00:20:30 +00:00
|
|
|
|
|
|
|
|
|
val doc = app.get(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
iframe,
|
2022-10-18 00:20:30 +00:00
|
|
|
|
referer = url,
|
|
|
|
|
headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8")
|
|
|
|
|
).document
|
|
|
|
|
|
|
|
|
|
doc.select("ul.list-server-items li.linkserver").mapNotNull { server ->
|
|
|
|
|
server.attr("data-video").let {
|
|
|
|
|
Regex("(.*?)((\\?cap)|(\\?sub)|(#cap)|(#sub))").find(it)?.groupValues?.get(1)
|
|
|
|
|
}
|
|
|
|
|
}.apmap { link ->
|
|
|
|
|
loadExtractor(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
link, "https://123moviesjr.cc/", subtitleCallback, callback
|
2022-10-18 00:20:30 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-18 16:16:43 +00:00
|
|
|
|
|
|
|
|
|
suspend fun invokeMovieHab(
|
2022-10-28 03:57:14 +00:00
|
|
|
|
imdbId: String? = null,
|
2022-10-18 16:16:43 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
2022-10-28 03:57:14 +00:00
|
|
|
|
"$movieHabAPI/embed/movie?imdb=$imdbId"
|
2022-10-18 16:16:43 +00:00
|
|
|
|
} else {
|
2022-10-28 03:57:14 +00:00
|
|
|
|
"$movieHabAPI/embed/series?imdb=$imdbId&sea=$season&epi=$episode"
|
2022-10-18 16:16:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get(url, referer = "$movieHabAPI/").document
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val movieId = doc.selectFirst("div#embed-player")?.attr("data-movie-id") ?: return
|
2022-10-18 16:16:43 +00:00
|
|
|
|
|
|
|
|
|
doc.select("div.dropdown-menu a").apmap {
|
|
|
|
|
val dataId = it.attr("data-id")
|
|
|
|
|
app.get(
|
|
|
|
|
"$movieHabAPI/ajax/get_stream_link?id=$dataId&movie=$movieId&is_init=true&captcha=&ref=",
|
|
|
|
|
referer = url,
|
|
|
|
|
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
|
|
|
|
).parsedSafe<MovieHabRes>()?.data?.let { res ->
|
|
|
|
|
loadExtractor(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
res.link ?: return@let null, movieHabAPI, subtitleCallback, callback
|
2022-10-18 16:16:43 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-19 21:46:22 +00:00
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
suspend fun invokeDatabaseGdrive(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$databaseGdriveAPI/player.php?imdb=$imdbId"
|
|
|
|
|
} else {
|
|
|
|
|
"$databaseGdriveAPI/player.php?type=series&imdb=$imdbId&season=$season&episode=$episode"
|
|
|
|
|
}
|
|
|
|
|
loadExtractor(url, databaseGdriveAPI, subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
/* suspend fun invokeSoraVIP(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
orgTitle: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val apiUrl = base64DecodeAPI("aQ==YXA=cC8=YXA=bC4=Y2U=ZXI=LnY=b2s=a2w=bG8=Ly8=czo=dHA=aHQ=")
|
|
|
|
|
val url = if(season == null) {
|
|
|
|
|
"$apiUrl/search/one?title=$title&orgTitle=$orgTitle&year=$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$apiUrl/search/one?title=$title&orgTitle=$orgTitle&year=$year&season=$season"
|
|
|
|
|
}
|
2022-10-21 04:15:49 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val id = app.get(url).parsedSafe<DetailVipResult>()?.data?.id
|
2022-10-21 04:15:49 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val sourcesUrl = if(season == null) {
|
|
|
|
|
"$apiUrl/movie/detail?id=$id"
|
|
|
|
|
} else {
|
|
|
|
|
"$apiUrl/tv/detail?id=$id&episodeId=${episode?.minus(1)}"
|
|
|
|
|
}
|
2022-10-21 04:15:49 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val json = app.get(sourcesUrl).parsedSafe<LoadVIPLinks>()
|
2022-10-21 04:15:49 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
json?.sources?.map { source ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"${this.name} (VIP)",
|
|
|
|
|
"${this.name} (VIP)",
|
|
|
|
|
source.url ?: return@map null,
|
|
|
|
|
"$apiUrl/",
|
|
|
|
|
source.quality ?: Qualities.Unknown.value,
|
|
|
|
|
isM3u8 = source.url.contains(".m3u8"),
|
|
|
|
|
)
|
2022-10-21 04:15:49 +00:00
|
|
|
|
)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
}
|
2022-10-19 21:46:22 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
json?.subtitles?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
getLanguage(sub.language.toString()),
|
|
|
|
|
sub.url ?: return@map null
|
|
|
|
|
)
|
2022-10-19 21:46:22 +00:00
|
|
|
|
)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
}
|
2022-10-19 21:46:22 +00:00
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
*/
|
2022-10-19 21:46:22 +00:00
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
suspend fun invokeHDMovieBox(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-10-28 03:57:14 +00:00
|
|
|
|
val fixTitle = title.fixTitle()
|
2022-12-03 09:27:19 +00:00
|
|
|
|
val request = app.get("$hdMovieBoxAPI/watch/$fixTitle")
|
|
|
|
|
if (!request.isSuccessful) return
|
|
|
|
|
val doc = request.document
|
2022-10-27 08:46:19 +00:00
|
|
|
|
val id = if (season == null) {
|
|
|
|
|
doc.selectFirst("div.player div#not-loaded")?.attr("data-whatwehave")
|
|
|
|
|
} else {
|
|
|
|
|
doc.select("div.season-list-column div[data-season=$season] div.list div.item")[episode?.minus(
|
|
|
|
|
1
|
|
|
|
|
) ?: 0].selectFirst("div.ui.checkbox")?.attr("data-episode")
|
2022-12-03 09:27:19 +00:00
|
|
|
|
} ?: return
|
2022-10-27 08:46:19 +00:00
|
|
|
|
|
|
|
|
|
val iframeUrl = app.post(
|
|
|
|
|
"$hdMovieBoxAPI/ajax/service", data = mapOf(
|
2022-12-03 09:27:19 +00:00
|
|
|
|
"e_id" to id,
|
2022-10-27 08:46:19 +00:00
|
|
|
|
"v_lang" to "en",
|
|
|
|
|
"type" to "get_whatwehave",
|
|
|
|
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
|
|
|
|
).parsedSafe<HdMovieBoxIframe>()?.apiIframe ?: return
|
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
delay(1000)
|
2022-10-27 08:46:19 +00:00
|
|
|
|
val iframe = app.get(iframeUrl, referer = "$hdMovieBoxAPI/").document.selectFirst("iframe")
|
|
|
|
|
?.attr("src")
|
|
|
|
|
|
|
|
|
|
val script = app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
iframe ?: return, referer = "$hdMovieBoxAPI/"
|
2022-10-27 08:46:19 +00:00
|
|
|
|
).document.selectFirst("script:containsData(var vhash =)")?.data()
|
|
|
|
|
?.substringAfter("vhash, {")?.substringBefore("}, false")
|
|
|
|
|
|
|
|
|
|
tryParseJson<HdMovieBoxSource>("{$script}").let { source ->
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val disk = if (source?.videoDisk == null) {
|
2022-10-27 09:58:50 +00:00
|
|
|
|
""
|
|
|
|
|
} else {
|
|
|
|
|
base64Encode(source.videoDisk.toString().toByteArray())
|
|
|
|
|
}
|
2022-10-27 08:46:19 +00:00
|
|
|
|
val link = getBaseUrl(iframe) + source?.videoUrl?.replace(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"\\", ""
|
2022-10-27 09:58:50 +00:00
|
|
|
|
) + "?s=${source?.videoServer}&d=$disk"
|
2022-10-27 08:46:19 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"HDMovieBox",
|
|
|
|
|
"HDMovieBox",
|
|
|
|
|
link,
|
|
|
|
|
iframe,
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
isM3u8 = true,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeSeries9(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-10-28 03:57:14 +00:00
|
|
|
|
val fixTitle = title.fixTitle()
|
2022-10-27 08:46:19 +00:00
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$series9API/film/$fixTitle/watching.html"
|
|
|
|
|
} else {
|
|
|
|
|
"$series9API/film/$fixTitle-season-$season/watching.html"
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val request = app.get(url)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!request.isSuccessful) return
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val res = request.document
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val sources: ArrayList<String?> = arrayListOf()
|
2022-10-27 08:46:19 +00:00
|
|
|
|
|
|
|
|
|
if (season == null) {
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val xstreamcdn =
|
|
|
|
|
res.selectFirst("div#list-eps div#server-29 a")?.attr("player-data")?.let {
|
|
|
|
|
Regex("(.*?)((\\?cap)|(\\?sub)|(#cap)|(#sub))").find(it)?.groupValues?.get(1)
|
|
|
|
|
}
|
2022-10-27 08:46:19 +00:00
|
|
|
|
val streamsb = res.selectFirst("div#list-eps div#server-13 a")?.attr("player-data")
|
|
|
|
|
val doodstream = res.selectFirst("div#list-eps div#server-14 a")?.attr("player-data")
|
|
|
|
|
sources.addAll(listOf(xstreamcdn, streamsb, doodstream))
|
|
|
|
|
} else {
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val xstreamcdn = res.selectFirst("div#list-eps div#server-29 a[episode-data=$episode]")
|
|
|
|
|
?.attr("player-data")?.let {
|
|
|
|
|
Regex("(.*?)((\\?cap)|(\\?sub)|(#cap)|(#sub))").find(it)?.groupValues?.get(1)
|
|
|
|
|
}
|
|
|
|
|
val streamsb = res.selectFirst("div#list-eps div#server-13 a[episode-data=$episode]")
|
|
|
|
|
?.attr("player-data")
|
|
|
|
|
val doodstream = res.selectFirst("div#list-eps div#server-14 a[episode-data=$episode]")
|
|
|
|
|
?.attr("player-data")
|
2022-10-27 08:46:19 +00:00
|
|
|
|
sources.addAll(listOf(xstreamcdn, streamsb, doodstream))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sources.apmap { link ->
|
|
|
|
|
loadExtractor(link ?: return@apmap null, url, subtitleCallback, callback)
|
|
|
|
|
}
|
2022-10-28 03:57:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeIdlix(
|
|
|
|
|
title: String? = null,
|
2022-10-30 05:29:18 +00:00
|
|
|
|
year: Int? = null,
|
2022-10-28 03:57:14 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val url = if (season == null) {
|
2022-10-30 05:29:18 +00:00
|
|
|
|
"$idlixAPI/movie/$fixTitle-$year"
|
2022-10-28 03:57:14 +00:00
|
|
|
|
} else {
|
|
|
|
|
"$idlixAPI/episode/$fixTitle-season-$season-episode-$episode"
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val res = app.get(url)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!res.isSuccessful) return
|
2022-12-05 22:13:58 +00:00
|
|
|
|
val referer = getBaseUrl(res.url)
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val document = res.document
|
2022-10-28 03:57:14 +00:00
|
|
|
|
val id = document.select("meta#dooplay-ajax-counter").attr("data-postid")
|
|
|
|
|
val type = if (url.contains("/movie/")) "movie" else "tv"
|
|
|
|
|
|
|
|
|
|
document.select("ul#playeroptionsul > li").map {
|
|
|
|
|
it.attr("data-nume")
|
|
|
|
|
}.apmap { nume ->
|
|
|
|
|
val source = app.post(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
url = "$referer/wp-admin/admin-ajax.php", data = mapOf(
|
|
|
|
|
"action" to "doo_player_ajax", "post" to id, "nume" to nume, "type" to type
|
|
|
|
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest"), referer = url
|
2022-10-28 03:57:14 +00:00
|
|
|
|
).parsed<ResponseHash>().embed_url
|
2022-10-27 08:46:19 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!source.contains("youtube")) {
|
2022-12-05 22:13:58 +00:00
|
|
|
|
loadExtractor(source, "$referer/", subtitleCallback, callback)
|
2022-11-08 11:06:03 +00:00
|
|
|
|
}
|
2022-10-28 03:57:14 +00:00
|
|
|
|
}
|
2022-10-27 08:46:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-01 04:37:30 +00:00
|
|
|
|
suspend fun invokeUniqueStream(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$uniqueStreamAPI/movies/$fixTitle-$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$uniqueStreamAPI/episodes/$fixTitle-season-$season-episode-$episode"
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val res = app.get(url)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!res.isSuccessful) return
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val document = res.document
|
2022-11-19 05:03:37 +00:00
|
|
|
|
val type = if (url.contains("/movies/")) "movie" else "tv"
|
2022-11-01 04:37:30 +00:00
|
|
|
|
document.select("ul#playeroptionsul > li").apmap { el ->
|
|
|
|
|
val id = el.attr("data-post")
|
|
|
|
|
val nume = el.attr("data-nume")
|
|
|
|
|
val source = app.post(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
url = "$uniqueStreamAPI/wp-admin/admin-ajax.php", data = mapOf(
|
|
|
|
|
"action" to "doo_player_ajax", "post" to id, "nume" to nume, "type" to type
|
|
|
|
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest"), referer = url
|
2022-11-01 04:37:30 +00:00
|
|
|
|
).parsed<ResponseHash>().embed_url.let { fixUrl(it) }
|
|
|
|
|
|
2022-11-19 05:48:25 +00:00
|
|
|
|
when {
|
|
|
|
|
source.contains("uniquestream") -> {
|
|
|
|
|
val resDoc = app.get(
|
|
|
|
|
source, referer = "$uniqueStreamAPI/", headers = mapOf(
|
|
|
|
|
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
|
|
|
|
|
)
|
|
|
|
|
).document
|
2022-11-28 10:29:41 +00:00
|
|
|
|
val srcm3u8 =
|
|
|
|
|
resDoc.selectFirst("script:containsData(let url =)")?.data()?.let {
|
|
|
|
|
Regex("['|\"](.*?.m3u8)['|\"]").find(it)?.groupValues?.getOrNull(1)
|
|
|
|
|
} ?: return@apmap null
|
2022-11-19 05:48:25 +00:00
|
|
|
|
val quality = app.get(
|
|
|
|
|
srcm3u8, referer = source, headers = mapOf(
|
2022-11-01 04:37:30 +00:00
|
|
|
|
"Accept" to "*/*",
|
|
|
|
|
)
|
2022-11-19 05:48:25 +00:00
|
|
|
|
).text.let { quality ->
|
|
|
|
|
if (quality.contains("RESOLUTION=1920")) Qualities.P1080.value else Qualities.P720.value
|
|
|
|
|
}
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"UniqueStream",
|
|
|
|
|
"UniqueStream",
|
|
|
|
|
srcm3u8,
|
|
|
|
|
source,
|
|
|
|
|
quality,
|
|
|
|
|
true,
|
|
|
|
|
headers = mapOf(
|
|
|
|
|
"Accept" to "*/*",
|
|
|
|
|
)
|
|
|
|
|
)
|
2022-11-01 04:37:30 +00:00
|
|
|
|
)
|
2022-11-19 05:48:25 +00:00
|
|
|
|
}
|
2022-11-28 10:29:41 +00:00
|
|
|
|
!source.contains("youtube") -> loadExtractor(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
source, "$uniqueStreamAPI/", subtitleCallback, callback
|
2022-11-28 10:29:41 +00:00
|
|
|
|
)
|
2022-11-19 05:48:25 +00:00
|
|
|
|
else -> {
|
|
|
|
|
// pass
|
|
|
|
|
}
|
2022-11-01 04:37:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-29 19:32:17 +00:00
|
|
|
|
suspend fun invokeNoverse(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$noverseAPI/movie/$fixTitle/download/"
|
|
|
|
|
} else {
|
|
|
|
|
"$noverseAPI/serie/$fixTitle/season-$season"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get(url).document
|
|
|
|
|
|
|
|
|
|
val links = if (season == null) {
|
|
|
|
|
doc.select("table.table-striped tbody tr").map {
|
|
|
|
|
it.select("a").attr("href") to it.selectFirst("td")?.text()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
doc.select("table.table-striped tbody tr")
|
2022-12-21 21:49:12 +00:00
|
|
|
|
.find { it.text().contains("Episode $episode") }?.select("td")?.map {
|
2022-10-29 19:32:17 +00:00
|
|
|
|
it.select("a").attr("href") to it.select("a").text()
|
|
|
|
|
}
|
2022-11-13 20:02:28 +00:00
|
|
|
|
} ?: return
|
2022-10-29 19:32:17 +00:00
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
delay(4000)
|
|
|
|
|
links.map { (link, quality) ->
|
2022-10-29 19:32:17 +00:00
|
|
|
|
val name =
|
|
|
|
|
quality?.replace(Regex("[0-9]{3,4}p"), "Noverse")?.replace(".", " ") ?: "Noverse"
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
name,
|
|
|
|
|
name,
|
|
|
|
|
link,
|
2022-11-10 04:28:02 +00:00
|
|
|
|
"",
|
2022-10-29 19:32:17 +00:00
|
|
|
|
getQualityFromName("${quality?.substringBefore("p")?.trim()}p"),
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-02 06:56:24 +00:00
|
|
|
|
suspend fun invokeFilmxy(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"${filmxyAPI}/movie/$imdbId"
|
|
|
|
|
} else {
|
|
|
|
|
"${filmxyAPI}/tv/$imdbId"
|
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val filmxyCookies =
|
|
|
|
|
getFilmxyCookies(imdbId, season) ?: throw ErrorLoadingException("No Cookies Found")
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
|
|
|
|
val cookiesDoc = mapOf(
|
|
|
|
|
"G_ENABLED_IDPS" to "google",
|
2022-11-10 05:06:59 +00:00
|
|
|
|
"wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to "${filmxyCookies.wLog}",
|
|
|
|
|
"PHPSESSID" to "${filmxyCookies.phpsessid}"
|
2022-11-02 06:56:24 +00:00
|
|
|
|
)
|
|
|
|
|
|
2022-11-10 04:28:02 +00:00
|
|
|
|
val request = session.get(url, cookies = cookiesDoc)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!request.isSuccessful) return
|
2022-11-10 04:28:02 +00:00
|
|
|
|
|
|
|
|
|
val doc = request.document
|
2022-11-02 06:56:24 +00:00
|
|
|
|
val script = doc.selectFirst("script:containsData(var isSingle)")?.data().toString()
|
|
|
|
|
val sourcesData = Regex("listSE\\s*=\\s?(.*?),[\\n|\\s]").find(script)?.groupValues?.get(1)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val sourcesDetail =
|
|
|
|
|
Regex("linkDetails\\s*=\\s?(.*?),[\\n|\\s]").find(script)?.groupValues?.get(1)
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
|
|
|
|
//Gson is shit, but i don't care
|
|
|
|
|
val sourcesJson = JsonParser().parse(sourcesData).asJsonObject
|
|
|
|
|
val sourcesDetailJson = JsonParser().parse(sourcesDetail).asJsonObject
|
|
|
|
|
|
|
|
|
|
val sources = if (season == null && episode == null) {
|
|
|
|
|
sourcesJson.getAsJsonObject("movie").getAsJsonArray("movie")
|
|
|
|
|
} else {
|
|
|
|
|
val eps = if (episode!! < 10) "0$episode" else episode
|
|
|
|
|
val sson = if (season!! < 10) "0$season" else season
|
|
|
|
|
sourcesJson.getAsJsonObject("s$sson").getAsJsonArray("e$eps")
|
|
|
|
|
}.asJsonArray
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val scriptUser =
|
|
|
|
|
doc.select("script").find { it.data().contains("var userNonce") }?.data().toString()
|
|
|
|
|
val userNonce =
|
|
|
|
|
Regex("var\\suserNonce.*?[\"|'](\\S+?)[\"|'];").find(scriptUser)?.groupValues?.get(1)
|
|
|
|
|
val userId =
|
|
|
|
|
Regex("var\\suser_id.*?[\"|'](\\S+?)[\"|'];").find(scriptUser)?.groupValues?.get(1)
|
2022-11-02 06:56:24 +00:00
|
|
|
|
val linkIDs = sources.joinToString("") {
|
|
|
|
|
"&linkIDs%5B%5D=$it"
|
|
|
|
|
}.replace("\"", "")
|
|
|
|
|
|
|
|
|
|
val body = "action=get_vid_links$linkIDs&user_id=$userId&nonce=$userNonce".toRequestBody()
|
|
|
|
|
val cookiesJson = mapOf(
|
|
|
|
|
"G_ENABLED_IDPS" to "google",
|
2022-11-10 05:06:59 +00:00
|
|
|
|
"PHPSESSID" to "${filmxyCookies.phpsessid}",
|
|
|
|
|
"wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to "${filmxyCookies.wLog}",
|
|
|
|
|
"wordpress_sec_8bf9d5433ac88cc9a3a396d6b154cd01" to "${filmxyCookies.wSec}"
|
2022-11-02 06:56:24 +00:00
|
|
|
|
)
|
|
|
|
|
val json = app.post(
|
|
|
|
|
"$filmxyAPI/wp-admin/admin-ajax.php",
|
|
|
|
|
requestBody = body,
|
|
|
|
|
referer = url,
|
|
|
|
|
headers = mapOf(
|
|
|
|
|
"Accept" to "*/*",
|
|
|
|
|
"DNT" to "1",
|
|
|
|
|
"Content-Type" to "application/x-www-form-urlencoded; charset=UTF-8",
|
|
|
|
|
"Origin" to filmxyAPI,
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest",
|
|
|
|
|
),
|
|
|
|
|
cookies = cookiesJson
|
2022-11-10 04:49:36 +00:00
|
|
|
|
).text.let { JsonParser().parse(it).asJsonObject }
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
|
|
|
|
sources.map { source ->
|
|
|
|
|
val src = source.asString
|
|
|
|
|
val link = json.getAsJsonPrimitive(src).asString
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val quality =
|
|
|
|
|
sourcesDetailJson.getAsJsonObject(src).getAsJsonPrimitive("resolution").asString
|
|
|
|
|
val server =
|
|
|
|
|
sourcesDetailJson.getAsJsonObject(src).getAsJsonPrimitive("server").asString
|
2022-11-02 06:56:24 +00:00
|
|
|
|
val size = sourcesDetailJson.getAsJsonObject(src).getAsJsonPrimitive("size").asString
|
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Filmxy $size ($server)",
|
|
|
|
|
"Filmxy $size ($server)",
|
|
|
|
|
link,
|
|
|
|
|
"$filmxyAPI/",
|
|
|
|
|
getQualityFromName(quality)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-07 10:16:02 +00:00
|
|
|
|
suspend fun invokeKimcartoon(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-11-12 12:08:52 +00:00
|
|
|
|
val fixTitle = title.fixTitle()
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val url = if (season == null) {
|
2022-11-07 10:16:02 +00:00
|
|
|
|
"$kimcartoonAPI/Cartoon/$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$kimcartoonAPI/Cartoon/$fixTitle-season-$season"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get(url).document
|
|
|
|
|
val iframe = if (season == null) {
|
|
|
|
|
doc.select("table.listing tr td a").firstNotNullOf { it.attr("href") }
|
|
|
|
|
} else {
|
|
|
|
|
doc.select("table.listing tr td a").map {
|
|
|
|
|
it.attr("href")
|
|
|
|
|
}.first { it.contains("Season-$season", true) && it.contains("Episode-$episode", true) }
|
|
|
|
|
} ?: return
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val source =
|
|
|
|
|
app.get(fixUrl(iframe, kimcartoonAPI)).document.select("div#divContentVideo iframe")
|
|
|
|
|
.attr("src")
|
2022-11-07 10:16:02 +00:00
|
|
|
|
loadExtractor(source, "$kimcartoonAPI/", subtitleCallback) { link ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Luxubu",
|
|
|
|
|
"Luxubu",
|
|
|
|
|
link.url,
|
|
|
|
|
link.referer,
|
|
|
|
|
link.quality,
|
|
|
|
|
link.isM3u8,
|
|
|
|
|
link.headers,
|
|
|
|
|
link.extractorData
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-08 09:08:34 +00:00
|
|
|
|
suspend fun invokeSoraVIP(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val headers = mapOf(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"lang" to "en", "versioncode" to "11", "clienttype" to "ios_jike_default"
|
2022-11-08 09:08:34 +00:00
|
|
|
|
)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val vipAPI =
|
|
|
|
|
base64DecodeAPI("cA==YXA=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
|
2022-11-08 09:08:34 +00:00
|
|
|
|
val vipUrl = base64DecodeAPI("b20=LmM=b2s=a2w=bG8=Ly8=czo=dHA=aHQ=")
|
|
|
|
|
|
|
|
|
|
val doc = app.get(
|
|
|
|
|
"$vipUrl/search?keyword=$title",
|
|
|
|
|
).document
|
|
|
|
|
|
|
|
|
|
val scriptData = doc.select("div.search-list div.search-video-card").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.selectFirst("h2.title")?.text().toString(),
|
2022-12-21 21:49:12 +00:00
|
|
|
|
it.selectFirst("div.desc")?.text()?.substringBefore(".")?.toIntOrNull(),
|
2022-11-08 09:08:34 +00:00
|
|
|
|
it.selectFirst("a")?.attr("href")?.split("/")
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val script = if (scriptData.size == 1) {
|
2022-12-10 12:25:28 +00:00
|
|
|
|
scriptData.firstOrNull()
|
2022-11-08 09:08:34 +00:00
|
|
|
|
} else {
|
2022-12-10 12:25:28 +00:00
|
|
|
|
scriptData.find {
|
|
|
|
|
when (season) {
|
|
|
|
|
null -> {
|
|
|
|
|
it.first.equals(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
title, true
|
2022-12-10 12:25:28 +00:00
|
|
|
|
) && it.second == year
|
|
|
|
|
}
|
|
|
|
|
1 -> {
|
|
|
|
|
it.first.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$title", true
|
2022-12-10 12:25:28 +00:00
|
|
|
|
) && (it.second == year || it.first.contains("Season $season", true))
|
|
|
|
|
}
|
|
|
|
|
else -> {
|
|
|
|
|
it.first.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$title", true
|
2022-12-10 12:25:28 +00:00
|
|
|
|
) && it.second == year && it.first.contains("Season $season", true)
|
|
|
|
|
}
|
2022-11-08 09:08:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-10 12:25:28 +00:00
|
|
|
|
val id = script?.third?.last() ?: return
|
|
|
|
|
val type = script.third?.get(2) ?: return
|
2022-11-08 09:08:34 +00:00
|
|
|
|
|
2022-11-09 02:34:31 +00:00
|
|
|
|
val jsonResponse = app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$vipAPI/movieDrama/get?id=${id}&category=${type}", headers = headers
|
2022-11-09 02:34:31 +00:00
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
if (!jsonResponse.isSuccessful) return
|
2022-11-09 02:34:31 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val json = jsonResponse.parsedSafe<Load>()?.data?.episodeVo?.first {
|
|
|
|
|
it.seriesNo == (episode ?: 0)
|
|
|
|
|
}
|
2022-11-08 09:08:34 +00:00
|
|
|
|
|
2022-12-06 08:50:52 +00:00
|
|
|
|
json?.subtitlingList?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
sub.language ?: "", sub.subtitlingUrl ?: return@map
|
2022-12-06 08:50:52 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-09 21:21:13 +00:00
|
|
|
|
json?.definitionList?.apmap { video ->
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val body =
|
|
|
|
|
"""[{"category":$type,"contentId":"$id","episodeId":${json.id},"definition":"${video.code}"}]""".toRequestBody(
|
|
|
|
|
RequestBodyTypes.JSON.toMediaTypeOrNull()
|
|
|
|
|
)
|
2022-12-09 20:54:40 +00:00
|
|
|
|
val response = app.post(
|
|
|
|
|
"${vipAPI}/media/bathGetplayInfo",
|
|
|
|
|
requestBody = body,
|
|
|
|
|
headers = headers,
|
|
|
|
|
).text.let { tryParseJson<PreviewResponse>(it)?.data?.firstOrNull() }
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
this.name,
|
|
|
|
|
this.name,
|
2022-12-09 21:21:13 +00:00
|
|
|
|
response?.mediaUrl ?: return@apmap null,
|
2022-12-09 20:54:40 +00:00
|
|
|
|
"",
|
|
|
|
|
getSoraQuality(response.currentDefinition ?: ""),
|
|
|
|
|
isM3u8 = true,
|
2022-11-08 09:08:34 +00:00
|
|
|
|
)
|
2022-12-09 20:54:40 +00:00
|
|
|
|
)
|
2022-11-08 09:08:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-12 12:08:52 +00:00
|
|
|
|
suspend fun invokeXmovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-12-12 17:28:45 +00:00
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$xMovieAPI/movies/$fixTitle/watch"
|
2022-11-12 12:08:52 +00:00
|
|
|
|
} else {
|
2022-12-12 17:28:45 +00:00
|
|
|
|
"$xMovieAPI/series/$fixTitle-season-$season-episode-$episode/watch"
|
2022-11-12 12:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-12 17:28:45 +00:00
|
|
|
|
val doc = app.get(url).text
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val link =
|
|
|
|
|
Regex("[\"|']file[\"|']:\\s?[\"|'](http.*?.mp4)[\"|'],").find(doc)?.groupValues?.getOrNull(
|
|
|
|
|
1
|
|
|
|
|
)
|
2022-11-12 12:08:52 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Xmovie",
|
|
|
|
|
"Xmovie",
|
|
|
|
|
link ?: return,
|
|
|
|
|
"",
|
|
|
|
|
Qualities.Unknown.value,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 20:02:28 +00:00
|
|
|
|
suspend fun invokeFlixhq(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title?.replace("–", "-")
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val id = app.get("$consumetFlixhqAPI/$title")
|
|
|
|
|
.parsedSafe<ConsumetSearchResponse>()?.results?.find {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
it.title?.equals(
|
|
|
|
|
"$fixTitle", true
|
|
|
|
|
) == true && it.releaseDate?.equals("$year") == true && it.type == "Movie"
|
|
|
|
|
} else {
|
|
|
|
|
it.title?.equals("$fixTitle", true) == true && it.type == "TV Series"
|
|
|
|
|
}
|
|
|
|
|
}?.id ?: return
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
|
|
|
|
val episodeId =
|
|
|
|
|
app.get("$consumetFlixhqAPI/info?id=$id").parsedSafe<ConsumetDetails>()?.let {
|
2022-11-13 20:02:28 +00:00
|
|
|
|
if (season == null) {
|
2022-11-18 11:00:36 +00:00
|
|
|
|
it.episodes?.first()?.id
|
2022-11-13 20:02:28 +00:00
|
|
|
|
} else {
|
2022-11-18 11:00:36 +00:00
|
|
|
|
it.episodes?.find { ep -> ep.number == episode && ep.season == season }?.id
|
2022-11-13 20:02:28 +00:00
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
} ?: return
|
2022-11-13 20:02:28 +00:00
|
|
|
|
|
|
|
|
|
listOf(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"vidcloud", "upcloud"
|
2022-11-13 20:02:28 +00:00
|
|
|
|
).apmap { server ->
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val sources = app.get(
|
|
|
|
|
"$consumetFlixhqAPI/watch?episodeId=$episodeId&mediaId=$id&server=$server",
|
|
|
|
|
timeout = 120L
|
|
|
|
|
).parsedSafe<ConsumetSourcesResponse>()
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val name = fixTitle(server)
|
|
|
|
|
sources?.sources?.map {
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
name,
|
|
|
|
|
name,
|
|
|
|
|
it.url ?: return@map null,
|
|
|
|
|
sources.headers?.referer ?: "",
|
|
|
|
|
it.quality?.toIntOrNull() ?: Qualities.Unknown.value,
|
|
|
|
|
it.isM3U8 ?: true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sources?.subtitles?.map {
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
it.lang ?: "", it.url ?: return@map null
|
2022-11-13 20:02:28 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-14 09:35:04 +00:00
|
|
|
|
suspend fun invokeKisskh(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title?.replace("–", "-")
|
|
|
|
|
val res = app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$kissKhAPI/api/DramaList/Search?q=$title&type=0", referer = "$kissKhAPI/"
|
2022-11-13 20:02:28 +00:00
|
|
|
|
).text.let {
|
|
|
|
|
tryParseJson<ArrayList<KisskhResults>>(it)
|
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val (id, contentTitle) = if (res.size == 1) {
|
|
|
|
|
res.first().id to res.first().title
|
|
|
|
|
} else {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
val data = res.find { it.title.equals(fixTitle, true) }
|
|
|
|
|
data?.id to data?.title
|
|
|
|
|
} else {
|
|
|
|
|
val data = res.find {
|
|
|
|
|
it.title?.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$fixTitle", true
|
2022-11-13 20:02:28 +00:00
|
|
|
|
) == true && it.title.contains("Season $season", true)
|
|
|
|
|
}
|
|
|
|
|
data?.id to data?.title
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val resDetail = app.get(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$kissKhAPI/api/DramaList/Drama/$id?isq=false", referer = "$kissKhAPI/Drama/${
|
2022-11-13 20:02:28 +00:00
|
|
|
|
getKisskhTitle(contentTitle)
|
|
|
|
|
}?id=$id"
|
|
|
|
|
).parsedSafe<KisskhDetail>() ?: return
|
|
|
|
|
|
|
|
|
|
val epsId = if (season == null) {
|
|
|
|
|
resDetail.episodes?.first()?.id
|
|
|
|
|
} else {
|
|
|
|
|
resDetail.episodes?.find { it.number == episode }?.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delay(2000)
|
|
|
|
|
app.get(
|
|
|
|
|
"$kissKhAPI/api/DramaList/Episode/$epsId.png?err=false&ts=&time=",
|
|
|
|
|
referer = "$kissKhAPI/Drama/${getKisskhTitle(contentTitle)}/Episode-${episode ?: 0}?id=$id&ep=$epsId&page=0&pageSize=100"
|
|
|
|
|
).parsedSafe<KisskhSources>()?.let { source ->
|
|
|
|
|
listOf(source.video, source.thirdParty).apmap { link ->
|
|
|
|
|
if (link?.contains(".m3u8") == true) {
|
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"Kisskh",
|
|
|
|
|
link,
|
|
|
|
|
referer = "$kissKhAPI/",
|
|
|
|
|
headers = mapOf("Origin" to kissKhAPI)
|
|
|
|
|
).forEach(callback)
|
|
|
|
|
} else {
|
|
|
|
|
loadExtractor(
|
|
|
|
|
link?.substringBefore("=http") ?: return@apmap null,
|
|
|
|
|
"$kissKhAPI/",
|
|
|
|
|
subtitleCallback,
|
2022-11-19 04:37:28 +00:00
|
|
|
|
callback
|
|
|
|
|
)
|
2022-11-13 20:02:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.get("$kissKhAPI/api/Sub/$epsId").text.let { resSub ->
|
|
|
|
|
tryParseJson<List<KisskhSubtitle>>(resSub)?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
getLanguage(sub.label ?: return@map), sub.src ?: return@map
|
2022-11-13 20:02:28 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-14 09:35:04 +00:00
|
|
|
|
suspend fun invokeZoro(
|
2022-11-18 11:00:36 +00:00
|
|
|
|
id: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val malId = app.get("$tmdb2mal/?id=$id&s=$season").text.trim()
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val anilistId = app.post(
|
|
|
|
|
"https://graphql.anilist.co/", data = mapOf(
|
|
|
|
|
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
|
|
|
|
)
|
|
|
|
|
).parsedSafe<DataAni>()?.data?.media?.id
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val episodeId = app.get("$consumetAnilistAPI/info/$anilistId?provider=zoro")
|
2022-11-18 11:00:36 +00:00
|
|
|
|
.parsedSafe<ConsumetDetails>()?.episodes?.find {
|
|
|
|
|
it.number == episode
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}?.id?.substringBeforeLast("$") ?: return
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
listOf(
|
|
|
|
|
"$episodeId\$sub" to "Subbed",
|
|
|
|
|
"$episodeId\$dub" to "English Dub",
|
|
|
|
|
).apmap { (id, type) ->
|
|
|
|
|
val sources = app.get("$consumetZoroAPI/watch?episodeId=$id")
|
|
|
|
|
.parsedSafe<ConsumetSourcesResponse>() ?: return@apmap null
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
sources.sources?.map sources@{
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Zoro [$type]",
|
|
|
|
|
"Zoro [$type]",
|
|
|
|
|
it.url ?: return@sources null,
|
|
|
|
|
"",
|
|
|
|
|
getQualityFromName(it.quality),
|
|
|
|
|
it.isM3U8 ?: true
|
|
|
|
|
)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
)
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
sources.subtitles?.map subtitles@{
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
it.lang ?: "",
|
|
|
|
|
it.url ?: return@subtitles null
|
|
|
|
|
)
|
2022-11-18 11:00:36 +00:00
|
|
|
|
)
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-19 04:37:28 +00:00
|
|
|
|
suspend fun invokeLing(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title?.replace("–", "-")
|
2022-11-28 10:29:41 +00:00
|
|
|
|
val url = if (season == null) {
|
2022-11-19 04:37:28 +00:00
|
|
|
|
"$lingAPI/en/videos/films/?title=$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$lingAPI/en/videos/serials/?title=$fixTitle"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val scriptData = app.get(url).document.select("div.blk.padding_b0 div.col-sm-30").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.selectFirst("div.video-body h5")?.text(),
|
|
|
|
|
it.selectFirst("div.video-body > p")?.text(),
|
|
|
|
|
it.selectFirst("div.video-body a")?.attr("href"),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val script = if (scriptData.size == 1) {
|
|
|
|
|
scriptData.first()
|
|
|
|
|
} else {
|
|
|
|
|
scriptData.find {
|
2022-11-28 10:29:41 +00:00
|
|
|
|
it.first?.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$fixTitle", true
|
2022-11-28 10:29:41 +00:00
|
|
|
|
) == true && it.second?.contains("$year") == true
|
2022-11-19 04:37:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get(fixUrl(script?.third ?: return, lingAPI)).document
|
2022-11-28 10:29:41 +00:00
|
|
|
|
val iframe = (if (season == null) {
|
2022-11-19 04:37:28 +00:00
|
|
|
|
doc.selectFirst("a.video-js.vjs-default-skin")?.attr("data-href")
|
|
|
|
|
} else {
|
2022-11-28 10:29:41 +00:00
|
|
|
|
doc.select("div.blk div#tab_$season li")[episode!!.minus(1)].select("h5 a")
|
|
|
|
|
.attr("data-href")
|
2022-11-19 04:37:28 +00:00
|
|
|
|
})?.let { fixUrl(it, lingAPI) }
|
|
|
|
|
|
|
|
|
|
val source = app.get(iframe ?: return)
|
|
|
|
|
val link = Regex("((https:|http:)//.*\\.mp4)").find(source.text)?.value ?: return
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"Ling", "Ling", link, "$lingAPI/", Qualities.Unknown.value, headers = mapOf(
|
2022-11-19 04:37:28 +00:00
|
|
|
|
"Range" to "bytes=0-"
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
source.document.select("div#player-tracks track").map {
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
SubtitleHelper.fromTwoLettersToLanguage(it.attr("srclang")) ?: return@map null,
|
|
|
|
|
it.attr("src")
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-21 10:27:07 +00:00
|
|
|
|
suspend fun invokeUhdmovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
lastSeason: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-12-29 03:34:20 +00:00
|
|
|
|
val url = if (season == null) {
|
2022-12-25 17:53:20 +00:00
|
|
|
|
"$uhdmoviesAPI/download-${title.fixTitle()}-$year"
|
2022-11-21 10:27:07 +00:00
|
|
|
|
} else {
|
2022-12-25 17:53:20 +00:00
|
|
|
|
val url = "$uhdmoviesAPI/?s=$title"
|
|
|
|
|
var doc = app.get(url).document
|
|
|
|
|
if (doc.select("title").text() == "Just a moment...") {
|
|
|
|
|
doc = app.get(url, interceptor = CloudflareKiller()).document
|
|
|
|
|
}
|
|
|
|
|
val scriptData = doc.select("div.row.gridlove-posts article").map {
|
|
|
|
|
it.selectFirst("a")?.attr("href") to it.selectFirst("h1")?.text()
|
|
|
|
|
}
|
|
|
|
|
(if (scriptData.size == 1) {
|
|
|
|
|
scriptData.first()
|
|
|
|
|
} else {
|
|
|
|
|
scriptData.find { it.second?.filterMedia(title, year, lastSeason) == true }
|
|
|
|
|
})?.first
|
2022-11-21 10:27:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-25 17:53:20 +00:00
|
|
|
|
val detailDoc = app.get(url ?: return).document
|
2022-11-21 10:27:07 +00:00
|
|
|
|
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val iframeList = detailDoc.select("div.entry-content p").map { it }
|
2022-12-21 21:49:12 +00:00
|
|
|
|
.filter { it.text().filterIframe(season, lastSeason, year) }.mapNotNull {
|
2022-12-15 12:30:01 +00:00
|
|
|
|
if (season == null) {
|
|
|
|
|
it.text() to it.nextElementSibling()?.select("a")?.attr("href")
|
|
|
|
|
} else {
|
|
|
|
|
it.text() to it.nextElementSibling()?.select("a:contains(Episode $episode)")
|
|
|
|
|
?.attr("href")
|
|
|
|
|
}
|
|
|
|
|
}.filter { it.second?.contains(Regex("(https:)|(http:)")) == true }
|
|
|
|
|
|
|
|
|
|
val iframe = if (iframeList.any { it.first.contains("2160p", true) }) iframeList.filter {
|
|
|
|
|
it.first.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"2160p", true
|
2022-12-15 12:30:01 +00:00
|
|
|
|
)
|
|
|
|
|
} else iframeList.filter { it.first.contains("1080p", true) }
|
2022-11-21 10:27:07 +00:00
|
|
|
|
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val base = "https://drivebit.in"
|
2022-12-03 09:27:19 +00:00
|
|
|
|
iframe.apmap { (quality, link) ->
|
2022-11-27 06:41:05 +00:00
|
|
|
|
delay(2000)
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val driveLink = bypassHrefli(link ?: return@apmap null)
|
|
|
|
|
val res = app.get(driveLink ?: return@apmap null).document
|
2022-11-26 21:25:36 +00:00
|
|
|
|
val resDoc = res.selectFirst("script")?.data()?.substringAfter("replace(\"")
|
|
|
|
|
?.substringBefore("\")")?.let {
|
|
|
|
|
app.get(fixUrl(it, base)).document
|
|
|
|
|
}
|
2022-12-07 19:17:24 +00:00
|
|
|
|
val bitLink = resDoc?.selectFirst("a.btn.btn-outline-success")?.attr("href")
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val downloadLink = if (bitLink.isNullOrEmpty()) {
|
2022-12-07 19:17:24 +00:00
|
|
|
|
val backupIframe = resDoc?.select("a.btn.btn-outline-warning")?.attr("href")
|
|
|
|
|
extractBackupUHD(backupIframe ?: return@apmap null)
|
|
|
|
|
} else {
|
|
|
|
|
extractMirrorUHD(bitLink, base)
|
2022-11-22 00:47:52 +00:00
|
|
|
|
}
|
2022-12-12 17:28:45 +00:00
|
|
|
|
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val videoQuality =
|
|
|
|
|
Regex("\\d{3,4}p\\.?(.*?)\\[").find(quality)?.groupValues?.getOrNull(1)?.trim()
|
|
|
|
|
?: ""
|
|
|
|
|
val qualities =
|
|
|
|
|
Regex("(\\d{3,4})p").find(quality)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-11-28 10:29:41 +00:00
|
|
|
|
?: Qualities.Unknown.value
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val size =
|
|
|
|
|
Regex("(?i)\\[(\\S+\\s?(gb|mb))[]/]").find(quality)?.groupValues?.getOrNull(1)
|
2022-12-12 17:28:45 +00:00
|
|
|
|
?.let { "[$it]" } ?: quality
|
2022-11-21 10:27:07 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2022-12-12 17:28:45 +00:00
|
|
|
|
"UHDMovies $videoQuality $size",
|
|
|
|
|
"UHDMovies $videoQuality $size",
|
2022-11-22 00:47:52 +00:00
|
|
|
|
downloadLink ?: return@apmap null,
|
2022-11-21 10:27:07 +00:00
|
|
|
|
"",
|
2022-12-12 17:28:45 +00:00
|
|
|
|
qualities
|
2022-11-21 10:27:07 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 13:50:37 +00:00
|
|
|
|
suspend fun invokeFwatayako(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val request = app.get("$fwatayakoAPI/IAF0wWTdNYZm?imdb_id=$imdbId")
|
|
|
|
|
if (!request.isSuccessful) return
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val files = request.document.selectFirst("input#files")?.attr("value").let {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
it?.replace("\"381\"", "\"movie\"")
|
|
|
|
|
} else {
|
|
|
|
|
it?.replace("\"381\"", "\"tv\"")
|
|
|
|
|
}
|
|
|
|
|
}.let { tryParseJson<SourcesFwatayako>(it) } ?: return
|
2022-11-22 13:50:37 +00:00
|
|
|
|
|
|
|
|
|
val sourcesLink = if (season == null) {
|
|
|
|
|
files.sourcesMovie
|
|
|
|
|
} else {
|
|
|
|
|
files.sourcesTv?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourcesLink?.split(",")?.map {
|
|
|
|
|
val source = it.substringBefore("or").trim()
|
|
|
|
|
val quality =
|
|
|
|
|
Regex("\\[([0-9]{3,4})p]").find(source)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
|
|
|
|
val link = httpsify(source.replace("[${quality}p]", "").trim())
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
link,
|
|
|
|
|
"$fwatayakoAPI/",
|
|
|
|
|
quality ?: Qualities.Unknown.value,
|
|
|
|
|
isM3u8 = true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-02 16:50:56 +00:00
|
|
|
|
suspend fun invokeGMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$gMoviesAPI/$fixTitle-$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$gMoviesAPI/$fixTitle-$year-season-$season"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get(url).document
|
|
|
|
|
|
|
|
|
|
val iframe = (if (season == null) {
|
|
|
|
|
doc.select("div.is-content-justification-center div.wp-block-button").map {
|
|
|
|
|
it.select("a").attr("href") to it.text()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
doc.select("div.is-content-justification-center").find {
|
|
|
|
|
it.previousElementSibling()?.text()?.contains("episode $episode", true) == true
|
|
|
|
|
}?.select("div.wp-block-button")?.map {
|
|
|
|
|
it.select("a").attr("href") to it.text()
|
|
|
|
|
}
|
2022-12-11 03:39:03 +00:00
|
|
|
|
})?.filter {
|
|
|
|
|
it.first.contains("gdtot") && (it.second.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"1080p", true
|
2022-12-11 03:39:03 +00:00
|
|
|
|
) || it.second.contains("4k", true))
|
|
|
|
|
} ?: return
|
2022-12-02 16:50:56 +00:00
|
|
|
|
|
|
|
|
|
iframe.apmap { (iframeLink, title) ->
|
2022-12-07 15:06:48 +00:00
|
|
|
|
val size = Regex("(?i)\\s(\\S+gb|mb)").find(title)?.groupValues?.getOrNull(1)
|
2022-12-02 16:50:56 +00:00
|
|
|
|
val gdBotLink = extractGdbot(iframeLink)
|
2022-12-20 15:24:47 +00:00
|
|
|
|
val videoLink = extractGdflix(gdBotLink ?: return@apmap null)
|
2022-12-07 15:06:48 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"GMovies [$size]",
|
|
|
|
|
"GMovies [$size]",
|
|
|
|
|
videoLink ?: return@apmap null,
|
|
|
|
|
"",
|
|
|
|
|
getGMoviesQuality(title)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeFDMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$fdMoviesAPI/movies/$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$fdMoviesAPI/episodes/$fixTitle-s${season}xe${episode}/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val request = app.get(url)
|
2022-12-12 13:24:46 +00:00
|
|
|
|
if (!request.isSuccessful) return
|
|
|
|
|
|
|
|
|
|
val iframe = request.document.select("div#download tbody tr").map {
|
|
|
|
|
FDMovieIFrame(
|
|
|
|
|
it.select("a").attr("href"),
|
|
|
|
|
it.select("strong.quality").text(),
|
|
|
|
|
it.select("td:nth-child(4)").text(),
|
|
|
|
|
it.select("img").attr("src")
|
|
|
|
|
)
|
|
|
|
|
}.filter {
|
|
|
|
|
(it.quality.contains("1080p", true) || it.quality.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"4k", true
|
2022-12-12 13:24:46 +00:00
|
|
|
|
)) && (it.type.contains("gdtot") || it.type.contains("oiya"))
|
|
|
|
|
}
|
|
|
|
|
Log.i("hexated", "$iframe")
|
|
|
|
|
iframe.apmap { (link, quality, size, type) ->
|
|
|
|
|
val qualities = getFDoviesQuality(quality)
|
2022-12-07 15:06:48 +00:00
|
|
|
|
val fdLink = bypassFdAds(link)
|
2022-12-12 13:24:46 +00:00
|
|
|
|
val videoLink = when {
|
|
|
|
|
type.contains("gdtot") -> {
|
|
|
|
|
val gdBotLink = extractGdbot(fdLink ?: return@apmap null)
|
2022-12-20 15:24:47 +00:00
|
|
|
|
extractGdflix(gdBotLink ?: return@apmap null)
|
2022-12-12 13:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
type.contains("oiya") -> {
|
|
|
|
|
extractOiya(fdLink ?: return@apmap null, qualities)
|
|
|
|
|
}
|
|
|
|
|
else -> {
|
|
|
|
|
return@apmap null
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-07 15:06:48 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"FDMovies [$size]",
|
|
|
|
|
"FDMovies [$size]",
|
|
|
|
|
videoLink ?: return@apmap null,
|
|
|
|
|
"",
|
2022-12-12 13:24:46 +00:00
|
|
|
|
getQualityFromName(qualities)
|
2022-12-07 15:06:48 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
2022-12-02 16:50:56 +00:00
|
|
|
|
}
|
2022-12-07 15:06:48 +00:00
|
|
|
|
|
2022-12-02 16:50:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-09 08:44:01 +00:00
|
|
|
|
suspend fun invokeM4uhd(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val res = app.get("$m4uhdAPI/search/${title.fixTitle()}.html").document
|
|
|
|
|
val scriptData = res.select("div.row div.item").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.selectFirst("img.imagecover")?.attr("title"),
|
|
|
|
|
it.selectFirst("div.jtip-top div:last-child")?.text(),
|
|
|
|
|
it.selectFirst("a")?.attr("href")
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val script = if (scriptData.size == 1) {
|
|
|
|
|
scriptData.firstOrNull()
|
|
|
|
|
} else {
|
|
|
|
|
scriptData.find {
|
|
|
|
|
it.first?.contains(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"Watch Free ${title?.replace(":", "")}", true
|
2022-12-09 08:44:01 +00:00
|
|
|
|
) == true && (it.first?.contains("$year") == true || it.second?.contains(
|
|
|
|
|
"$year"
|
|
|
|
|
) == true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val link = fixUrl(script?.third ?: return, m4uhdAPI)
|
|
|
|
|
val request = app.get(link)
|
|
|
|
|
var cookiesSet = request.headers.filter { it.first == "set-cookie" }
|
2022-12-15 12:30:01 +00:00
|
|
|
|
var xsrf =
|
|
|
|
|
cookiesSet.find { it.second.contains("XSRF-TOKEN") }?.second?.substringAfter("XSRF-TOKEN=")
|
|
|
|
|
?.substringBefore(";")
|
|
|
|
|
var session =
|
|
|
|
|
cookiesSet.find { it.second.contains("laravel_session") }?.second?.substringAfter("laravel_session=")
|
|
|
|
|
?.substringBefore(";")
|
2022-12-09 08:44:01 +00:00
|
|
|
|
|
|
|
|
|
val doc = request.document
|
|
|
|
|
val token = doc.selectFirst("meta[name=csrf-token]")?.attr("content")
|
|
|
|
|
val m4uData = if (season == null) {
|
|
|
|
|
doc.select("div.le-server span#fem").attr("data")
|
|
|
|
|
} else {
|
2022-12-15 12:30:01 +00:00
|
|
|
|
val episodeData =
|
|
|
|
|
doc.selectFirst("div.col-lg-9.col-xl-9 p:matches((?i)S0?$season-E0?$episode$)")
|
|
|
|
|
?: return
|
2022-12-09 08:44:01 +00:00
|
|
|
|
val idepisode = episodeData.select("button").attr("idepisode") ?: return
|
|
|
|
|
val requestEmbed = app.post(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"$m4uhdAPI/ajaxtv", data = mapOf(
|
|
|
|
|
"idepisode" to idepisode, "_token" to "$token"
|
|
|
|
|
), referer = link, headers = mapOf(
|
2022-12-09 08:44:01 +00:00
|
|
|
|
"X-Requested-With" to "XMLHttpRequest",
|
2022-12-21 21:49:12 +00:00
|
|
|
|
), cookies = mapOf(
|
2022-12-09 08:44:01 +00:00
|
|
|
|
"laravel_session" to "$session",
|
|
|
|
|
"XSRF-TOKEN" to "$xsrf",
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
cookiesSet = requestEmbed.headers.filter { it.first == "set-cookie" }
|
2022-12-15 12:30:01 +00:00
|
|
|
|
xsrf =
|
|
|
|
|
cookiesSet.find { it.second.contains("XSRF-TOKEN") }?.second?.substringAfter("XSRF-TOKEN=")
|
|
|
|
|
?.substringBefore(";")
|
|
|
|
|
session =
|
|
|
|
|
cookiesSet.find { it.second.contains("laravel_session") }?.second?.substringAfter("laravel_session=")
|
|
|
|
|
?.substringBefore(";")
|
2022-12-09 08:44:01 +00:00
|
|
|
|
requestEmbed.document.select("span#fem").attr("data")
|
|
|
|
|
}
|
2022-12-02 16:50:56 +00:00
|
|
|
|
|
2022-12-09 08:44:01 +00:00
|
|
|
|
val iframe = app.post(
|
|
|
|
|
"$m4uhdAPI/ajax",
|
|
|
|
|
data = mapOf(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"m4u" to m4uData, "_token" to "$token"
|
2022-12-09 08:44:01 +00:00
|
|
|
|
),
|
|
|
|
|
referer = link,
|
|
|
|
|
headers = mapOf(
|
|
|
|
|
"Accept" to "*/*",
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest",
|
|
|
|
|
),
|
|
|
|
|
cookies = mapOf(
|
|
|
|
|
"laravel_session" to "$session",
|
|
|
|
|
"XSRF-TOKEN" to "$xsrf",
|
|
|
|
|
),
|
|
|
|
|
).document.select("iframe").attr("src")
|
|
|
|
|
|
|
|
|
|
loadExtractor(iframe, m4uhdAPI, subtitleCallback, callback)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-10 12:25:28 +00:00
|
|
|
|
suspend fun invokeTvMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.fixTitle()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$tvMoviesAPI/show/$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$tvMoviesAPI/show/index-of-$fixTitle"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val server = getTvMoviesServer(url, season, episode) ?: return
|
2022-12-15 17:30:38 +00:00
|
|
|
|
val videoData = extractCovyn(server.second ?: return)
|
2022-12-21 21:49:12 +00:00
|
|
|
|
val quality =
|
|
|
|
|
Regex("([0-9]{3,4})p").find(server.first)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-12-10 12:25:28 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2022-12-15 17:30:38 +00:00
|
|
|
|
"TVMovies [${videoData?.second}]",
|
|
|
|
|
"TVMovies [${videoData?.second}]",
|
|
|
|
|
videoData?.first ?: return,
|
2022-12-10 12:25:28 +00:00
|
|
|
|
"",
|
|
|
|
|
quality ?: Qualities.Unknown.value
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-14 09:35:04 +00:00
|
|
|
|
suspend fun invokeCrunchyroll(
|
2022-12-14 05:05:18 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
epsTitle: String? = null,
|
2022-12-22 07:01:10 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-12-14 05:05:18 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val id = app.get("$consumetCrunchyrollAPI/$title")
|
|
|
|
|
.parsedSafe<ConsumetSearchResponse>()?.results?.find {
|
|
|
|
|
it.title.equals(
|
2022-12-22 07:01:10 +00:00
|
|
|
|
title,
|
|
|
|
|
true
|
2022-12-14 05:05:18 +00:00
|
|
|
|
) && it.type.equals("series")
|
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val detail = app.get("$consumetCrunchyrollAPI/info?id=${id.id}&mediaType=series").text
|
|
|
|
|
val episodeId = tryParseJson<ConsumetDetails>(detail)?.episodes?.filter {
|
2022-12-23 12:02:01 +00:00
|
|
|
|
(it.number == episode || it.title.equals(epsTitle, true))
|
|
|
|
|
}?.let { eps ->
|
|
|
|
|
listOf(eps.filter { it.type == "Subbed" }.map { it.id }
|
|
|
|
|
.getOrNull(season?.minus(1) ?: 0) to "Subbed",
|
|
|
|
|
eps.filter { it.type == "English Dub" }.map { it.id }
|
|
|
|
|
.getOrNull(season?.minus(1) ?: 0) to "English Dub")
|
|
|
|
|
}
|
2022-12-14 05:05:18 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
episodeId?.apmap { (id, type) ->
|
2022-12-29 03:34:20 +00:00
|
|
|
|
val json =
|
|
|
|
|
app.get("$consumetCrunchyrollAPI/watch?episodeId=${id ?: return@apmap null}&format=srt")
|
|
|
|
|
.parsedSafe<ConsumetSourcesResponse>()
|
2022-12-14 05:05:18 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
json?.sources?.map source@{ source ->
|
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"Crunchyroll [$type]",
|
|
|
|
|
source.url ?: return@source null,
|
|
|
|
|
"",
|
|
|
|
|
).forEach(callback)
|
|
|
|
|
}
|
2022-12-14 05:05:18 +00:00
|
|
|
|
|
2022-12-23 12:02:01 +00:00
|
|
|
|
json?.subtitles?.map subtitle@{ sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
sub.lang?.replace(Regex("\\[\\S+]"), "")?.trim() ?: "",
|
|
|
|
|
sub.url ?: return@subtitle null
|
|
|
|
|
)
|
2022-12-14 05:05:18 +00:00
|
|
|
|
)
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}
|
2022-12-14 05:05:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-29 02:48:08 +00:00
|
|
|
|
suspend fun invokeMoviesbay(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url =
|
|
|
|
|
"https://sheets.googleapis.com/v4/spreadsheets/12RD3HX3NkSiCyqQJxemyS8W0R9B7J4VBl35uLBa5W0E/values/main?alt=json&key=AIzaSyA_ZY8GYxyUZYlcKGkDIHuku_gmE4z-AHQ"
|
|
|
|
|
val json = app.get(url, referer = "$moviesbayAPI/")
|
|
|
|
|
.parsedSafe<MoviesbayValues>()?.values
|
|
|
|
|
|
|
|
|
|
val media = json?.find { it.first() == "${title.fixTitle()}-$year" }
|
|
|
|
|
|
|
|
|
|
media?.filter { it.startsWith("https://drive.google.com") }?.apmap {
|
|
|
|
|
val index = media.indexOf(it)
|
|
|
|
|
val size = media[index.minus(1)]
|
|
|
|
|
val quality = media[index.minus(2)]
|
|
|
|
|
val qualityName = media[index.minus(3)]
|
|
|
|
|
|
|
|
|
|
val doc = app.get(it).document
|
|
|
|
|
val form = doc.select("form#download-form").attr("action")
|
|
|
|
|
val uc = doc.select("input#uc-download-link").attr("value")
|
|
|
|
|
val link = app.post(
|
|
|
|
|
form, data = mapOf(
|
|
|
|
|
"uc-download-link" to uc
|
|
|
|
|
)
|
|
|
|
|
).url
|
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Moviesbay $qualityName [$size]",
|
|
|
|
|
"Moviesbay $qualityName [$size]",
|
|
|
|
|
link,
|
|
|
|
|
"",
|
|
|
|
|
getQualityFromName(quality)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeMoviezAdd(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2022-12-29 11:48:41 +00:00
|
|
|
|
val fixTitle = title?.fixTitle()?.replace("-", " ")
|
2022-12-29 03:34:20 +00:00
|
|
|
|
val doc = app.get("$moviezAddAPI/?s=$fixTitle").document
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
|
|
|
|
val matchMedia = doc.select("article.mh-loop-item").map {
|
|
|
|
|
it.select("a").attr("href") to it.select("a").text()
|
2022-12-29 03:34:20 +00:00
|
|
|
|
}.find {
|
2022-12-29 11:48:41 +00:00
|
|
|
|
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
|
2022-12-29 03:34:20 +00:00
|
|
|
|
}
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
|
|
|
|
val detailLink =
|
|
|
|
|
app.get(matchMedia?.first ?: return).document.selectFirst("a#jake1")?.attr("href")
|
|
|
|
|
|
|
|
|
|
val iframeDoc = app.get(detailLink ?: return).document
|
|
|
|
|
|
|
|
|
|
val media = iframeDoc.selectFirst("div.entry-content pre span")?.text()?.split("|")
|
|
|
|
|
?.map { it.trim() }
|
|
|
|
|
|
|
|
|
|
media?.apmapIndexed { index, name ->
|
|
|
|
|
delay(1000)
|
|
|
|
|
val link = iframeDoc.select("div.entry-content pre")[index.plus(1)].selectFirst("a")
|
|
|
|
|
?.attr("href") ?: return@apmapIndexed null
|
|
|
|
|
val token =
|
|
|
|
|
app.get(link).document.select("input[name=_csrf_token_645a83a41868941e4692aa31e7235f2]")
|
|
|
|
|
.attr("value")
|
|
|
|
|
val shortLink = app.post(
|
|
|
|
|
link,
|
|
|
|
|
data = mapOf("_csrf_token_645a83a41868941e4692aa31e7235f2" to token)
|
|
|
|
|
).document.selectFirst("a[rel=nofollow]")?.attr("href")
|
|
|
|
|
|
|
|
|
|
// val videoUrl = extractRebrandly(shortLink ?: return@apmapIndexed null )
|
2022-12-29 03:34:20 +00:00
|
|
|
|
val quality =
|
|
|
|
|
Regex("([0-9]{3,4})p").find(name)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-12-29 02:48:08 +00:00
|
|
|
|
val qualityName = name.replace("${quality}p", "").trim()
|
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"MoviezAdd $qualityName",
|
|
|
|
|
"MoviezAdd $qualityName",
|
|
|
|
|
shortLink ?: return@apmapIndexed null,
|
|
|
|
|
"",
|
|
|
|
|
quality ?: Qualities.Unknown.value
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-09 08:44:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-15 12:30:01 +00:00
|
|
|
|
class StreamM4u : XStreamCdn() {
|
2022-12-09 08:44:01 +00:00
|
|
|
|
override val name: String = "StreamM4u"
|
|
|
|
|
override val mainUrl: String = "https://streamm4u.club"
|
2022-10-17 08:03:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-12 13:24:46 +00:00
|
|
|
|
data class FDMovieIFrame(
|
|
|
|
|
val link: String,
|
|
|
|
|
val quality: String,
|
|
|
|
|
val size: String,
|
|
|
|
|
val type: String,
|
|
|
|
|
)
|
|
|
|
|
|
2022-12-07 19:17:24 +00:00
|
|
|
|
data class UHDBackupUrl(
|
2022-12-02 16:50:56 +00:00
|
|
|
|
@JsonProperty("url") val url: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-12-29 02:48:08 +00:00
|
|
|
|
data class MoviesbayValues(
|
|
|
|
|
@JsonProperty("values") val values: List<List<String>>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
data class HdMovieBoxSource(
|
|
|
|
|
@JsonProperty("videoUrl") val videoUrl: String? = null,
|
|
|
|
|
@JsonProperty("videoServer") val videoServer: String? = null,
|
2022-10-27 09:58:50 +00:00
|
|
|
|
@JsonProperty("videoDisk") val videoDisk: Any? = null,
|
2022-10-27 08:46:19 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class HdMovieBoxIframe(
|
|
|
|
|
@JsonProperty("api_iframe") val apiIframe: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-10-28 03:57:14 +00:00
|
|
|
|
data class ResponseHash(
|
|
|
|
|
@JsonProperty("embed_url") val embed_url: String,
|
|
|
|
|
@JsonProperty("type") val type: String?,
|
|
|
|
|
)
|
|
|
|
|
|
2022-10-29 19:32:17 +00:00
|
|
|
|
data class Track(
|
|
|
|
|
@JsonProperty("file") val file: String? = null,
|
|
|
|
|
@JsonProperty("label") val label: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class RabbitSources(
|
|
|
|
|
@JsonProperty("sources") val sources: String? = null,
|
|
|
|
|
@JsonProperty("tracks") val tracks: ArrayList<Track>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-08 09:08:34 +00:00
|
|
|
|
data class SubtitlingList(
|
|
|
|
|
@JsonProperty("languageAbbr") val languageAbbr: String? = null,
|
|
|
|
|
@JsonProperty("language") val language: String? = null,
|
|
|
|
|
@JsonProperty("subtitlingUrl") val subtitlingUrl: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class DefinitionList(
|
|
|
|
|
@JsonProperty("code") val code: String? = null,
|
|
|
|
|
@JsonProperty("description") val description: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class EpisodeVo(
|
|
|
|
|
@JsonProperty("id") val id: Int? = null,
|
|
|
|
|
@JsonProperty("seriesNo") val seriesNo: Int? = null,
|
|
|
|
|
@JsonProperty("definitionList") val definitionList: ArrayList<DefinitionList>? = arrayListOf(),
|
|
|
|
|
@JsonProperty("subtitlingList") val subtitlingList: ArrayList<SubtitlingList>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class MediaDetail(
|
|
|
|
|
@JsonProperty("episodeVo") val episodeVo: ArrayList<EpisodeVo>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class Load(
|
|
|
|
|
@JsonProperty("data") val data: MediaDetail? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetHeaders(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("Referer") val referer: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetSubtitles(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("url") val url: String? = null,
|
|
|
|
|
@JsonProperty("lang") val lang: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetSources(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("url") val url: String? = null,
|
|
|
|
|
@JsonProperty("quality") val quality: String? = null,
|
|
|
|
|
@JsonProperty("isM3U8") val isM3U8: Boolean? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetSourcesResponse(
|
|
|
|
|
@JsonProperty("headers") val headers: ConsumetHeaders? = null,
|
|
|
|
|
@JsonProperty("sources") val sources: ArrayList<ConsumetSources>? = arrayListOf(),
|
|
|
|
|
@JsonProperty("subtitles") val subtitles: ArrayList<ConsumetSubtitles>? = arrayListOf(),
|
2022-11-13 20:02:28 +00:00
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetEpisodes(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("id") val id: String? = null,
|
2022-12-14 05:05:18 +00:00
|
|
|
|
@JsonProperty("type") val type: String? = null,
|
|
|
|
|
@JsonProperty("title") val title: String? = null,
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("number") val number: Int? = null,
|
|
|
|
|
@JsonProperty("season") val season: Int? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetDetails(
|
|
|
|
|
@JsonProperty("episodes") val episodes: ArrayList<ConsumetEpisodes>? = arrayListOf(),
|
2022-11-13 20:02:28 +00:00
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetResults(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
@JsonProperty("id") val id: String? = null,
|
|
|
|
|
@JsonProperty("title") val title: String? = null,
|
|
|
|
|
@JsonProperty("releaseDate") val releaseDate: String? = null,
|
|
|
|
|
@JsonProperty("type") val type: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class ConsumetSearchResponse(
|
|
|
|
|
@JsonProperty("results") val results: ArrayList<ConsumetResults>? = arrayListOf(),
|
2022-11-13 20:02:28 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class KisskhSources(
|
|
|
|
|
@JsonProperty("Video") val video: String?,
|
|
|
|
|
@JsonProperty("ThirdParty") val thirdParty: String?,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class KisskhSubtitle(
|
|
|
|
|
@JsonProperty("src") val src: String?,
|
|
|
|
|
@JsonProperty("label") val label: String?,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class KisskhEpisodes(
|
|
|
|
|
@JsonProperty("id") val id: Int?,
|
|
|
|
|
@JsonProperty("number") val number: Int?,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class KisskhDetail(
|
|
|
|
|
@JsonProperty("episodes") val episodes: ArrayList<KisskhEpisodes>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class KisskhResults(
|
|
|
|
|
@JsonProperty("id") val id: Int?,
|
|
|
|
|
@JsonProperty("title") val title: String?,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
data class AnimixData(
|
|
|
|
|
@JsonProperty("title") val title: String? = null,
|
|
|
|
|
@JsonProperty("title_english") val title_english: String? = null,
|
|
|
|
|
@JsonProperty("title_japanese") val title_japanese: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-22 13:50:37 +00:00
|
|
|
|
data class EpisodesFwatayako(
|
|
|
|
|
@JsonProperty("id") val id: String? = null,
|
|
|
|
|
@JsonProperty("file") val file: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class SeasonFwatayako(
|
|
|
|
|
@JsonProperty("id") val id: Int? = null,
|
|
|
|
|
@JsonProperty("folder") val folder: ArrayList<EpisodesFwatayako>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class SourcesFwatayako(
|
|
|
|
|
@JsonProperty("movie") val sourcesMovie: String? = null,
|
|
|
|
|
@JsonProperty("tv") val sourcesTv: ArrayList<SeasonFwatayako>? = arrayListOf(),
|
2022-12-07 15:06:48 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class DriveBotLink(
|
|
|
|
|
@JsonProperty("url") val url: String? = null,
|
2022-12-09 08:44:01 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class DirectDl(
|
|
|
|
|
@JsonProperty("download_url") val download_url: String? = null,
|
2022-12-09 20:54:40 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class PreviewResponse(
|
|
|
|
|
@JsonProperty("data") val data: ArrayList<PreviewVideos>? = arrayListOf(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class PreviewVideos(
|
|
|
|
|
@JsonProperty("mediaUrl") val mediaUrl: String? = null,
|
|
|
|
|
@JsonProperty("currentDefinition") val currentDefinition: String? = null,
|
2022-12-21 21:49:12 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class IdAni(
|
|
|
|
|
@JsonProperty("id") val id: String? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class MediaAni(
|
|
|
|
|
@JsonProperty("Media") val media: IdAni? = null,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
data class DataAni(
|
|
|
|
|
@JsonProperty("data") val data: MediaAni? = null,
|
2022-11-22 13:50:37 +00:00
|
|
|
|
)
|