2022-10-17 04:24:09 +00:00
|
|
|
|
package com.hexated
|
|
|
|
|
|
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
|
2023-03-05 15:58:53 +00:00
|
|
|
|
import com.hexated.RabbitStream.extractRabbitStream
|
2023-07-26 07:31:20 +00:00
|
|
|
|
import com.lagradost.cloudstream3.extractors.Filesim
|
|
|
|
|
import com.lagradost.cloudstream3.extractors.StreamSB
|
2023-07-31 04:30:48 +00:00
|
|
|
|
import com.lagradost.cloudstream3.extractors.Voe
|
2023-05-14 18:49:25 +00:00
|
|
|
|
import com.lagradost.cloudstream3.extractors.helper.GogoHelper
|
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-09 20:54:40 +00:00
|
|
|
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
2022-11-02 06:56:24 +00:00
|
|
|
|
import okhttp3.RequestBody.Companion.toRequestBody
|
2023-01-29 03:29:15 +00:00
|
|
|
|
import okio.ByteString.Companion.encode
|
2023-01-11 01:28:46 +00:00
|
|
|
|
import org.jsoup.Jsoup
|
2023-06-15 23:38:22 +00:00
|
|
|
|
import org.jsoup.nodes.Document
|
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() {
|
|
|
|
|
|
2023-06-15 23:38:22 +00:00
|
|
|
|
suspend fun invokeGoku(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
2022-10-17 04:24:09 +00:00
|
|
|
|
season: Int? = null,
|
2023-06-15 23:38:22 +00:00
|
|
|
|
lastSeason: Int? = null,
|
2022-10-17 04:24:09 +00:00
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-06-15 23:38:22 +00:00
|
|
|
|
val headers = mapOf(
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
fun Document.getServers(): List<String> {
|
|
|
|
|
return this.select("a").map { it.attr("data-id") }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val media = app.get(
|
|
|
|
|
"$gokuAPI/ajax/movie/search?keyword=$title", headers = headers
|
|
|
|
|
).document.select("div.item").find { ele ->
|
2023-07-31 04:30:48 +00:00
|
|
|
|
val url = ele.selectFirst("a.movie-link")?.attr("href")
|
2023-06-15 23:38:22 +00:00
|
|
|
|
val titleMedia = ele.select("h3.movie-name").text()
|
2023-07-31 04:30:48 +00:00
|
|
|
|
val titleSlug = title.createSlug()
|
|
|
|
|
val yearMedia = ele.select("div.info-split > div:first-child").text().toIntOrNull()
|
|
|
|
|
val lastSeasonMedia = ele.select("div.info-split > div:nth-child(2)").text().substringAfter("SS")
|
|
|
|
|
.substringBefore("/").trim().toIntOrNull()
|
|
|
|
|
(titleMedia.equals(title, true) || titleMedia.createSlug()
|
|
|
|
|
.equals(titleSlug) || url?.contains("$titleSlug-") == true) &&
|
2023-06-22 07:23:28 +00:00
|
|
|
|
(if (season == null) {
|
2023-07-31 04:30:48 +00:00
|
|
|
|
yearMedia == year && url?.contains("/movie/") == true
|
2023-06-15 23:38:22 +00:00
|
|
|
|
} else {
|
2023-07-31 04:30:48 +00:00
|
|
|
|
lastSeasonMedia == lastSeason && url?.contains("/series/") == true
|
2023-06-22 07:23:28 +00:00
|
|
|
|
})
|
2023-06-15 23:38:22 +00:00
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val serversId = if (season == null) {
|
|
|
|
|
val movieId = app.get(
|
|
|
|
|
fixUrl(
|
|
|
|
|
media.selectFirst("a")?.attr("href") ?: return,
|
|
|
|
|
gokuAPI
|
|
|
|
|
)
|
|
|
|
|
).url.substringAfterLast("/")
|
|
|
|
|
app.get(
|
|
|
|
|
"$gokuAPI/ajax/movie/episode/servers/$movieId",
|
|
|
|
|
headers = headers
|
|
|
|
|
).document.getServers()
|
2022-10-17 04:24:09 +00:00
|
|
|
|
} else {
|
2023-06-15 23:38:22 +00:00
|
|
|
|
val seasonId = app.get(
|
|
|
|
|
"$gokuAPI/ajax/movie/seasons/${
|
|
|
|
|
media.selectFirst("a.btn-wl")?.attr("data-id") ?: return
|
|
|
|
|
}", headers = headers
|
|
|
|
|
).document.select("a.ss-item").find { it.ownText().equals("Season $season", true) }?.attr("data-id")
|
|
|
|
|
val episodeId =
|
|
|
|
|
app.get(
|
|
|
|
|
"$gokuAPI/ajax/movie/season/episodes/${seasonId ?: return}",
|
|
|
|
|
headers = headers
|
|
|
|
|
).document.select("div.item").find {
|
|
|
|
|
it.selectFirst("strong")?.text().equals("Eps $episode:", true)
|
|
|
|
|
}?.selectFirst("a")?.attr("data-id")
|
2022-10-17 04:24:09 +00:00
|
|
|
|
|
|
|
|
|
app.get(
|
2023-06-15 23:38:22 +00:00
|
|
|
|
"$gokuAPI/ajax/movie/episode/servers/${episodeId ?: return}",
|
|
|
|
|
headers = headers
|
|
|
|
|
).document.getServers()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
serversId.apmap { id ->
|
|
|
|
|
val iframe =
|
|
|
|
|
app.get("$gokuAPI/ajax/movie/episode/server/sources/$id", headers = headers)
|
|
|
|
|
.parsedSafe<GokuServer>()?.data?.link ?: return@apmap
|
|
|
|
|
extractRabbitStream(
|
|
|
|
|
if (iframe.contains("rabbitstream")) "Vidcloud" else "Upcloud",
|
|
|
|
|
iframe,
|
|
|
|
|
"$gokuAPI/",
|
|
|
|
|
subtitleCallback,
|
|
|
|
|
callback,
|
|
|
|
|
false,
|
|
|
|
|
decryptKey = RabbitStream.getKey()
|
|
|
|
|
) { it }
|
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 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()
|
2023-01-20 22:06:45 +00:00
|
|
|
|
} ?: return
|
2022-10-17 08:03:20 +00:00
|
|
|
|
|
|
|
|
|
val source =
|
2023-01-20 22:06:45 +00:00
|
|
|
|
Regex("['|\"]file['|\"]:\\s['|\"](#\\S+?)['|\"]").find(script)?.groupValues?.get(
|
2022-10-17 08:03:20 +00:00
|
|
|
|
1
|
2022-11-12 12:08:52 +00:00
|
|
|
|
) ?: return
|
2022-10-17 08:03:20 +00:00
|
|
|
|
val subtitle =
|
2023-01-20 22:06:45 +00:00
|
|
|
|
Regex("['|\"]subtitle['|\"]:\\s['|\"](\\S+?)['|\"]").find(script)?.groupValues?.get(
|
2022-10-17 08:03:20 +00:00
|
|
|
|
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 =
|
2023-01-29 12:29:42 +00:00
|
|
|
|
Regex("\\[(\\d*p.*?)]").find(links)?.groupValues?.getOrNull(1)?.trim()
|
2023-01-29 04:32:17 +00:00
|
|
|
|
?: return@map null
|
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 ->
|
2023-01-20 22:06:45 +00:00
|
|
|
|
val language = Regex("\\[(.*)]").find(sub)?.groupValues?.getOrNull(1) ?: return@map null
|
2022-10-17 08:03:20 +00:00
|
|
|
|
val link = sub.replace("[$language]", "").trim()
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2023-01-20 22:06:45 +00:00
|
|
|
|
getDbgoLanguage(language), link
|
2022-10-17 08:03:20 +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 invokeHDMovieBox(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-12-31 18:06:35 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
2022-10-27 08:46:19 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2023-03-28 03:45:16 +00:00
|
|
|
|
val url = "$hdMovieBoxAPI/watch/$fixTitle"
|
|
|
|
|
val doc = app.get(url).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
|
|
|
|
|
|
2023-03-28 03:45:16 +00:00
|
|
|
|
delay(1000)
|
|
|
|
|
val iframe = app.get(iframeUrl, referer = url).document.selectFirst("iframe")
|
|
|
|
|
?.attr("src").let { httpsify(it ?: return) }
|
2022-10-27 08:46:19 +00:00
|
|
|
|
|
2023-04-17 14:47:08 +00:00
|
|
|
|
if (iframe.startsWith("https://vidmoly.to")) {
|
2023-03-28 03:45:16 +00:00
|
|
|
|
loadExtractor(iframe, "$hdMovieBoxAPI/", subtitleCallback) { video ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
video.name,
|
|
|
|
|
video.name,
|
|
|
|
|
video.url,
|
|
|
|
|
video.referer,
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
video.isM3u8,
|
|
|
|
|
video.headers,
|
|
|
|
|
video.extractorData
|
|
|
|
|
)
|
|
|
|
|
)
|
2022-10-27 09:58:50 +00:00
|
|
|
|
}
|
2023-03-28 03:45:16 +00:00
|
|
|
|
} else {
|
|
|
|
|
val base = getBaseUrl(iframe)
|
|
|
|
|
val script = app.get(
|
|
|
|
|
httpsify(iframe), referer = "$hdMovieBoxAPI/"
|
|
|
|
|
).document.selectFirst("script:containsData(var vhash =)")?.data()
|
|
|
|
|
?.substringAfter("vhash, {")?.substringBefore("}, false")
|
|
|
|
|
|
|
|
|
|
tryParseJson<HdMovieBoxSource>("{$script}").let { source ->
|
|
|
|
|
val disk = if (source?.videoDisk == null) {
|
|
|
|
|
""
|
|
|
|
|
} else {
|
|
|
|
|
base64Encode(source.videoDisk.toString().toByteArray())
|
|
|
|
|
}
|
|
|
|
|
val link = getBaseUrl(iframe) + source?.videoUrl?.replace(
|
|
|
|
|
"\\", ""
|
|
|
|
|
) + "?s=${source?.videoServer}&d=$disk"
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"HDMovieBox",
|
|
|
|
|
"HDMovieBox",
|
|
|
|
|
link,
|
|
|
|
|
iframe,
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
isM3u8 = true,
|
|
|
|
|
)
|
2022-10-27 08:46:19 +00:00
|
|
|
|
)
|
2022-12-31 18:06:35 +00:00
|
|
|
|
|
2023-03-28 03:45:16 +00:00
|
|
|
|
source?.tracks?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
sub.label ?: "",
|
|
|
|
|
fixUrl(sub.file ?: return@map null, base),
|
|
|
|
|
)
|
2022-12-31 18:06:35 +00:00
|
|
|
|
)
|
2023-03-28 03:45:16 +00:00
|
|
|
|
}
|
2022-12-31 18:06:35 +00:00
|
|
|
|
}
|
2022-10-27 08:46:19 +00:00
|
|
|
|
}
|
2023-03-28 03:45:16 +00:00
|
|
|
|
|
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-24 08:29:19 +00:00
|
|
|
|
suspend fun invokeDreamfilm(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.createSlug()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$dreamfilmAPI/$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$dreamfilmAPI/series/$fixTitle/season-$season/episode-$episode"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val iframe = app.get(url).document.selectFirst("iframe.Moly")?.attr("data-src")
|
|
|
|
|
loadExtractor(iframe ?: return, "$dreamfilmAPI/", subtitleCallback) { link ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
link.name,
|
|
|
|
|
link.name,
|
|
|
|
|
link.url,
|
|
|
|
|
link.referer,
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
link.isM3u8,
|
|
|
|
|
link.headers,
|
|
|
|
|
link.extractorData
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 08:46:19 +00:00
|
|
|
|
suspend fun invokeSeries9(
|
|
|
|
|
title: String? = null,
|
2023-04-18 14:55:34 +00:00
|
|
|
|
year: Int? = null,
|
2022-10-27 08:46:19 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2023-04-18 14:55:34 +00:00
|
|
|
|
val doc = if (season == null) {
|
|
|
|
|
val res = app.get("$series9API/film/$fixTitle/watching.html")
|
|
|
|
|
if (!res.isSuccessful) app.get("$series9API/film/$fixTitle-$year/watching.html").document else res.document
|
2022-10-27 08:46:19 +00:00
|
|
|
|
} else {
|
2023-04-18 14:55:34 +00:00
|
|
|
|
app.get("$series9API/film/$fixTitle-season-$season/watching.html").document
|
2022-10-27 08:46:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-20 07:22:52 +00:00
|
|
|
|
val server = doc.select("div#list-eps div.le-server").map { ele ->
|
|
|
|
|
if (season == null) {
|
2023-04-18 14:55:34 +00:00
|
|
|
|
ele.select("a").attr("player-data")
|
|
|
|
|
} else {
|
|
|
|
|
ele.select("a[episode-data=$episode]").attr("player-data")
|
|
|
|
|
}
|
2023-04-20 07:22:52 +00:00
|
|
|
|
}.find { it.contains(Regex("movembed|membed")) }
|
|
|
|
|
|
|
|
|
|
val iframe = app.get(httpsify(server ?: return))
|
|
|
|
|
val iframeDoc = iframe.document
|
|
|
|
|
|
|
|
|
|
argamap({
|
|
|
|
|
iframeDoc.select(".list-server-items > .linkserver")
|
|
|
|
|
.forEach { element ->
|
|
|
|
|
val status = element.attr("data-status") ?: return@forEach
|
|
|
|
|
if (status != "1") return@forEach
|
|
|
|
|
val extractorData = element.attr("data-video") ?: return@forEach
|
|
|
|
|
loadExtractor(extractorData, iframe.url, subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
val iv = "9225679083961858"
|
|
|
|
|
val secretKey = "25742532592138496744665879883281"
|
2023-05-14 18:49:25 +00:00
|
|
|
|
GogoHelper.extractVidstream(
|
2023-04-20 07:22:52 +00:00
|
|
|
|
iframe.url,
|
|
|
|
|
"Vidstream",
|
|
|
|
|
callback,
|
|
|
|
|
iv,
|
|
|
|
|
secretKey,
|
2023-05-21 13:20:19 +00:00
|
|
|
|
secretKey,
|
2023-04-20 07:22:52 +00:00
|
|
|
|
isUsingAdaptiveKeys = false,
|
|
|
|
|
isUsingAdaptiveData = true,
|
|
|
|
|
iframeDocument = iframeDoc
|
|
|
|
|
)
|
|
|
|
|
})
|
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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
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"
|
|
|
|
|
}
|
2023-07-27 14:38:45 +00:00
|
|
|
|
invokeWpmovies(url,subtitleCallback, callback)
|
2022-10-27 08:46:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-26 07:31:20 +00:00
|
|
|
|
suspend fun invokeMultimovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.createSlug()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$multimoviesAPI/movies/$fixTitle"
|
|
|
|
|
} else {
|
|
|
|
|
"$multimoviesAPI/episodes/$fixTitle-${season}x${episode}"
|
|
|
|
|
}
|
2023-07-27 14:38:45 +00:00
|
|
|
|
invokeWpmovies(url,subtitleCallback, callback,true)
|
|
|
|
|
}
|
2023-07-26 07:31:20 +00:00
|
|
|
|
|
2023-07-27 14:38:45 +00:00
|
|
|
|
suspend fun invokeNetmovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.createSlug()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$netmoviesAPI/movies/$fixTitle-$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$netmoviesAPI/episodes/$fixTitle-${season}x${episode}"
|
|
|
|
|
}
|
|
|
|
|
invokeWpmovies(url,subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private suspend fun invokeWpmovies(
|
|
|
|
|
url: String? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
fixIframe: Boolean = false,
|
|
|
|
|
) {
|
|
|
|
|
val res = app.get(url ?: return)
|
2023-07-26 07:31:20 +00:00
|
|
|
|
val referer = getBaseUrl(res.url)
|
|
|
|
|
val document = res.document
|
|
|
|
|
document.select("ul#playeroptionsul > li").map {
|
2023-07-27 14:38:45 +00:00
|
|
|
|
Triple(
|
|
|
|
|
it.attr("data-post"),
|
|
|
|
|
it.attr("data-nume"),
|
|
|
|
|
it.attr("data-type")
|
|
|
|
|
)
|
|
|
|
|
}.apmap { (id, nume, type) ->
|
2023-07-26 07:31:20 +00:00
|
|
|
|
val source = app.post(
|
|
|
|
|
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
|
2023-07-27 14:38:45 +00:00
|
|
|
|
).parsed<ResponseHash>().embed_url.let { if(fixIframe) Jsoup.parse(it).select("IFRAME").attr("SRC") else it }
|
2023-07-26 07:31:20 +00:00
|
|
|
|
if (!source.contains("youtube")) {
|
|
|
|
|
loadExtractor(source, "$referer/", subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-31 04:30:48 +00:00
|
|
|
|
suspend fun invokeDoomovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val res = app.get("$doomoviesAPI/movies/${title.createSlug()}/")
|
|
|
|
|
val host = getBaseUrl(res.url)
|
|
|
|
|
val document = res.document
|
|
|
|
|
document.select("ul#playeroptionsul > li")
|
|
|
|
|
.filter { element -> element.select("span.flag img").attr("src").contains("/en.") }
|
|
|
|
|
.map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.attr("data-post"),
|
|
|
|
|
it.attr("data-nume"),
|
|
|
|
|
it.attr("data-type")
|
|
|
|
|
)
|
|
|
|
|
}.apmap { (id, nume, type) ->
|
|
|
|
|
val source = app.get(
|
|
|
|
|
"$host/wp-json/dooplayer/v2/${id}/${type}/${nume}",
|
|
|
|
|
headers = mapOf("X-Requested-With" to "XMLHttpRequest"),
|
|
|
|
|
referer = "$host/"
|
|
|
|
|
).parsed<ResponseHash>().embed_url
|
|
|
|
|
if (!source.contains("youtube")) {
|
|
|
|
|
loadExtractor(source, "$host/", subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2022-11-01 04:37:30 +00:00
|
|
|
|
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
|
2023-01-09 01:46:00 +00:00
|
|
|
|
val baseApi = getBaseUrl(res.url)
|
|
|
|
|
|
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(
|
2023-01-09 01:46:00 +00:00
|
|
|
|
url = "$baseApi/wp-admin/admin-ajax.php", data = mapOf(
|
2022-12-21 21:49:12 +00:00
|
|
|
|
"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(
|
2023-01-09 01:46:00 +00:00
|
|
|
|
source, referer = "$baseApi/", headers = mapOf(
|
2022-11-19 05:48:25 +00:00
|
|
|
|
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
|
|
|
|
|
)
|
|
|
|
|
).document
|
2023-01-11 01:28:46 +00:00
|
|
|
|
val srcm3u8 =
|
|
|
|
|
resDoc.selectFirst("script:containsData(let url =)")?.data()?.let {
|
2022-11-28 10:29:41 +00:00
|
|
|
|
Regex("['|\"](.*?.m3u8)['|\"]").find(it)?.groupValues?.getOrNull(1)
|
2023-01-08 20:23:44 +00:00
|
|
|
|
}
|
2022-11-19 05:48:25 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"UniqueStream",
|
|
|
|
|
"UniqueStream",
|
2023-01-08 20:23:44 +00:00
|
|
|
|
srcm3u8 ?: return@apmap null,
|
2022-11-19 05:48:25 +00:00
|
|
|
|
source,
|
2023-01-08 20:23:44 +00:00
|
|
|
|
Qualities.P1080.value,
|
2022-11-19 05:48:25 +00:00
|
|
|
|
true,
|
|
|
|
|
)
|
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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2022-10-29 19:32:17 +00:00
|
|
|
|
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 =
|
2023-01-29 12:29:42 +00:00
|
|
|
|
quality?.replace(Regex("\\d{3,4}p"), "Noverse")?.replace(".", " ") ?: "Noverse"
|
2022-10-29 19:32:17 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"Noverse",
|
2022-10-29 19:32:17 +00:00
|
|
|
|
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"
|
|
|
|
|
}
|
2023-07-28 21:41:04 +00:00
|
|
|
|
val filmxyCookies = getFilmxyCookies(imdbId, season)
|
|
|
|
|
val doc = session.get(url, cookies = filmxyCookies).document
|
2023-03-13 18:17:48 +00:00
|
|
|
|
val script = doc.selectFirst("script:containsData(var isSingle)")?.data() ?: return
|
2022-11-10 04:28:02 +00:00
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val sourcesData =
|
|
|
|
|
Regex("listSE\\s*=\\s?(.*?),[\\n|\\s]").find(script)?.groupValues?.get(1).let {
|
|
|
|
|
tryParseJson<HashMap<String, HashMap<String, List<String>>>>(it)
|
|
|
|
|
}
|
2023-01-03 23:01:24 +00:00
|
|
|
|
val sourcesDetail =
|
2023-03-13 18:17:48 +00:00
|
|
|
|
Regex("linkDetails\\s*=\\s?(.*?),[\\n|\\s]").find(script)?.groupValues?.get(1).let {
|
|
|
|
|
tryParseJson<HashMap<String, HashMap<String, String>>>(it)
|
|
|
|
|
}
|
|
|
|
|
val subSourcesData =
|
|
|
|
|
Regex("dSubtitles\\s*=\\s?(.*?),[\\n|\\s]").find(script)?.groupValues?.get(1).let {
|
|
|
|
|
tryParseJson<HashMap<String, HashMap<String, HashMap<String, String>>>>(it)
|
|
|
|
|
}
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
2023-03-13 18:17:48 +00:00
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val sources = if (season == null) {
|
2023-03-13 18:17:48 +00:00
|
|
|
|
sourcesData?.get("movie")?.get("movie")
|
2022-11-02 06:56:24 +00:00
|
|
|
|
} else {
|
2023-03-13 18:17:48 +00:00
|
|
|
|
sourcesData?.get("s$seasonSlug")?.get("e$episodeSlug")
|
|
|
|
|
}
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val subSources = if (season == null) {
|
2023-03-13 18:17:48 +00:00
|
|
|
|
subSourcesData?.get("movie")?.get("movie")
|
2022-12-30 22:16:30 +00:00
|
|
|
|
} else {
|
2023-03-13 18:17:48 +00:00
|
|
|
|
subSourcesData?.get("s$seasonSlug")?.get("e$episodeSlug")
|
|
|
|
|
}
|
2022-12-30 22:16:30 +00:00
|
|
|
|
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val scriptUser =
|
2023-03-13 18:17:48 +00:00
|
|
|
|
doc.select("script").find { it.data().contains("var userNonce") }?.data() ?: return
|
2022-11-18 11:00:36 +00:00
|
|
|
|
val userNonce =
|
|
|
|
|
Regex("var\\suserNonce.*?[\"|'](\\S+?)[\"|'];").find(scriptUser)?.groupValues?.get(1)
|
|
|
|
|
val userId =
|
|
|
|
|
Regex("var\\suser_id.*?[\"|'](\\S+?)[\"|'];").find(scriptUser)?.groupValues?.get(1)
|
2023-03-13 18:17:48 +00:00
|
|
|
|
val linkIDs = sources?.joinToString("") {
|
2022-11-02 06:56:24 +00:00
|
|
|
|
"&linkIDs%5B%5D=$it"
|
2023-03-13 18:17:48 +00:00
|
|
|
|
}?.replace("\"", "")
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
|
|
|
|
val json = app.post(
|
|
|
|
|
"$filmxyAPI/wp-admin/admin-ajax.php",
|
2023-07-28 12:36:39 +00:00
|
|
|
|
requestBody = "action=get_vid_links$linkIDs&user_id=$userId&nonce=$userNonce".toRequestBody(),
|
2022-11-02 06:56:24 +00:00
|
|
|
|
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",
|
|
|
|
|
),
|
2023-07-28 21:41:04 +00:00
|
|
|
|
cookies = filmxyCookies
|
2023-03-13 18:17:48 +00:00
|
|
|
|
).text.let { tryParseJson<HashMap<String, String>>(it) }
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
2023-03-13 18:17:48 +00:00
|
|
|
|
sources?.map { source ->
|
|
|
|
|
val link = json?.get(source)
|
|
|
|
|
val quality = sourcesDetail?.get(source)?.get("resolution")
|
|
|
|
|
val server = sourcesDetail?.get(source)?.get("server")
|
|
|
|
|
val size = sourcesDetail?.get(source)?.get("size")
|
2022-11-02 06:56:24 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-13 19:13:38 +00:00
|
|
|
|
"Filmxy",
|
|
|
|
|
"Filmxy $server [$size]",
|
2023-03-13 18:17:48 +00:00
|
|
|
|
link ?: return@map,
|
2022-11-02 06:56:24 +00:00
|
|
|
|
"$filmxyAPI/",
|
|
|
|
|
getQualityFromName(quality)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-13 18:17:48 +00:00
|
|
|
|
subSources?.mapKeys { sub ->
|
2022-12-30 22:16:30 +00:00
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2023-03-13 18:17:48 +00:00
|
|
|
|
SubtitleHelper.fromTwoLettersToLanguage(sub.key) ?: return@mapKeys,
|
|
|
|
|
"https://www.mysubs.org/get-subtitle/${sub.value}"
|
2022-12-30 22:16:30 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-02 06:56:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2023-01-20 10:10:37 +00:00
|
|
|
|
val doc = if (season == null || season == 1) {
|
|
|
|
|
app.get("$kimcartoonAPI/Cartoon/$fixTitle").document
|
2022-11-07 10:16:02 +00:00
|
|
|
|
} else {
|
2023-01-20 10:10:37 +00:00
|
|
|
|
val res = app.get("$kimcartoonAPI/Cartoon/$fixTitle-Season-$season")
|
|
|
|
|
if (res.url == "$kimcartoonAPI/")
|
|
|
|
|
app.get("$kimcartoonAPI/Cartoon/$fixTitle-Season-0$season").document else res.document
|
2022-11-07 10:16:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val iframe = if (season == null) {
|
|
|
|
|
doc.select("table.listing tr td a").firstNotNullOf { it.attr("href") }
|
|
|
|
|
} else {
|
2023-01-20 10:10:37 +00:00
|
|
|
|
doc.select("table.listing tr td a").find {
|
|
|
|
|
it.attr("href").contains(Regex("(?i)Episode-0*$episode"))
|
|
|
|
|
}?.attr("href")
|
2022-11-07 10:16:02 +00:00
|
|
|
|
} ?: return
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val servers =
|
|
|
|
|
app.get(fixUrl(iframe, kimcartoonAPI)).document.select("#selectServer > option")
|
|
|
|
|
.map { fixUrl(it.attr("value"), kimcartoonAPI) }
|
2023-03-26 06:50:45 +00:00
|
|
|
|
|
|
|
|
|
servers.apmap {
|
|
|
|
|
app.get(it).document.select("#my_video_1").attr("src").let { iframe ->
|
|
|
|
|
if (iframe.isNotEmpty()) {
|
|
|
|
|
loadExtractor(iframe, "$kimcartoonAPI/", subtitleCallback, callback)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-07 10:16:02 +00:00
|
|
|
|
}
|
2023-02-08 14:55:54 +00:00
|
|
|
|
|
2023-06-26 05:11:27 +00:00
|
|
|
|
suspend fun invokeDumpStream(
|
2023-01-09 03:55:20 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
2023-01-08 20:23:44 +00:00
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
2023-02-24 21:32:34 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-06-26 05:11:27 +00:00
|
|
|
|
val (id, type) = getDumpIdAndType(title, year, season)
|
|
|
|
|
val json = fetchDumpEpisodes("$id", "$type", episode) ?: return
|
2023-01-09 03:55:20 +00:00
|
|
|
|
|
2023-02-07 14:33:25 +00:00
|
|
|
|
json.subtitlingList?.map { sub ->
|
2023-01-09 03:55:20 +00:00
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
getVipLanguage(sub.languageAbbr ?: return@map),
|
|
|
|
|
sub.subtitlingUrl ?: return@map
|
|
|
|
|
)
|
|
|
|
|
)
|
2023-05-05 09:31:57 +00:00
|
|
|
|
}
|
2023-01-08 20:23:44 +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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2023-01-29 04:32:17 +00:00
|
|
|
|
val doc = if (season == null) {
|
2023-01-20 10:10:37 +00:00
|
|
|
|
val res = app.get("$xMovieAPI/movies/$fixTitle/watch")
|
2023-01-29 04:32:17 +00:00
|
|
|
|
if (res.url == "$xMovieAPI/") app.get("$xMovieAPI/movies/$fixTitle-$year/watch").document else res.document
|
2022-11-12 12:08:52 +00:00
|
|
|
|
} else {
|
2023-01-20 10:10:37 +00:00
|
|
|
|
app.get("$xMovieAPI/series/$fixTitle-season-$season-episode-$episode/watch").document
|
2022-11-12 12:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-31 18:06:35 +00:00
|
|
|
|
val script = doc.selectFirst("script:containsData(const player =)")?.data() ?: return
|
2023-01-03 23:01:24 +00:00
|
|
|
|
val link =
|
|
|
|
|
Regex("[\"|']file[\"|']:\\s?[\"|'](http.*?.(mp4|m3u8))[\"|'],").find(script)?.groupValues?.getOrNull(
|
2022-12-15 12:30:01 +00:00
|
|
|
|
1
|
2022-12-31 18:06:35 +00:00
|
|
|
|
) ?: return
|
2022-11-12 12:08:52 +00:00
|
|
|
|
|
2023-01-03 23:01:24 +00:00
|
|
|
|
if (link.contains(".m3u8")) {
|
2022-12-31 18:06:35 +00:00
|
|
|
|
M3u8Helper.generateM3u8(
|
2022-11-12 12:08:52 +00:00
|
|
|
|
"Xmovie",
|
2022-12-31 18:06:35 +00:00
|
|
|
|
link,
|
2022-11-12 12:08:52 +00:00
|
|
|
|
"",
|
2022-12-31 18:06:35 +00:00
|
|
|
|
).forEach(callback)
|
|
|
|
|
} else {
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Xmovie",
|
|
|
|
|
"Xmovie",
|
|
|
|
|
link,
|
|
|
|
|
"",
|
|
|
|
|
Qualities.P720.value,
|
|
|
|
|
)
|
2022-11-12 12:08:52 +00:00
|
|
|
|
)
|
2022-12-31 18:06:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-03 23:01:24 +00:00
|
|
|
|
Regex(""""file":\s+?"(\S+\.(vtt|srt))""").find(script)?.groupValues?.getOrNull(1)
|
|
|
|
|
?.let { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
"English",
|
|
|
|
|
sub,
|
|
|
|
|
)
|
2022-12-31 18:06:35 +00:00
|
|
|
|
)
|
2023-01-03 23:01:24 +00:00
|
|
|
|
}
|
2022-11-12 12:08:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-17 10:01:08 +00:00
|
|
|
|
suspend fun invokeFmovies(
|
2022-11-13 20:02:28 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-04-19 09:52:31 +00:00
|
|
|
|
val query = title?.replace(Regex("[^\\w-\\s]"), "")
|
2023-04-17 10:01:08 +00:00
|
|
|
|
val html =
|
2023-05-29 18:39:47 +00:00
|
|
|
|
app.get("$fmoviesAPI/ajax/film/search?keyword=$query")
|
|
|
|
|
.parsedSafe<FmoviesResponses>()?.result?.html
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2023-04-17 10:01:08 +00:00
|
|
|
|
val mediaId = Jsoup.parse(html ?: return).select("a.item").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.attr("href"),
|
2023-05-29 18:39:47 +00:00
|
|
|
|
it.select("div.name").text(),
|
|
|
|
|
it.select("span.dot")[1].text(),
|
2023-04-17 10:01:08 +00:00
|
|
|
|
)
|
|
|
|
|
}.find {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
it.first.contains("/movie/")
|
|
|
|
|
} else {
|
2023-06-02 02:56:59 +00:00
|
|
|
|
it.first.contains("/tv/")
|
2023-04-17 10:01:08 +00:00
|
|
|
|
} && (it.second.equals(title, true) || it.second.createSlug()
|
|
|
|
|
.equals(title.createSlug())) && it.third.toInt() == year
|
2023-05-29 18:39:47 +00:00
|
|
|
|
}?.first
|
2022-11-13 20:02:28 +00:00
|
|
|
|
|
2023-05-29 18:39:47 +00:00
|
|
|
|
val watchId =
|
|
|
|
|
app.get(fixUrl(mediaId ?: return, fmoviesAPI)).document.selectFirst("div.watch")
|
|
|
|
|
?.attr("data-id")
|
2023-04-28 17:25:17 +00:00
|
|
|
|
|
2023-05-29 18:39:47 +00:00
|
|
|
|
val episodeId = app.get(
|
|
|
|
|
"$fmoviesAPI/ajax/episode/list/${watchId ?: return}?vrf=${
|
|
|
|
|
comsumetEncodeVrf(watchId)
|
|
|
|
|
}"
|
|
|
|
|
).parsedSafe<FmoviesResult>()?.result?.let { Jsoup.parse(it) }
|
|
|
|
|
?.selectFirst("ul[data-season=${season ?: 1}] li a[data-num=${episode ?: 1}]")
|
|
|
|
|
?.attr("data-id")
|
2023-05-22 15:46:24 +00:00
|
|
|
|
|
2023-05-29 18:39:47 +00:00
|
|
|
|
val servers =
|
2023-06-09 18:44:28 +00:00
|
|
|
|
app.get(
|
|
|
|
|
"$fmoviesAPI/ajax/server/list/${episodeId ?: return}?vrf=${
|
|
|
|
|
comsumetEncodeVrf(
|
|
|
|
|
episodeId
|
|
|
|
|
)
|
|
|
|
|
}"
|
|
|
|
|
)
|
2023-05-29 18:39:47 +00:00
|
|
|
|
.parsedSafe<FmoviesResult>()?.result?.let { Jsoup.parse(it) }
|
|
|
|
|
?.select("ul li")?.map { it.attr("data-id") to it.attr("data-link-id") }
|
|
|
|
|
|
|
|
|
|
servers?.filter {
|
|
|
|
|
it.first == "41" || it.first == "45"
|
|
|
|
|
}?.apmap { (serverid, linkId) ->
|
|
|
|
|
delay(2000)
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val decryptServer =
|
|
|
|
|
app.get("$fmoviesAPI/ajax/server/$linkId?vrf=${comsumetEncodeVrf(linkId)}")
|
|
|
|
|
.parsedSafe<FmoviesResponses>()?.result?.url?.let { comsumetDecodeVrf(it) }
|
2023-05-29 18:39:47 +00:00
|
|
|
|
if (serverid == "41") {
|
|
|
|
|
invokeVizcloud(serverid, decryptServer ?: return@apmap, subtitleCallback, callback)
|
2023-04-28 17:25:17 +00:00
|
|
|
|
} else {
|
2023-05-29 18:39:47 +00:00
|
|
|
|
loadExtractor(decryptServer ?: return@apmap, fmoviesAPI, subtitleCallback, callback)
|
2023-04-28 17:25:17 +00:00
|
|
|
|
}
|
2023-04-17 10:01:08 +00:00
|
|
|
|
}
|
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,
|
2023-07-04 09:38:14 +00:00
|
|
|
|
isAnime: Boolean = false,
|
|
|
|
|
lastSeason: Int? = null,
|
2022-11-13 20:02:28 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-07-04 09:38:14 +00:00
|
|
|
|
val slug = title.createSlug() ?: return
|
|
|
|
|
val type = when {
|
|
|
|
|
isAnime -> "3"
|
|
|
|
|
season == null -> "2"
|
|
|
|
|
else -> "1"
|
|
|
|
|
}
|
2022-11-13 20:02:28 +00:00
|
|
|
|
val res = app.get(
|
2023-07-04 09:38:14 +00:00
|
|
|
|
"$kissKhAPI/api/DramaList/Search?q=$title&type=$type", 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 {
|
2023-07-04 09:38:14 +00:00
|
|
|
|
val data = res.find {
|
|
|
|
|
val slugTitle = it.title.createSlug()
|
|
|
|
|
when {
|
|
|
|
|
season == null -> slugTitle?.equals(slug) == true
|
|
|
|
|
lastSeason == 1 -> slugTitle?.contains(slug) == true
|
|
|
|
|
else -> slugTitle?.contains(slug) == true && it.title?.contains("Season $season", true) == true
|
2022-11-13 20:02:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 09:38:14 +00:00
|
|
|
|
data?.id to data?.title
|
2022-11-13 20:02:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) {
|
2023-02-22 09:31:40 +00:00
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"Kisskh",
|
|
|
|
|
link,
|
|
|
|
|
"$kissKhAPI/",
|
|
|
|
|
headers = mapOf("Origin" to kissKhAPI)
|
|
|
|
|
).forEach(callback)
|
2022-11-13 20:02:28 +00:00
|
|
|
|
} 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
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-11 01:28:46 +00:00
|
|
|
|
suspend fun invokeAnimes(
|
|
|
|
|
title: String? = null,
|
2023-01-11 12:42:59 +00:00
|
|
|
|
epsTitle: String? = null,
|
2023-05-22 15:46:24 +00:00
|
|
|
|
date: String?,
|
|
|
|
|
airedDate: String?,
|
2022-11-18 11:00:36 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-05-22 15:46:24 +00:00
|
|
|
|
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val (aniId, malId) = convertTmdbToAnimeId(
|
|
|
|
|
title,
|
|
|
|
|
date,
|
|
|
|
|
airedDate,
|
|
|
|
|
if (season == null) TvType.AnimeMovie else TvType.Anime
|
|
|
|
|
)
|
2023-01-11 01:28:46 +00:00
|
|
|
|
|
|
|
|
|
argamap(
|
|
|
|
|
{
|
2023-07-23 18:05:02 +00:00
|
|
|
|
invokeAniwatch(malId, episode, subtitleCallback, callback)
|
2023-01-11 01:28:46 +00:00
|
|
|
|
},
|
2023-03-10 22:22:24 +00:00
|
|
|
|
{
|
|
|
|
|
invokeBiliBili(aniId, episode, subtitleCallback, callback)
|
|
|
|
|
},
|
2023-05-21 13:20:19 +00:00
|
|
|
|
{
|
2023-06-09 18:44:28 +00:00
|
|
|
|
if (season != null) invokeCrunchyroll(
|
|
|
|
|
aniId,
|
|
|
|
|
malId,
|
|
|
|
|
epsTitle,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
subtitleCallback,
|
|
|
|
|
callback
|
|
|
|
|
)
|
2023-05-02 19:45:23 +00:00
|
|
|
|
}
|
2023-05-21 13:20:19 +00:00
|
|
|
|
)
|
2023-04-14 08:34:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-10 22:22:24 +00:00
|
|
|
|
private suspend fun invokeBiliBili(
|
2023-05-22 15:46:24 +00:00
|
|
|
|
aniId: Int? = null,
|
2023-03-10 22:22:24 +00:00
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val res = app.get(
|
|
|
|
|
"$biliBiliAPI/anime/episodes?id=${aniId ?: return}&source_id=bilibili",
|
2023-07-11 12:07:22 +00:00
|
|
|
|
referer = otakuzBaseUrl
|
2023-06-09 18:44:28 +00:00
|
|
|
|
)
|
2023-03-10 22:22:24 +00:00
|
|
|
|
.parsedSafe<BiliBiliDetails>()?.episodes?.find {
|
|
|
|
|
it.episodeNumber == episode
|
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val sources =
|
2023-06-09 18:44:28 +00:00
|
|
|
|
app.get(
|
|
|
|
|
"$biliBiliAPI/source?episode_id=${res.sourceEpisodeId}&source_media_id=${res.sourceMediaId}&source_id=${res.sourceId}",
|
2023-07-11 12:07:22 +00:00
|
|
|
|
referer = otakuzBaseUrl
|
2023-06-09 18:44:28 +00:00
|
|
|
|
)
|
2023-03-10 22:22:24 +00:00
|
|
|
|
.parsedSafe<BiliBiliSourcesResponse>()
|
|
|
|
|
|
|
|
|
|
sources?.sources?.apmap { source ->
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val quality =
|
2023-06-09 18:44:28 +00:00
|
|
|
|
app.get(
|
|
|
|
|
source.file ?: return@apmap null,
|
2023-07-11 12:07:22 +00:00
|
|
|
|
referer = otakuzBaseUrl
|
2023-06-09 18:44:28 +00:00
|
|
|
|
).document.selectFirst("Representation")
|
2023-03-17 14:54:02 +00:00
|
|
|
|
?.attr("height")
|
2023-03-10 22:22:24 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"BiliBili",
|
|
|
|
|
"BiliBili",
|
|
|
|
|
source.file,
|
2023-07-11 12:07:22 +00:00
|
|
|
|
"",
|
2023-03-10 22:22:24 +00:00
|
|
|
|
quality?.toIntOrNull() ?: Qualities.Unknown.value,
|
|
|
|
|
isDash = true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-24 22:18:47 +00:00
|
|
|
|
sources?.subtitles?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
SubtitleHelper.fromTwoLettersToLanguage(sub.lang ?: "") ?: sub.language
|
|
|
|
|
?: return@map null,
|
|
|
|
|
sub.file ?: return@map null
|
2023-03-10 22:22:24 +00:00
|
|
|
|
)
|
2023-05-24 22:18:47 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
2023-03-10 22:22:24 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-23 18:05:02 +00:00
|
|
|
|
private suspend fun invokeAniwatch(
|
|
|
|
|
malId: Int? = null,
|
2023-01-11 01:28:46 +00:00
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-07-04 12:57:53 +00:00
|
|
|
|
val headers = mapOf(
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest",
|
|
|
|
|
)
|
2023-07-23 18:05:02 +00:00
|
|
|
|
val animeId = app.get("$malsyncAPI/mal/anime/${malId ?: return}").parsedSafe<MALSyncResponses>()?.sites?.zoro?.keys?.map { it }
|
2023-05-22 15:46:24 +00:00
|
|
|
|
animeId?.apmap { id ->
|
2023-07-23 18:05:02 +00:00
|
|
|
|
val episodeId = app.get("$aniwatchAPI/ajax/v2/episode/list/${id ?: return@apmap}", headers = headers)
|
|
|
|
|
.parsedSafe<AniwatchResponses>()?.html?.let {
|
2023-05-22 15:46:24 +00:00
|
|
|
|
Jsoup.parse(it)
|
2023-05-22 21:45:08 +00:00
|
|
|
|
}?.select("div.ss-list a")?.find { it.attr("data-number") == "${episode ?: 1}" }
|
2023-05-22 15:46:24 +00:00
|
|
|
|
?.attr("data-id")
|
|
|
|
|
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val servers =
|
2023-07-23 18:05:02 +00:00
|
|
|
|
app.get("$aniwatchAPI/ajax/v2/episode/servers?episodeId=${episodeId ?: return@apmap}", headers = headers)
|
|
|
|
|
.parsedSafe<AniwatchResponses>()?.html?.let { Jsoup.parse(it) }
|
2023-06-09 18:44:28 +00:00
|
|
|
|
?.select("div.item.server-item")?.map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.text(),
|
|
|
|
|
it.attr("data-id"),
|
|
|
|
|
it.attr("data-type"),
|
|
|
|
|
)
|
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
|
2023-05-22 15:46:24 +00:00
|
|
|
|
servers?.apmap servers@{ server ->
|
2023-07-23 18:05:02 +00:00
|
|
|
|
val iframe = app.get("$aniwatchAPI/ajax/v2/episode/sources?id=${server.second ?: return@servers}", headers = headers)
|
|
|
|
|
.parsedSafe<AniwatchResponses>()?.link ?: return@servers
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val audio = if (server.third == "sub") "Raw" else "English Dub"
|
2023-07-07 08:10:25 +00:00
|
|
|
|
if (server.first.contains(Regex("Vidstreaming|MegaCloud|Vidcloud"))) {
|
2023-05-22 15:46:24 +00:00
|
|
|
|
extractRabbitStream(
|
|
|
|
|
"${server.first} [$audio]",
|
|
|
|
|
iframe,
|
2023-07-23 18:05:02 +00:00
|
|
|
|
"$aniwatchAPI/",
|
2023-05-22 15:46:24 +00:00
|
|
|
|
subtitleCallback,
|
|
|
|
|
callback,
|
|
|
|
|
false,
|
|
|
|
|
decryptKey = RabbitStream.getZoroKey()
|
|
|
|
|
) { it }
|
|
|
|
|
} else {
|
2023-07-23 18:05:02 +00:00
|
|
|
|
loadExtractor(iframe, "$aniwatchAPI/", subtitleCallback, callback)
|
2023-05-22 15:46:24 +00:00
|
|
|
|
}
|
2023-05-21 13:20:19 +00:00
|
|
|
|
|
2023-05-22 15:46:24 +00:00
|
|
|
|
}
|
2022-11-18 11:00:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-21 13:20:19 +00:00
|
|
|
|
|
2023-01-11 01:28:46 +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,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-08 04:50:33 +00:00
|
|
|
|
val slug = title.createSlug()?.replace("-", " ")
|
|
|
|
|
val url = "$uhdmoviesAPI/?s=$slug"
|
|
|
|
|
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()
|
2022-11-21 10:27:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-08 04:50:33 +00:00
|
|
|
|
val detailUrl = (if (scriptData.size == 1) {
|
|
|
|
|
scriptData.first()
|
|
|
|
|
} else {
|
|
|
|
|
scriptData.find { it.second?.filterMedia(title, year, lastSeason) == true }
|
|
|
|
|
})?.first
|
|
|
|
|
|
|
|
|
|
val detailDoc = app.get(detailUrl ?: 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 }
|
2023-02-08 04:50:33 +00:00
|
|
|
|
.filter { it.text().filterIframe(season, lastSeason, year, title) }.mapNotNull {
|
2022-12-15 12:30:01 +00:00
|
|
|
|
if (season == null) {
|
|
|
|
|
it.text() to it.nextElementSibling()?.select("a")?.attr("href")
|
|
|
|
|
} else {
|
2023-02-08 14:55:54 +00:00
|
|
|
|
it.text() to it.nextElementSibling()
|
2023-03-17 14:54:02 +00:00
|
|
|
|
?.select("a")?.find { child ->
|
|
|
|
|
child.select("span").text().equals("Episode $episode", true)
|
|
|
|
|
}
|
2022-12-15 12:30:01 +00:00
|
|
|
|
?.attr("href")
|
|
|
|
|
}
|
|
|
|
|
}.filter { it.second?.contains(Regex("(https:)|(http:)")) == true }
|
|
|
|
|
|
2023-01-08 20:23:44 +00:00
|
|
|
|
val sources = mutableListOf<Pair<String, String?>>()
|
|
|
|
|
if (iframeList.any {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"2160p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
}) {
|
|
|
|
|
sources.addAll(iframeList.filter {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"2160p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
sources.add(iframeList.first {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"1080p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
sources.addAll(iframeList.filter { it.first.contains("1080p", true) })
|
|
|
|
|
}
|
2022-11-21 10:27:07 +00:00
|
|
|
|
|
2023-01-08 20:23:44 +00:00
|
|
|
|
sources.apmap { (quality, link) ->
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val driveLink =
|
|
|
|
|
if (link?.contains("driveleech") == true) bypassDriveleech(link) else bypassTechmny(
|
|
|
|
|
link ?: return@apmap
|
|
|
|
|
)
|
2023-03-30 21:18:33 +00:00
|
|
|
|
val base = getBaseUrl(driveLink ?: return@apmap)
|
2023-03-07 14:05:52 +00:00
|
|
|
|
val resDoc = app.get(driveLink).document
|
2023-01-29 12:29:42 +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()) {
|
2023-01-29 12:29:42 +00:00
|
|
|
|
val backupIframe = resDoc.select("a.btn.btn-outline-warning").attr("href")
|
2023-03-30 21:18:33 +00:00
|
|
|
|
extractBackupUHD(backupIframe ?: return@apmap)
|
2022-12-07 19:17:24 +00:00
|
|
|
|
} else {
|
|
|
|
|
extractMirrorUHD(bitLink, base)
|
2022-11-22 00:47:52 +00:00
|
|
|
|
}
|
2022-12-12 17:28:45 +00:00
|
|
|
|
|
2023-07-04 12:57:53 +00:00
|
|
|
|
val tags = getUhdTags(quality)
|
|
|
|
|
val qualities = getIndexQuality(quality)
|
|
|
|
|
val size = getIndexSize(quality)
|
2022-11-21 10:27:07 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"UHDMovies",
|
2023-07-04 12:57:53 +00:00
|
|
|
|
"UHDMovies $tags [$size]",
|
2023-03-30 21:18:33 +00:00
|
|
|
|
downloadLink ?: return@apmap,
|
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
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 12:57:53 +00:00
|
|
|
|
suspend fun invokePobmovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val detailDoc = app.get("$pobmoviesAPI/${title.createSlug()}-$year").document
|
|
|
|
|
val iframeList = detailDoc.select("div.entry-content p").map { it }
|
|
|
|
|
.filter { it.text().filterIframe(year = year, title = title) }.mapNotNull {
|
|
|
|
|
it.text() to it.nextElementSibling()?.select("a")?.attr("href")
|
|
|
|
|
}.filter { it.second?.contains(Regex("(https:)|(http:)")) == true }
|
|
|
|
|
|
|
|
|
|
val sources = mutableListOf<Pair<String, String?>>()
|
|
|
|
|
if (iframeList.any {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"2160p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
}) {
|
|
|
|
|
sources.addAll(iframeList.filter {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"2160p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
sources.add(iframeList.first {
|
|
|
|
|
it.first.contains(
|
|
|
|
|
"1080p",
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
sources.addAll(iframeList.filter { it.first.contains("1080p", true) })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sources.apmap { (name, link) ->
|
|
|
|
|
if (link.isNullOrEmpty()) return@apmap
|
|
|
|
|
val videoLink = when {
|
|
|
|
|
link.contains("gdtot") -> {
|
|
|
|
|
val gdBotLink = extractGdbot(link)
|
|
|
|
|
extractGdflix(gdBotLink ?: return@apmap)
|
|
|
|
|
}
|
|
|
|
|
link.contains("gdflix") -> {
|
|
|
|
|
extractGdflix(link)
|
|
|
|
|
}
|
|
|
|
|
else -> {
|
|
|
|
|
return@apmap
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val tags = getUhdTags(name)
|
|
|
|
|
val qualities = getIndexQuality(name)
|
|
|
|
|
val size = getIndexSize(name)
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Pobmovies",
|
|
|
|
|
"Pobmovies $tags [${size}]",
|
|
|
|
|
videoLink ?: return@apmap,
|
|
|
|
|
"",
|
|
|
|
|
qualities
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 13:50:37 +00:00
|
|
|
|
suspend fun invokeFwatayako(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
val ref = "https://videoapi.tv/"
|
|
|
|
|
val files = app.get(
|
|
|
|
|
"$fwatayakoAPI/IAF0wWTdNYZm?imdb_id=$imdbId",
|
|
|
|
|
referer = ref
|
|
|
|
|
).document.selectFirst("input#files")?.attr("value") ?: return
|
|
|
|
|
val data = files.let {
|
2022-12-21 21:49:12 +00:00
|
|
|
|
if (season == null) {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
it.replace("\"381\"", "\"movie\"").replace("\"30\"", "\"movie_dl\"")
|
2022-12-21 21:49:12 +00:00
|
|
|
|
} else {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
it.replace("\"381\"", "\"tv\"").replace("\"30\"", "\"tv_dl\"")
|
2022-12-21 21:49:12 +00:00
|
|
|
|
}
|
|
|
|
|
}.let { tryParseJson<SourcesFwatayako>(it) } ?: return
|
2022-11-22 13:50:37 +00:00
|
|
|
|
|
|
|
|
|
val sourcesLink = if (season == null) {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
data.sourcesMovie
|
2022-11-22 13:50:37 +00:00
|
|
|
|
} else {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
data.sourcesTv?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.file
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val downoadLink = if (season == null) {
|
2023-03-15 14:28:26 +00:00
|
|
|
|
data.movie_dl
|
|
|
|
|
} else {
|
|
|
|
|
data.tv_dl?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.download
|
2022-11-22 13:50:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourcesLink?.split(",")?.map {
|
|
|
|
|
val source = it.substringBefore("or").trim()
|
|
|
|
|
val quality =
|
2023-01-29 12:29:42 +00:00
|
|
|
|
Regex("\\[(\\d{3,4})p]").find(source)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-11-22 13:50:37 +00:00
|
|
|
|
val link = httpsify(source.replace("[${quality}p]", "").trim())
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
link,
|
2023-03-15 14:28:26 +00:00
|
|
|
|
ref,
|
2022-11-22 13:50:37 +00:00
|
|
|
|
quality ?: Qualities.Unknown.value,
|
|
|
|
|
isM3u8 = true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
2023-03-15 14:28:26 +00:00
|
|
|
|
|
|
|
|
|
downoadLink?.mapKeys {
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
"Fwatayako",
|
|
|
|
|
httpsify(it.value),
|
|
|
|
|
ref,
|
|
|
|
|
getQualityFromName(it.key),
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 13:50:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-02 16:50:56 +00:00
|
|
|
|
suspend fun invokeGMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2023-01-29 19:27:40 +00:00
|
|
|
|
val url = if (season == null || season == 1) {
|
2022-12-02 16:50:56 +00:00
|
|
|
|
"$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 {
|
2023-01-29 19:27:40 +00:00
|
|
|
|
it.previousElementSibling()?.text()
|
|
|
|
|
?.contains(Regex("(?i)episode\\s?$episode")) == true
|
2022-12-02 16:50:56 +00:00
|
|
|
|
}?.select("div.wp-block-button")?.map {
|
|
|
|
|
it.select("a").attr("href") to it.text()
|
|
|
|
|
}
|
2022-12-11 03:39:03 +00:00
|
|
|
|
})?.filter {
|
2023-03-02 06:06:31 +00:00
|
|
|
|
it.first.contains("gdtot") && it.second.contains(Regex("(?i)(4k|1080p)"))
|
2022-12-11 03:39:03 +00:00
|
|
|
|
} ?: 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(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"GMovies",
|
2022-12-07 15:06:48 +00:00
|
|
|
|
"GMovies [$size]",
|
|
|
|
|
videoLink ?: return@apmap null,
|
|
|
|
|
"",
|
|
|
|
|
getGMoviesQuality(title)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeFDMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2022-12-07 15:06:48 +00:00
|
|
|
|
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 {
|
2023-03-03 22:37:14 +00:00
|
|
|
|
it.quality.contains(Regex("(?i)(1080p|4k)")) && it.type.contains(Regex("(gdtot|oiya)"))
|
2022-12-12 13:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
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 {
|
2023-03-16 07:46:54 +00:00
|
|
|
|
type.contains("gdtot") -> {
|
|
|
|
|
val gdBotLink = extractGdbot(fdLink ?: return@apmap null)
|
|
|
|
|
extractGdflix(gdBotLink ?: return@apmap null)
|
|
|
|
|
}
|
2022-12-12 13:24:46 +00:00
|
|
|
|
type.contains("oiya") -> {
|
2023-07-21 09:55:03 +00:00
|
|
|
|
val oiyaLink = extractOiya(fdLink ?: return@apmap null, qualities)
|
|
|
|
|
if(oiyaLink?.contains("gdtot") == true) {
|
|
|
|
|
val gdBotLink = extractGdbot(oiyaLink)
|
|
|
|
|
extractGdflix(gdBotLink ?: return@apmap null)
|
|
|
|
|
} else {
|
|
|
|
|
oiyaLink
|
|
|
|
|
}
|
2022-12-12 13:24:46 +00:00
|
|
|
|
}
|
|
|
|
|
else -> {
|
|
|
|
|
return@apmap null
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-07 15:06:48 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"FDMovies",
|
2022-12-07 15:06:48 +00:00
|
|
|
|
"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
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val res = app.get("$m4uhdAPI/search/${title.createSlug()}.html").document
|
2022-12-09 08:44:01 +00:00
|
|
|
|
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) {
|
2023-05-02 19:45:23 +00:00
|
|
|
|
doc.select("div.le-server span").map { it.attr("data") }
|
2022-12-09 08:44:01 +00:00
|
|
|
|
} 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(";")
|
2023-05-02 19:45:23 +00:00
|
|
|
|
requestEmbed.document.select("div.le-server span").map { it.attr("data") }
|
2022-12-09 08:44:01 +00:00
|
|
|
|
}
|
2022-12-02 16:50:56 +00:00
|
|
|
|
|
2023-05-02 19:45:23 +00:00
|
|
|
|
m4uData.apmap { data ->
|
|
|
|
|
val iframe = app.post(
|
|
|
|
|
"$m4uhdAPI/ajax",
|
|
|
|
|
data = mapOf(
|
|
|
|
|
"m4u" to data, "_token" to "$token"
|
|
|
|
|
),
|
|
|
|
|
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")
|
2022-12-09 08:44:01 +00:00
|
|
|
|
|
2023-05-02 19:45:23 +00:00
|
|
|
|
loadExtractor(iframe, m4uhdAPI, subtitleCallback, callback)
|
|
|
|
|
}
|
2022-12-09 08:44:01 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-10 12:25:28 +00:00
|
|
|
|
suspend fun invokeTvMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title.createSlug()
|
2022-12-10 12:25:28 +00:00
|
|
|
|
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 =
|
2023-01-29 12:29:42 +00:00
|
|
|
|
Regex("(\\d{3,4})p").find(server.first)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-12-10 12:25:28 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"TVMovies",
|
2022-12-15 17:30:38 +00:00
|
|
|
|
"TVMovies [${videoData?.second}]",
|
|
|
|
|
videoData?.first ?: return,
|
2022-12-10 12:25:28 +00:00
|
|
|
|
"",
|
|
|
|
|
quality ?: Qualities.Unknown.value
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-26 05:11:27 +00:00
|
|
|
|
private suspend fun invokeCrunchyroll(
|
2023-05-22 15:46:24 +00:00
|
|
|
|
aniId: Int? = null,
|
2023-05-29 03:34:57 +00:00
|
|
|
|
malId: Int? = null,
|
2022-12-14 05:05:18 +00:00
|
|
|
|
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
|
|
|
|
|
) {
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val id = getCrunchyrollId("${aniId ?: return}")
|
|
|
|
|
?: getCrunchyrollIdFromMalSync("${malId ?: return}") ?: return
|
2023-05-21 13:20:19 +00:00
|
|
|
|
val audioLocal = listOf(
|
|
|
|
|
"ja-JP",
|
|
|
|
|
"en-US",
|
|
|
|
|
"zh-CN",
|
2023-03-14 16:13:42 +00:00
|
|
|
|
)
|
2023-05-21 13:20:19 +00:00
|
|
|
|
val headers = getCrunchyrollToken()
|
2023-06-09 18:44:28 +00:00
|
|
|
|
val seasonIdData = app.get(
|
|
|
|
|
"$crunchyrollAPI/content/v2/cms/series/${id ?: return}/seasons",
|
|
|
|
|
headers = headers
|
|
|
|
|
)
|
2023-05-21 13:20:19 +00:00
|
|
|
|
.parsedSafe<CrunchyrollResponses>()?.data?.let { s ->
|
|
|
|
|
if (s.size == 1) {
|
|
|
|
|
s.firstOrNull()
|
|
|
|
|
} else {
|
|
|
|
|
s.find {
|
|
|
|
|
when (epsTitle) {
|
|
|
|
|
"One Piece" -> it.season_number == 13
|
|
|
|
|
"Hunter x Hunter" -> it.season_number == 5
|
|
|
|
|
else -> it.season_number == season
|
|
|
|
|
}
|
2023-05-22 21:45:08 +00:00
|
|
|
|
} ?: s.find { it.season_number?.plus(1) == season }
|
2023-05-21 13:20:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
val seasonId = seasonIdData?.versions?.filter { it.audio_locale in audioLocal }
|
2023-05-21 16:49:00 +00:00
|
|
|
|
?.map { it.guid to it.audio_locale } ?: listOf(seasonIdData?.id to "ja-JP")
|
2023-01-19 02:51:04 +00:00
|
|
|
|
|
2023-05-21 16:49:00 +00:00
|
|
|
|
seasonId.apmap { (sId, audioL) ->
|
2023-05-21 13:20:19 +00:00
|
|
|
|
val streamsLink =
|
2023-03-17 14:54:02 +00:00
|
|
|
|
app.get(
|
2023-05-21 13:20:19 +00:00
|
|
|
|
"$crunchyrollAPI/content/v2/cms/seasons/${sId ?: return@apmap}/episodes",
|
|
|
|
|
headers = headers
|
|
|
|
|
).parsedSafe<CrunchyrollResponses>()?.data?.find {
|
|
|
|
|
it.title.equals(epsTitle, true) || it.slug_title.equals(
|
|
|
|
|
epsTitle.createSlug(),
|
2023-01-19 02:51:04 +00:00
|
|
|
|
true
|
2023-05-21 13:20:19 +00:00
|
|
|
|
) || it.episode_number == episode
|
|
|
|
|
}?.streams_link
|
|
|
|
|
val sources =
|
|
|
|
|
app.get(fixUrl(streamsLink ?: return@apmap, crunchyrollAPI), headers = headers)
|
|
|
|
|
.parsedSafe<CrunchyrollSourcesResponses>()
|
|
|
|
|
|
|
|
|
|
listOf(
|
|
|
|
|
"adaptive_hls",
|
|
|
|
|
"vo_adaptive_hls"
|
|
|
|
|
).map { hls ->
|
|
|
|
|
val name = if (hls == "adaptive_hls") "Crunchyroll" else "Vrv"
|
|
|
|
|
val audio = if (audioL == "en-US") "English Dub" else "Raw"
|
|
|
|
|
val source = sources?.data?.firstOrNull()?.let {
|
|
|
|
|
if (hls == "adaptive_hls") it.adaptive_hls else it.vo_adaptive_hls
|
|
|
|
|
}
|
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"$name [$audio]",
|
|
|
|
|
source?.get("")?.get("url") ?: return@map,
|
|
|
|
|
"https://static.crunchyroll.com/"
|
|
|
|
|
).forEach(callback)
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}
|
2022-12-14 05:05:18 +00:00
|
|
|
|
|
2023-05-21 13:20:19 +00:00
|
|
|
|
sources?.meta?.subtitles?.map { sub ->
|
2022-12-23 12:02:01 +00:00
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
2023-05-21 13:20:19 +00:00
|
|
|
|
"${fixCrunchyrollLang(sub.key) ?: sub.key} [ass]",
|
|
|
|
|
sub.value["url"] ?: return@map null
|
2022-12-23 12:02:01 +00:00
|
|
|
|
)
|
2022-12-14 05:05:18 +00:00
|
|
|
|
)
|
2022-12-23 12:02:01 +00:00
|
|
|
|
}
|
2023-05-21 13:20:19 +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,
|
|
|
|
|
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
|
|
|
|
|
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val media = json?.find { it.first() == "${title.createSlug()}-$year" }
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
media?.filter { it.startsWith("https://drive.google.com") || it.startsWith("https://cdn.moviesbay.live") }
|
|
|
|
|
?.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 link = if (it.startsWith("https://drive.google.com")) {
|
|
|
|
|
getDirectGdrive(it)
|
|
|
|
|
} else {
|
|
|
|
|
it.removeSuffix("?a=view")
|
|
|
|
|
}
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Moviesbay",
|
|
|
|
|
"Moviesbay $qualityName [$size]",
|
|
|
|
|
link,
|
|
|
|
|
"",
|
|
|
|
|
getQualityFromName(quality)
|
|
|
|
|
)
|
2022-12-29 02:48:08 +00:00
|
|
|
|
)
|
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
}
|
2022-12-29 02:48:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeMoviezAdd(
|
2023-01-04 17:45:21 +00:00
|
|
|
|
apiUrl: String? = null,
|
|
|
|
|
api: String? = null,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
invokeBloginguru(apiUrl, api, title, year, season, episode, callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeBollyMaza(
|
|
|
|
|
apiUrl: String? = null,
|
|
|
|
|
api: String? = null,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
invokeBloginguru(apiUrl, api, title, year, season, episode, callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private suspend fun invokeBloginguru(
|
|
|
|
|
apiUrl: String? = null,
|
|
|
|
|
api: String? = null,
|
2022-12-29 02:48:08 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
2022-12-30 22:16:30 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2022-12-29 02:48:08 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val fixTitle = title?.createSlug()?.replace("-", " ")
|
2023-01-04 17:45:21 +00:00
|
|
|
|
val doc = app.get("$apiUrl/?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 {
|
2023-01-03 23:01:24 +00:00
|
|
|
|
if (season == null) {
|
2022-12-31 00:06:18 +00:00
|
|
|
|
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
|
|
|
|
|
} else {
|
|
|
|
|
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.second.contains(Regex("(?i)(Season\\s?$season)|(S0?$season)"))
|
|
|
|
|
}
|
2022-12-29 03:34:20 +00:00
|
|
|
|
}
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
2023-01-03 23:01:24 +00:00
|
|
|
|
val mediaLink =
|
|
|
|
|
app.get(matchMedia?.first ?: return).document.selectFirst("a#jake1")?.attr("href")
|
2022-12-30 22:16:30 +00:00
|
|
|
|
val detailDoc = app.get(mediaLink ?: return).document
|
|
|
|
|
val media = detailDoc.selectFirst("div.entry-content pre span")?.text()
|
|
|
|
|
?.split("|")
|
2022-12-29 02:48:08 +00:00
|
|
|
|
?.map { it.trim() }
|
|
|
|
|
|
2023-01-04 17:45:21 +00:00
|
|
|
|
val iframe = (if (season == null) {
|
2022-12-30 22:16:30 +00:00
|
|
|
|
media?.mapIndexed { index, name ->
|
|
|
|
|
detailDoc.select("div.entry-content > pre")[index.plus(1)].selectFirst("a")
|
|
|
|
|
?.attr("href") to name
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
media?.mapIndexed { index, name ->
|
|
|
|
|
val linkMedia =
|
|
|
|
|
detailDoc.select("div.entry-content > pre")[index.plus(1)].selectFirst("a")
|
|
|
|
|
?.attr("href")
|
|
|
|
|
app.get(
|
|
|
|
|
linkMedia ?: return@mapIndexed null
|
|
|
|
|
).document.selectFirst("div.entry-content strong:matches((?i)S0?${season}E0?${episode}) a")
|
|
|
|
|
?.attr("href") to name
|
|
|
|
|
}
|
2023-01-04 17:45:21 +00:00
|
|
|
|
})?.filter { it?.first?.startsWith("http") == true }
|
2022-12-30 22:16:30 +00:00
|
|
|
|
|
|
|
|
|
iframe?.apmap {
|
|
|
|
|
val token = app.get(
|
|
|
|
|
it?.first ?: return@apmap null
|
|
|
|
|
).document.select("input[name=_csrf_token_645a83a41868941e4692aa31e7235f2]")
|
|
|
|
|
.attr("value")
|
2022-12-29 02:48:08 +00:00
|
|
|
|
val shortLink = app.post(
|
2022-12-30 22:16:30 +00:00
|
|
|
|
it.first ?: return@apmap null,
|
2022-12-29 02:48:08 +00:00
|
|
|
|
data = mapOf("_csrf_token_645a83a41868941e4692aa31e7235f2" to token)
|
|
|
|
|
).document.selectFirst("a[rel=nofollow]")?.attr("href")
|
|
|
|
|
|
|
|
|
|
// val videoUrl = extractRebrandly(shortLink ?: return@apmapIndexed null )
|
2023-01-03 23:01:24 +00:00
|
|
|
|
val quality =
|
2023-01-29 12:29:42 +00:00
|
|
|
|
Regex("(\\d{3,4})p").find(it.second)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2022-12-30 22:16:30 +00:00
|
|
|
|
val qualityName = it.second.replace("${quality}p", "").trim()
|
2022-12-29 02:48:08 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"$api",
|
2023-01-04 17:45:21 +00:00
|
|
|
|
"$api $qualityName",
|
2022-12-30 22:16:30 +00:00
|
|
|
|
shortLink ?: return@apmap null,
|
2022-12-29 02:48:08 +00:00
|
|
|
|
"",
|
|
|
|
|
quality ?: Qualities.Unknown.value
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-04 18:04:11 +00:00
|
|
|
|
suspend fun invokeRStream(
|
|
|
|
|
id: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-01-11 01:28:46 +00:00
|
|
|
|
val url = if (season == null) {
|
2023-02-18 14:56:08 +00:00
|
|
|
|
"$rStreamAPI/e/?tmdb=$id"
|
2023-01-04 18:04:11 +00:00
|
|
|
|
} else {
|
2023-02-18 14:56:08 +00:00
|
|
|
|
"$rStreamAPI/e/?tmdb=$id&s=$season&e=$episode"
|
2023-01-04 18:04:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-18 14:56:08 +00:00
|
|
|
|
val res = app.get(url).text
|
|
|
|
|
val link = Regex("\"file\":\"(http.*?)\"").find(res)?.groupValues?.getOrNull(1) ?: return
|
|
|
|
|
|
|
|
|
|
delay(1000)
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (!app.get(link, referer = rStreamAPI).isSuccessful) return
|
2023-01-04 19:26:26 +00:00
|
|
|
|
|
2023-01-04 18:04:11 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"RStream",
|
|
|
|
|
"RStream",
|
2023-02-18 14:56:08 +00:00
|
|
|
|
link,
|
2023-02-18 18:29:16 +00:00
|
|
|
|
rStreamAPI,
|
2023-02-18 14:56:08 +00:00
|
|
|
|
Qualities.P720.value,
|
|
|
|
|
link.contains(".m3u8")
|
2023-01-04 18:04:11 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-11 01:28:46 +00:00
|
|
|
|
suspend fun invokeFlixon(
|
|
|
|
|
tmdbId: Int? = null,
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val onionUrl = "https://onionplay.se/"
|
|
|
|
|
val request = if (season == null) {
|
|
|
|
|
val res = app.get("$flixonAPI/$imdbId", referer = onionUrl)
|
|
|
|
|
if (res.text.contains("BEGIN PGP SIGNED MESSAGE")
|
|
|
|
|
) app.get("$flixonAPI/$imdbId-1", referer = onionUrl) else res
|
|
|
|
|
} else {
|
|
|
|
|
app.get("$flixonAPI/$tmdbId-$season-$episode", referer = onionUrl)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val script = request.document.selectFirst("script:containsData(= \"\";)")?.data()
|
|
|
|
|
val collection = script?.substringAfter("= [")?.substringBefore("];")
|
|
|
|
|
val num = script?.substringAfterLast("(value) -")?.substringBefore(");")?.trim()?.toInt()
|
|
|
|
|
?: return
|
|
|
|
|
|
|
|
|
|
val iframe = collection?.split(",")?.map { it.trim().toInt() }?.map { nums ->
|
|
|
|
|
nums.minus(num).toChar()
|
|
|
|
|
}?.joinToString("")?.let { Jsoup.parse(it) }?.selectFirst("button.redirect")
|
|
|
|
|
?.attr("onclick")
|
|
|
|
|
?.substringAfter("('")?.substringBefore("')")
|
|
|
|
|
|
2023-03-13 19:13:38 +00:00
|
|
|
|
delay(1000)
|
2023-01-11 01:28:46 +00:00
|
|
|
|
val unPacker =
|
2023-01-19 04:55:14 +00:00
|
|
|
|
app.get(
|
|
|
|
|
iframe ?: return,
|
2023-06-05 09:46:05 +00:00
|
|
|
|
referer = "$flixonAPI/"
|
2023-01-19 04:55:14 +00:00
|
|
|
|
).document.selectFirst("script:containsData(JuicyCodes.Run)")
|
2023-01-11 01:28:46 +00:00
|
|
|
|
?.data()
|
|
|
|
|
?.substringAfter("JuicyCodes.Run(")?.substringBefore(");")?.split("+")
|
|
|
|
|
?.joinToString("") { it.replace("\"", "").trim() }
|
|
|
|
|
?.let { getAndUnpack(base64Decode(it)) }
|
|
|
|
|
|
|
|
|
|
val link = Regex("[\"']file[\"']:[\"'](.+?)[\"'],").find(
|
|
|
|
|
unPacker ?: return
|
2023-01-11 07:35:13 +00:00
|
|
|
|
)?.groupValues?.getOrNull(1)
|
2023-01-11 01:28:46 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Flixon",
|
|
|
|
|
"Flixon",
|
|
|
|
|
link ?: return,
|
2023-06-05 09:46:05 +00:00
|
|
|
|
"https://onionplay.stream/",
|
2023-01-11 01:28:46 +00:00
|
|
|
|
Qualities.P720.value,
|
|
|
|
|
link.contains(".m3u8")
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-21 06:25:04 +00:00
|
|
|
|
suspend fun invokeSmashyStream(
|
2023-02-06 04:55:42 +00:00
|
|
|
|
imdbId: String? = null,
|
2023-01-21 06:25:04 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2023-05-24 22:18:47 +00:00
|
|
|
|
isAnime: Boolean = false,
|
2023-05-21 13:20:19 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
2023-01-21 06:25:04 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
2023-02-18 14:56:08 +00:00
|
|
|
|
"$smashyStreamAPI/playere.php?imdb=$imdbId"
|
2023-01-21 06:25:04 +00:00
|
|
|
|
} else {
|
2023-02-18 14:56:08 +00:00
|
|
|
|
"$smashyStreamAPI/playere.php?imdb=$imdbId&season=$season&episode=$episode"
|
2023-01-21 06:25:04 +00:00
|
|
|
|
}
|
2023-02-06 04:55:42 +00:00
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
app.get(
|
|
|
|
|
url,
|
|
|
|
|
referer = "https://smashystream.com/"
|
|
|
|
|
).document.select("div#_default-servers a.server").map {
|
2023-02-18 14:56:08 +00:00
|
|
|
|
it.attr("data-id") to it.text()
|
|
|
|
|
}.apmap {
|
|
|
|
|
when {
|
2023-07-28 21:02:24 +00:00
|
|
|
|
(it.second.equals("Player F", true) || it.second.equals("Player N", true)) && !isAnime -> {
|
2023-05-30 14:53:48 +00:00
|
|
|
|
invokeSmashyFfix(it.second, it.first, url, callback)
|
2023-02-18 14:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
it.first.contains("/gtop") -> {
|
2023-05-19 23:35:52 +00:00
|
|
|
|
invokeSmashyGtop(it.second, it.first, callback)
|
2023-02-18 14:56:08 +00:00
|
|
|
|
}
|
2023-04-17 10:01:08 +00:00
|
|
|
|
it.first.contains("/dude_tv") -> {
|
2023-05-19 23:35:52 +00:00
|
|
|
|
invokeSmashyDude(it.second, it.first, callback)
|
|
|
|
|
}
|
2023-05-21 13:20:19 +00:00
|
|
|
|
it.first.contains("/rip") -> {
|
|
|
|
|
invokeSmashyRip(it.second, it.first, subtitleCallback, callback)
|
|
|
|
|
}
|
2023-07-21 09:55:03 +00:00
|
|
|
|
it.first.contains("/im.php") && !isAnime -> {
|
|
|
|
|
invokeSmashyIm(it.second, it.first, subtitleCallback, callback)
|
|
|
|
|
}
|
2023-07-26 07:31:20 +00:00
|
|
|
|
it.first.contains("/rw.php") && !isAnime -> {
|
|
|
|
|
invokeSmashyRw(it.second, it.first, subtitleCallback, callback)
|
|
|
|
|
}
|
2023-02-18 14:56:08 +00:00
|
|
|
|
else -> return@apmap
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-02-06 04:55:42 +00:00
|
|
|
|
|
2023-01-21 06:25:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-29 03:29:15 +00:00
|
|
|
|
//TODO only subs
|
|
|
|
|
suspend fun invokeWatchsomuch(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val id = imdbId?.removePrefix("tt")
|
|
|
|
|
val epsId = app.post(
|
|
|
|
|
"$watchSomuchAPI/Watch/ajMovieTorrents.aspx",
|
|
|
|
|
data = mapOf(
|
|
|
|
|
"index" to "0",
|
|
|
|
|
"mid" to "$id",
|
|
|
|
|
"wsk" to "f6ea6cde-e42b-4c26-98d3-b4fe48cdd4fb",
|
|
|
|
|
"lid" to "",
|
|
|
|
|
"liu" to ""
|
|
|
|
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
|
|
|
|
).parsedSafe<WatchsomuchResponses>()?.movie?.torrents?.let { eps ->
|
|
|
|
|
if (season == null) {
|
|
|
|
|
eps.firstOrNull()?.id
|
|
|
|
|
} else {
|
|
|
|
|
eps.find { it.episode == episode && it.season == season }?.id
|
|
|
|
|
}
|
|
|
|
|
} ?: return
|
|
|
|
|
|
2023-02-19 05:30:23 +00:00
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
|
|
|
|
|
2023-01-29 03:29:15 +00:00
|
|
|
|
val subUrl = if (season == null) {
|
|
|
|
|
"$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part="
|
|
|
|
|
} else {
|
2023-02-19 05:30:23 +00:00
|
|
|
|
"$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part=S${seasonSlug}E${episodeSlug}"
|
2023-01-29 03:29:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.get(subUrl)
|
|
|
|
|
.parsedSafe<WatchsomuchSubResponses>()?.subtitles
|
|
|
|
|
?.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
sub.label ?: "",
|
2023-02-19 05:30:23 +00:00
|
|
|
|
fixUrl(sub.url ?: return@map null, watchSomuchAPI)
|
2023-01-29 03:29:15 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeBaymovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-02-10 08:36:06 +00:00
|
|
|
|
val api = "https://thebayindexpublicgroupapi.zindex.eu.org"
|
2023-01-29 03:29:15 +00:00
|
|
|
|
val key = base64DecodeAPI("ZW0=c3Q=c3k=b28=YWQ=Ymg=")
|
|
|
|
|
val headers = mapOf(
|
2023-02-10 08:36:06 +00:00
|
|
|
|
"Referer" to "$baymoviesAPI/",
|
|
|
|
|
"Origin" to baymoviesAPI,
|
2023-01-29 03:29:15 +00:00
|
|
|
|
"cf_cache_token" to "UKsVpQqBMxB56gBfhYKbfCVkRIXMh42pk6G4DdkXXoVh7j4BjV"
|
|
|
|
|
)
|
2023-01-30 03:42:55 +00:00
|
|
|
|
val query = getIndexQuery(title, year, season, episode)
|
2023-02-02 08:28:22 +00:00
|
|
|
|
val search = app.get(
|
2023-02-10 08:36:06 +00:00
|
|
|
|
"$api/0:search?q=$query&page_token=&page_index=0",
|
2023-02-02 08:28:22 +00:00
|
|
|
|
headers = headers
|
|
|
|
|
).text
|
2023-01-30 03:42:55 +00:00
|
|
|
|
val media = searchIndex(title, season, episode, year, search) ?: return
|
2023-01-29 03:29:15 +00:00
|
|
|
|
|
|
|
|
|
media.apmap { file ->
|
|
|
|
|
val expiry = (System.currentTimeMillis() + 345600000).toString()
|
|
|
|
|
val hmacSign = "${file.id}@$expiry".encode()
|
|
|
|
|
.hmacSha256(key.encode()).base64().replace("+", "-")
|
|
|
|
|
val encryptedId =
|
|
|
|
|
base64Encode(CryptoAES.encrypt(key, file.id ?: return@apmap null).toByteArray())
|
|
|
|
|
val encryptedExpiry = base64Encode(CryptoAES.encrypt(key, expiry).toByteArray())
|
|
|
|
|
val worker = getConfig().workers.randomOrNull() ?: return@apmap null
|
|
|
|
|
|
2023-02-02 08:28:22 +00:00
|
|
|
|
val link =
|
|
|
|
|
"https://api.$worker.workers.dev/download.aspx?file=$encryptedId&expiry=$encryptedExpiry&mac=$hmacSign"
|
2023-01-29 03:29:15 +00:00
|
|
|
|
val size = file.size?.toDouble() ?: return@apmap null
|
|
|
|
|
val sizeFile = "%.2f GB".format(bytesToGigaBytes(size))
|
|
|
|
|
val tags = Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4)").find(
|
|
|
|
|
file.name ?: return@apmap null
|
|
|
|
|
)?.groupValues?.getOrNull(1)?.replace(".", " ")?.trim()
|
|
|
|
|
?: ""
|
|
|
|
|
val quality =
|
|
|
|
|
Regex("(\\d{3,4})[pP]").find(file.name)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
2023-01-29 13:00:24 +00:00
|
|
|
|
?: Qualities.P1080.value
|
2023-01-29 03:29:15 +00:00
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"Baymovies",
|
2023-01-29 03:29:15 +00:00
|
|
|
|
"Baymovies $tags [$sizeFile]",
|
|
|
|
|
link,
|
2023-02-10 08:36:06 +00:00
|
|
|
|
"$baymoviesAPI/",
|
2023-01-29 03:29:15 +00:00
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-06 04:55:42 +00:00
|
|
|
|
suspend fun invokeBlackmovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-02-07 03:43:31 +00:00
|
|
|
|
invokeIndex(
|
2023-02-06 04:55:42 +00:00
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-07 03:07:14 +00:00
|
|
|
|
suspend fun invokeRinzrymovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-02-07 03:43:31 +00:00
|
|
|
|
invokeIndex(
|
2023-02-07 03:07:14 +00:00
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeCodexmovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
2023-02-10 08:36:06 +00:00
|
|
|
|
password: String = "",
|
2023-02-07 03:07:14 +00:00
|
|
|
|
) {
|
2023-02-07 03:43:31 +00:00
|
|
|
|
invokeIndex(
|
2023-02-07 03:07:14 +00:00
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
password,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-07 16:45:21 +00:00
|
|
|
|
suspend fun invokeEdithxmovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
2023-02-10 08:36:06 +00:00
|
|
|
|
password: String = "",
|
2023-02-07 16:45:21 +00:00
|
|
|
|
) {
|
|
|
|
|
invokeIndex(
|
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
password,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-19 19:57:29 +00:00
|
|
|
|
suspend fun invokeJmdkhMovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
invokeIndex(
|
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-21 09:02:45 +00:00
|
|
|
|
suspend fun invokeRubyMovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
invokeIndex(
|
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeShinobiMovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
invokeIndex(
|
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeVitoenMovies(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
invokeIndex(
|
|
|
|
|
apiUrl,
|
|
|
|
|
api,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
callback,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-10 08:36:06 +00:00
|
|
|
|
private suspend fun invokeIndex(
|
|
|
|
|
apiUrl: String,
|
|
|
|
|
api: String,
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
password: String = "",
|
|
|
|
|
) {
|
2023-02-07 03:07:14 +00:00
|
|
|
|
val passHeaders = mapOf(
|
|
|
|
|
"Authorization" to password
|
2023-02-06 04:55:42 +00:00
|
|
|
|
)
|
2023-02-07 16:45:21 +00:00
|
|
|
|
val query = getIndexQuery(title, year, season, episode).let {
|
2023-02-10 08:36:06 +00:00
|
|
|
|
if (api in mkvIndex) "$it mkv" else it
|
2023-02-07 16:45:21 +00:00
|
|
|
|
}
|
2023-01-30 03:42:55 +00:00
|
|
|
|
val body =
|
|
|
|
|
"""{"q":"$query","password":null,"page_token":null,"page_index":0}""".toRequestBody(
|
|
|
|
|
RequestBodyTypes.JSON.toMediaTypeOrNull()
|
|
|
|
|
)
|
2023-02-01 03:10:02 +00:00
|
|
|
|
val data = mapOf(
|
|
|
|
|
"q" to query,
|
|
|
|
|
"page_token" to "",
|
|
|
|
|
"page_index" to "0"
|
|
|
|
|
)
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val search = if (api in encodedIndex) {
|
2023-02-10 08:36:06 +00:00
|
|
|
|
decodeIndexJson(
|
|
|
|
|
if (api in lockedIndex) app.post(
|
2023-02-07 03:07:14 +00:00
|
|
|
|
"${apiUrl}search",
|
|
|
|
|
data = data,
|
2023-02-21 20:40:08 +00:00
|
|
|
|
headers = passHeaders,
|
|
|
|
|
referer = apiUrl
|
|
|
|
|
).text else app.post(
|
|
|
|
|
"${apiUrl}search",
|
|
|
|
|
data = data,
|
|
|
|
|
referer = apiUrl
|
|
|
|
|
).text
|
2023-02-10 08:36:06 +00:00
|
|
|
|
)
|
2023-02-01 03:10:02 +00:00
|
|
|
|
} else {
|
2023-03-17 14:54:02 +00:00
|
|
|
|
app.post("${apiUrl}search", requestBody = body, referer = apiUrl).text
|
2023-02-01 03:10:02 +00:00
|
|
|
|
}
|
2023-02-10 08:36:06 +00:00
|
|
|
|
val media = if (api in untrimmedIndex) searchIndex(
|
2023-02-08 14:55:54 +00:00
|
|
|
|
title,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
year,
|
|
|
|
|
search,
|
|
|
|
|
false
|
|
|
|
|
) else searchIndex(title, season, episode, year, search)
|
2023-02-07 16:45:21 +00:00
|
|
|
|
media?.apmap { file ->
|
2023-01-30 03:42:55 +00:00
|
|
|
|
val pathBody = """{"id":"${file.id ?: return@apmap null}"}""".toRequestBody(
|
|
|
|
|
RequestBodyTypes.JSON.toMediaTypeOrNull()
|
|
|
|
|
)
|
2023-02-01 03:10:02 +00:00
|
|
|
|
val pathData = mapOf(
|
|
|
|
|
"id" to file.id,
|
|
|
|
|
)
|
2023-02-06 04:55:42 +00:00
|
|
|
|
val path = (if (api in encodedIndex) {
|
2023-02-07 03:07:14 +00:00
|
|
|
|
if (api in lockedIndex) {
|
|
|
|
|
app.post(
|
|
|
|
|
"${apiUrl}id2path",
|
|
|
|
|
data = pathData,
|
2023-02-21 20:40:08 +00:00
|
|
|
|
headers = passHeaders,
|
|
|
|
|
referer = apiUrl
|
2023-02-07 03:07:14 +00:00
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
app.post(
|
2023-02-21 20:40:08 +00:00
|
|
|
|
"${apiUrl}id2path", data = pathData, referer = apiUrl
|
2023-02-07 03:07:14 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
2023-02-01 03:10:02 +00:00
|
|
|
|
} else {
|
2023-02-21 20:40:08 +00:00
|
|
|
|
app.post("${apiUrl}id2path", requestBody = pathBody, referer = apiUrl)
|
2023-02-07 03:07:14 +00:00
|
|
|
|
}).text.let { path ->
|
2023-03-31 05:48:57 +00:00
|
|
|
|
if (api in ddomainIndex) {
|
2023-02-07 03:07:14 +00:00
|
|
|
|
val worker = app.get(
|
2023-04-08 07:37:11 +00:00
|
|
|
|
"${fixUrl(path, apiUrl).encodeUrl()}?a=view",
|
2023-04-17 14:47:08 +00:00
|
|
|
|
referer = if (api in needRefererIndex) apiUrl else ""
|
2023-02-07 03:07:14 +00:00
|
|
|
|
).document.selectFirst("script:containsData(downloaddomain)")?.data()
|
|
|
|
|
?.substringAfter("\"downloaddomain\":\"")?.substringBefore("\",")?.let {
|
|
|
|
|
"$it/0:"
|
|
|
|
|
}
|
|
|
|
|
fixUrl(path, worker ?: return@apmap null)
|
|
|
|
|
} else {
|
|
|
|
|
fixUrl(path, apiUrl)
|
|
|
|
|
}
|
2023-01-30 03:42:55 +00:00
|
|
|
|
}.encodeUrl()
|
2023-02-07 03:07:14 +00:00
|
|
|
|
|
2023-02-07 16:45:21 +00:00
|
|
|
|
// removed due to rate limit
|
|
|
|
|
// if (!app.get(path).isSuccessful) return@apmap null
|
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val size =
|
|
|
|
|
"%.2f GB".format(bytesToGigaBytes(file.size?.toDouble() ?: return@apmap null))
|
2023-02-10 17:52:02 +00:00
|
|
|
|
val quality = getIndexQuality(file.name)
|
|
|
|
|
val tags = getIndexQualityTags(file.name)
|
2023-01-30 06:09:21 +00:00
|
|
|
|
|
2023-01-30 03:42:55 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
api,
|
2023-02-11 10:50:38 +00:00
|
|
|
|
"$api $tags [$size]",
|
2023-01-30 03:42:55 +00:00
|
|
|
|
path,
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (api in needRefererIndex) apiUrl else "",
|
2023-01-30 03:42:55 +00:00
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-19 14:49:44 +00:00
|
|
|
|
suspend fun invokeTgarMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val query = getIndexQuery(title, year, season, episode)
|
|
|
|
|
|
2023-02-19 16:31:07 +00:00
|
|
|
|
val files = app.get(
|
2023-03-01 15:11:57 +00:00
|
|
|
|
"https://api.tgarchive.superfastsearch.zindex.eu.org/search?name=${encode(query)}&page=1",
|
2023-02-19 16:31:07 +00:00
|
|
|
|
referer = tgarMovieAPI,
|
2023-02-21 17:52:12 +00:00
|
|
|
|
timeout = 600L
|
2023-03-01 15:11:57 +00:00
|
|
|
|
).parsedSafe<TgarData>()?.documents?.filter { media ->
|
2023-03-01 20:18:32 +00:00
|
|
|
|
matchingIndex(
|
|
|
|
|
media.name,
|
|
|
|
|
media.mime_type,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
2023-02-19 14:49:44 +00:00
|
|
|
|
true
|
2023-03-12 16:12:15 +00:00
|
|
|
|
) && media.name?.contains("XXX") == false
|
2023-02-19 14:49:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
files?.map { file ->
|
2023-03-01 20:18:32 +00:00
|
|
|
|
val size = "%.2f GB".format(bytesToGigaBytes(file.size ?: return@map null))
|
2023-02-19 14:49:44 +00:00
|
|
|
|
val quality = getIndexQuality(file.name)
|
|
|
|
|
val tags = getIndexQualityTags(file.name)
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"TgarMovies",
|
2023-02-19 14:49:44 +00:00
|
|
|
|
"TgarMovies $tags [$size]",
|
|
|
|
|
"https://api.southkoreacdn.workers.dev/telegram/${file._id}",
|
2023-02-19 16:31:07 +00:00
|
|
|
|
"$tgarMovieAPI/",
|
2023-02-19 14:49:44 +00:00
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-01 20:18:32 +00:00
|
|
|
|
suspend fun invokeGdbotMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-03-03 22:37:14 +00:00
|
|
|
|
val query = getIndexQuery(title, null, season, episode)
|
2023-03-01 20:18:32 +00:00
|
|
|
|
val files = app.get("$gdbot/search?q=$query").document.select("ul.divide-y li").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.select("a").attr("href"),
|
|
|
|
|
it.select("a").text(),
|
|
|
|
|
it.select("span").text()
|
|
|
|
|
)
|
|
|
|
|
}.filter {
|
|
|
|
|
matchingIndex(
|
|
|
|
|
it.second,
|
|
|
|
|
null,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
|
|
|
|
)
|
|
|
|
|
}.sortedByDescending {
|
|
|
|
|
it.third.getFileSize()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
files.let { file ->
|
|
|
|
|
listOfNotNull(
|
|
|
|
|
file.find { it.second.contains("2160p", true) },
|
|
|
|
|
file.find { it.second.contains("1080p", true) }
|
|
|
|
|
)
|
|
|
|
|
}.apmap { file ->
|
2023-03-13 16:03:09 +00:00
|
|
|
|
val videoUrl = extractGdflix(file.first)
|
2023-03-01 20:18:32 +00:00
|
|
|
|
val quality = getIndexQuality(file.second)
|
|
|
|
|
val tags = getIndexQualityTags(file.second)
|
|
|
|
|
val size = Regex("(\\d+\\.?\\d+\\sGB|MB)").find(file.third)?.groupValues?.get(0)?.trim()
|
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"GdbotMovies",
|
2023-03-01 20:18:32 +00:00
|
|
|
|
"GdbotMovies $tags [$size]",
|
|
|
|
|
videoUrl ?: return@apmap null,
|
|
|
|
|
"",
|
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-10 17:52:02 +00:00
|
|
|
|
suspend fun invokeDahmerMovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val url = if (season == null) {
|
2023-02-10 17:52:02 +00:00
|
|
|
|
"$dahmerMoviesAPI/movies/${title?.replace(":", "")} ($year)/"
|
|
|
|
|
} else {
|
|
|
|
|
"$dahmerMoviesAPI/tvs/${title?.replace(":", " -")}/Season $season/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val request = app.get(url)
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (!request.isSuccessful) return
|
2023-08-03 01:07:43 +00:00
|
|
|
|
val paths = request.document.select("a").map {
|
|
|
|
|
it.text() to it.attr("href")
|
2023-02-10 17:52:02 +00:00
|
|
|
|
}.filter {
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (season == null) {
|
2023-02-10 17:52:02 +00:00
|
|
|
|
it.first.contains(Regex("(?i)(1080p|2160p)"))
|
|
|
|
|
} else {
|
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
|
|
|
|
it.first.contains(Regex("(?i)S${seasonSlug}E${episodeSlug}"))
|
|
|
|
|
}
|
|
|
|
|
}.ifEmpty { return }
|
|
|
|
|
|
|
|
|
|
paths.map {
|
|
|
|
|
val quality = getIndexQuality(it.first)
|
|
|
|
|
val tags = getIndexQualityTags(it.first)
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
2023-03-05 15:58:53 +00:00
|
|
|
|
"DahmerMovies",
|
2023-08-03 01:07:43 +00:00
|
|
|
|
"DahmerMovies $tags",
|
2023-03-17 15:31:11 +00:00
|
|
|
|
(url + it.second).encodeUrl(),
|
2023-02-10 17:52:02 +00:00
|
|
|
|
"",
|
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-14 18:01:07 +00:00
|
|
|
|
suspend fun invokeGomovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-02-25 23:28:25 +00:00
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
2023-02-14 18:01:07 +00:00
|
|
|
|
val query = if (season == null) {
|
|
|
|
|
title
|
|
|
|
|
} else {
|
|
|
|
|
"$title Season $season"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val doc = app.get("$gomoviesAPI/search/$query").document
|
|
|
|
|
|
|
|
|
|
val media = doc.select("div._gory div.g_yFsxmKnYLvpKDTrdbizeYMWy").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.attr("data-filmName"),
|
|
|
|
|
it.attr("data-year"),
|
|
|
|
|
it.select("a").attr("href")
|
|
|
|
|
)
|
2023-02-20 09:35:06 +00:00
|
|
|
|
}.let { el ->
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (el.size == 1) {
|
2023-02-20 09:35:06 +00:00
|
|
|
|
el.firstOrNull()
|
2023-02-14 18:01:07 +00:00
|
|
|
|
} else {
|
2023-02-20 09:35:06 +00:00
|
|
|
|
el.find {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
(it.first.equals(title, true) || it.first.equals(
|
|
|
|
|
"$title ($year)",
|
|
|
|
|
true
|
|
|
|
|
)) && it.second.equals("$year")
|
|
|
|
|
} else {
|
|
|
|
|
it.first.equals("$title - Season $season", true)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-01 09:45:42 +00:00
|
|
|
|
} ?: el.find { it.first.contains("$title", true) && it.second.equals("$year") }
|
2023-02-14 18:01:07 +00:00
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val iframe = if (season == null) {
|
|
|
|
|
media.third
|
|
|
|
|
} else {
|
|
|
|
|
app.get(
|
|
|
|
|
fixUrl(
|
|
|
|
|
media.third,
|
|
|
|
|
gomoviesAPI
|
|
|
|
|
)
|
2023-04-08 11:41:07 +00:00
|
|
|
|
).document.selectFirst("div#g_MXOzFGouZrOAUioXjpddqkZK a:contains(Episode $episodeSlug)")
|
2023-02-14 18:01:07 +00:00
|
|
|
|
?.attr("href")
|
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val res = app.get(fixUrl(iframe, gomoviesAPI), verify = false)
|
|
|
|
|
val match = "var url = '(/user/servers/.*?\\?ep=.*?)';".toRegex().find(res.text)
|
|
|
|
|
val serverUrl = match?.groupValues?.get(1) ?: return
|
2023-02-19 11:46:38 +00:00
|
|
|
|
val cookies = res.okhttpResponse.headers.getGomoviesCookies()
|
2023-02-14 18:01:07 +00:00
|
|
|
|
val url = res.document.select("meta[property=og:url]").attr("content")
|
|
|
|
|
val headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
|
|
|
|
val qualities = intArrayOf(2160, 1440, 1080, 720, 480, 360)
|
|
|
|
|
app.get(
|
|
|
|
|
"$gomoviesAPI$serverUrl",
|
|
|
|
|
cookies = cookies, referer = url, headers = headers
|
|
|
|
|
).document.select("ul li").amap { el ->
|
|
|
|
|
val server = el.attr("data-value")
|
|
|
|
|
val encryptedData = app.get(
|
|
|
|
|
"$url?server=$server&_=${System.currentTimeMillis()}",
|
|
|
|
|
cookies = cookies,
|
|
|
|
|
referer = url,
|
|
|
|
|
headers = headers
|
|
|
|
|
).text
|
2023-02-19 11:46:38 +00:00
|
|
|
|
val json = base64Decode(encryptedData).decryptGomoviesJson()
|
2023-02-14 18:01:07 +00:00
|
|
|
|
val links = tryParseJson<List<GomoviesSources>>(json) ?: return@amap
|
|
|
|
|
links.forEach { video ->
|
|
|
|
|
qualities.filter { it <= video.max.toInt() }.forEach {
|
|
|
|
|
callback(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Gomovies",
|
|
|
|
|
"Gomovies",
|
|
|
|
|
video.src.split("360", limit = 3).joinToString(it.toString()),
|
|
|
|
|
"$gomoviesAPI/",
|
2023-03-10 22:22:24 +00:00
|
|
|
|
it,
|
2023-02-14 18:01:07 +00:00
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-10 22:22:24 +00:00
|
|
|
|
suspend fun invokeAsk4Movies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-03-11 00:52:21 +00:00
|
|
|
|
val query = if (season == null) {
|
|
|
|
|
title
|
2023-03-10 22:22:24 +00:00
|
|
|
|
} else {
|
2023-03-11 00:52:21 +00:00
|
|
|
|
"$title season $season"
|
2023-03-10 22:22:24 +00:00
|
|
|
|
}
|
2023-03-11 00:52:21 +00:00
|
|
|
|
val mediaData =
|
|
|
|
|
app.get("$ask4MoviesAPI/?s=$query").document.select("div#search-content div.item").map {
|
|
|
|
|
it.selectFirst("div.main-item a")
|
|
|
|
|
}
|
2023-03-10 22:22:24 +00:00
|
|
|
|
|
2023-03-11 00:52:21 +00:00
|
|
|
|
val media = if (mediaData.size == 1) {
|
|
|
|
|
mediaData.firstOrNull()
|
|
|
|
|
} else {
|
|
|
|
|
mediaData.find {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
it?.text().equals("$title ($year)", true)
|
|
|
|
|
} else {
|
|
|
|
|
it?.text().equals("$title (Season $season)", true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val epsDoc = app.get(media?.attr("href") ?: return).document
|
2023-03-10 22:22:24 +00:00
|
|
|
|
|
2023-03-11 00:52:21 +00:00
|
|
|
|
val iframe = if (season == null) {
|
|
|
|
|
epsDoc.select("div#player-embed iframe").attr("data-src")
|
2023-03-10 22:22:24 +00:00
|
|
|
|
} else {
|
2023-03-11 00:52:21 +00:00
|
|
|
|
epsDoc.select("ul.group-links-list li:nth-child($episode) a").attr("data-embed-src")
|
2023-03-10 22:22:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-24 14:25:57 +00:00
|
|
|
|
val iframeDoc = app.get(iframe, referer = "$ask4MoviesAPI/").text
|
|
|
|
|
val script = Regex("""eval\(function\(p,a,c,k,e,.*\)\)""").findAll(iframeDoc).lastOrNull()?.value
|
|
|
|
|
val unpacked = getAndUnpack(script ?: return)
|
|
|
|
|
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(unpacked)?.groupValues?.getOrNull(1)
|
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"Ask4movie",
|
|
|
|
|
m3u8 ?: return,
|
|
|
|
|
mainUrl
|
|
|
|
|
).forEach(callback)
|
2023-03-10 22:22:24 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-13 10:20:00 +00:00
|
|
|
|
suspend fun invokeWatchOnline(
|
|
|
|
|
imdbId: String? = null,
|
2023-03-13 21:23:30 +00:00
|
|
|
|
tmdbId: Int? = null,
|
2023-03-13 10:20:00 +00:00
|
|
|
|
title: String? = null,
|
2023-03-14 17:33:43 +00:00
|
|
|
|
year: Int? = null,
|
2023-03-13 10:20:00 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2023-03-13 19:13:38 +00:00
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
2023-03-13 10:20:00 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-03-14 17:33:43 +00:00
|
|
|
|
val id = imdbId?.removePrefix("tt")
|
|
|
|
|
val slug = title.createSlug()
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val url = if (season == null) {
|
2023-03-14 17:33:43 +00:00
|
|
|
|
"$watchOnlineAPI/movies/view/$id-$slug-$year"
|
2023-03-13 10:20:00 +00:00
|
|
|
|
} else {
|
2023-03-14 17:33:43 +00:00
|
|
|
|
"$watchOnlineAPI/shows/view/$id-$slug-$year"
|
2023-03-13 10:20:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-14 17:33:43 +00:00
|
|
|
|
var res = app.get(url)
|
2023-03-17 14:54:02 +00:00
|
|
|
|
if (res.code == 403) return
|
|
|
|
|
if (!res.isSuccessful) res = searchWatchOnline(title, season, imdbId, tmdbId) ?: return
|
2023-03-13 10:20:00 +00:00
|
|
|
|
|
2023-03-14 17:33:43 +00:00
|
|
|
|
val doc = res.document
|
2023-03-13 10:20:00 +00:00
|
|
|
|
val episodeId = if (season == null) {
|
2023-03-14 17:33:43 +00:00
|
|
|
|
doc.selectFirst("div.movie__buttons-items a")?.attr("data-watch-list-media-id")
|
2023-03-13 10:20:00 +00:00
|
|
|
|
} else {
|
2023-03-14 17:33:43 +00:00
|
|
|
|
doc.select("ul[data-season-episodes=$season] li").find {
|
2023-03-13 21:23:30 +00:00
|
|
|
|
it.select("div.episodes__number").text().equals("Episode $episode", true)
|
|
|
|
|
}?.attr("data-id-episode")
|
2023-03-13 10:20:00 +00:00
|
|
|
|
} ?: return
|
|
|
|
|
|
|
|
|
|
val videoUrl = if (season == null) {
|
|
|
|
|
"$watchOnlineAPI/api/v1/security/movie-access?id_movie=$episodeId"
|
|
|
|
|
} else {
|
|
|
|
|
"$watchOnlineAPI/api/v1/security/episode-access?id=$episodeId"
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val json = app.get(videoUrl, referer = url).parsedSafe<WatchOnlineResponse>()
|
2023-03-13 19:13:38 +00:00
|
|
|
|
|
|
|
|
|
json?.streams?.mapKeys { source ->
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"WatchOnline",
|
|
|
|
|
"WatchOnline",
|
|
|
|
|
source.value,
|
|
|
|
|
"$watchOnlineAPI/",
|
|
|
|
|
getQualityFromName(source.key),
|
|
|
|
|
true
|
2023-03-13 10:20:00 +00:00
|
|
|
|
)
|
2023-03-13 19:13:38 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-05 10:25:35 +00:00
|
|
|
|
argamap(
|
|
|
|
|
{
|
|
|
|
|
invokeMonster(
|
|
|
|
|
res.url.substringAfterLast("/"), episodeId, season, callback
|
2023-03-13 19:13:38 +00:00
|
|
|
|
)
|
2023-05-05 10:25:35 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
val subtitles = json?.subtitles as ArrayList<HashMap<String, String>>
|
|
|
|
|
subtitles.map { sub ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
sub["language"] ?: return@map,
|
|
|
|
|
fixUrl(sub["url"] ?: return@map, watchOnlineAPI)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-03-17 14:54:02 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-08 07:37:11 +00:00
|
|
|
|
private suspend fun invokeMonster(
|
2023-03-17 14:54:02 +00:00
|
|
|
|
urlSlug: String? = null,
|
|
|
|
|
episodeId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
2023-05-21 13:20:19 +00:00
|
|
|
|
val monsterMainUrl = "https://mobirs.monster"
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val playSlug = if (season == null) {
|
|
|
|
|
"movies/play/$urlSlug"
|
|
|
|
|
} else {
|
|
|
|
|
"shows/play/$urlSlug"
|
|
|
|
|
}
|
2023-04-11 04:55:00 +00:00
|
|
|
|
val sid = "9k9iupt5sebbnfajrc6ti3ht7l"
|
|
|
|
|
val sec = "1974bc4a902c4d69fcbab261dcec69094a9b8164"
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val url =
|
|
|
|
|
"$monsterMainUrl/$playSlug?mid=1&sid=$sid&sec=$sec&t=${System.currentTimeMillis()}"
|
2023-03-17 14:54:02 +00:00
|
|
|
|
val res = app.get(url).document
|
|
|
|
|
val script = res.selectFirst("script:containsData(window['show_storage'])")?.data()
|
|
|
|
|
val hash = Regex("hash:\\s*['\"](\\S+)['\"],").find(script ?: return)?.groupValues?.get(1)
|
2023-05-21 13:20:19 +00:00
|
|
|
|
val expires = Regex("expires:\\s*(\\d+),").find(script)?.groupValues?.get(1)
|
2023-03-17 14:54:02 +00:00
|
|
|
|
|
|
|
|
|
val videoUrl = if (season == null) {
|
2023-04-08 07:37:11 +00:00
|
|
|
|
"$monsterMainUrl/api/v1/security/movie-access?id_movie=$episodeId&hash=$hash&expires=$expires"
|
2023-03-17 14:54:02 +00:00
|
|
|
|
} else {
|
2023-04-08 07:37:11 +00:00
|
|
|
|
"$monsterMainUrl/api/v1/security/episode-access?id_episode=$episodeId&hash=$hash&expires=$expires"
|
2023-03-17 14:54:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.get(videoUrl, referer = url)
|
|
|
|
|
.parsedSafe<WatchOnlineResponse>()?.streams?.mapKeys { source ->
|
2023-04-17 14:47:08 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"WatchOnline",
|
|
|
|
|
"WatchOnline",
|
|
|
|
|
source.value,
|
|
|
|
|
"$monsterMainUrl/",
|
|
|
|
|
getQualityFromName(source.key),
|
|
|
|
|
true
|
|
|
|
|
)
|
2023-03-17 14:54:02 +00:00
|
|
|
|
)
|
2023-04-17 14:47:08 +00:00
|
|
|
|
}
|
2023-03-13 10:20:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-08 14:14:42 +00:00
|
|
|
|
suspend fun invokeNinetv(
|
|
|
|
|
tmdbId: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$nineTvAPI/movie/$tmdbId"
|
|
|
|
|
} else {
|
|
|
|
|
"$nineTvAPI/tv/$tmdbId-$season-$episode"
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-28 11:11:42 +00:00
|
|
|
|
val iframe = app.get(url, referer = "https://pressplay.top/").document.selectFirst("iframe")?.attr("src") ?: return
|
2023-04-08 14:14:42 +00:00
|
|
|
|
loadExtractor(iframe, "$nineTvAPI/", subtitleCallback, callback)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-11 17:00:54 +00:00
|
|
|
|
suspend fun invokePutlocker(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val query = if (season == null) {
|
|
|
|
|
title
|
|
|
|
|
} else {
|
|
|
|
|
"$title - season $season"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val res = app.get("$putlockerAPI/movie/search/$query").document
|
|
|
|
|
val scripData = res.select("div.movies-list div.ml-item").map {
|
|
|
|
|
it.selectFirst("h2")?.text() to it.selectFirst("a")?.attr("href")
|
|
|
|
|
}
|
|
|
|
|
val script = if (scripData.size == 1) {
|
|
|
|
|
scripData.first()
|
|
|
|
|
} else {
|
|
|
|
|
scripData.find {
|
|
|
|
|
if (season == null) {
|
|
|
|
|
it.first.equals(title, true) || (it.first?.contains(
|
|
|
|
|
"$title", true
|
|
|
|
|
) == true && it.first?.contains("$year") == true)
|
|
|
|
|
} else {
|
|
|
|
|
it.first?.contains("$title", true) == true && it.first?.contains(
|
|
|
|
|
"Season $season", true
|
|
|
|
|
) == true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val id = fixUrl(script?.second ?: return).split("-").lastOrNull()?.removeSuffix("/")
|
|
|
|
|
val iframe = app.get("$putlockerAPI/ajax/movie_episodes/$id")
|
|
|
|
|
.parsedSafe<PutlockerEpisodes>()?.html?.let { Jsoup.parse(it) }?.let { server ->
|
|
|
|
|
if (season == null) {
|
|
|
|
|
server.select("div.les-content a").map {
|
|
|
|
|
it.attr("data-id") to it.attr("data-server")
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
server.select("div.les-content a").map { it }
|
|
|
|
|
.filter { it.text().contains("Episode $episode", true) }.map {
|
|
|
|
|
it.attr("data-id") to it.attr("data-server")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iframe?.apmap {
|
|
|
|
|
delay(3000)
|
|
|
|
|
val embedUrl = app.get("$putlockerAPI/ajax/movie_embed/${it.first}")
|
|
|
|
|
.parsedSafe<PutlockerEmbed>()?.src ?: return@apmap null
|
|
|
|
|
val sources = extractPutlockerSources(embedUrl)?.parsedSafe<PutlockerResponses>()
|
|
|
|
|
|
|
|
|
|
argamap(
|
|
|
|
|
{
|
|
|
|
|
sources?.callback(embedUrl, "Server ${it.second}", callback)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
if (!sources?.backupLink.isNullOrBlank()) {
|
|
|
|
|
extractPutlockerSources(sources?.backupLink)?.parsedSafe<PutlockerResponses>()
|
|
|
|
|
?.callback(
|
|
|
|
|
embedUrl, "Backup ${it.second}", callback
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
return@argamap
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-14 08:34:27 +00:00
|
|
|
|
suspend fun invokeShivamhw(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val url = if (season == null) {
|
2023-04-14 08:34:27 +00:00
|
|
|
|
"$shivamhwAPI/search?search_box=$title&release_year=$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$shivamhwAPI/api/series_search?search_box=$title&sess_nm=$seasonSlug&epi_nm=$episodeSlug"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val res = app.get(url)
|
|
|
|
|
|
2023-05-05 10:25:35 +00:00
|
|
|
|
val media = if (season == null) {
|
2023-04-19 09:52:31 +00:00
|
|
|
|
res.document.select("table.rwd-table tr").map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.select("td[data-th=File Name]").text(),
|
|
|
|
|
it.select("td[data-th=Size]").text(),
|
2023-06-04 23:34:14 +00:00
|
|
|
|
it.selectFirst("div.download_button.pls_wait > a")?.attr("href")
|
2023-04-14 08:34:27 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2023-04-19 09:52:31 +00:00
|
|
|
|
tryParseJson<ArrayList<ShivamhwSources>>(res.text)?.map {
|
|
|
|
|
Triple(
|
|
|
|
|
it.name,
|
|
|
|
|
it.size,
|
2023-06-04 23:34:14 +00:00
|
|
|
|
it.stream_link,
|
2023-04-14 08:34:27 +00:00
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-19 09:52:31 +00:00
|
|
|
|
|
|
|
|
|
media?.filter {
|
|
|
|
|
matchingIndex(
|
|
|
|
|
it.first,
|
|
|
|
|
null,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
2023-04-29 19:48:50 +00:00
|
|
|
|
false
|
2023-04-19 09:52:31 +00:00
|
|
|
|
)
|
|
|
|
|
}?.sortedByDescending {
|
|
|
|
|
it.second.getFileSize()
|
2023-04-29 19:03:31 +00:00
|
|
|
|
}?.apmap { source ->
|
2023-04-19 09:52:31 +00:00
|
|
|
|
val quality = getIndexQuality(source.first)
|
|
|
|
|
val tags = getIndexQualityTags(source.first)
|
2023-06-04 23:34:14 +00:00
|
|
|
|
val video = source.third
|
|
|
|
|
if (!app.get(
|
|
|
|
|
video ?: return@apmap,
|
|
|
|
|
referer = "$shivamhwAPI/"
|
|
|
|
|
).isSuccessful
|
|
|
|
|
) return@apmap
|
2023-04-19 09:52:31 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Shivamhw",
|
|
|
|
|
"Shivamhw $tags [${source.second}]",
|
2023-06-04 23:34:14 +00:00
|
|
|
|
video,
|
|
|
|
|
"$shivamhwAPI/",
|
2023-04-19 09:52:31 +00:00
|
|
|
|
quality,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
2023-04-15 14:53:51 +00:00
|
|
|
|
}
|
2023-04-14 08:34:27 +00:00
|
|
|
|
|
2023-04-15 14:53:51 +00:00
|
|
|
|
suspend fun invokeCryMovies(
|
|
|
|
|
imdbId: String? = null,
|
2023-04-20 07:22:52 +00:00
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2023-04-15 14:53:51 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
2023-04-22 07:30:47 +00:00
|
|
|
|
app.get("${cryMoviesAPI}/stream/movie/$imdbId.json")
|
2023-04-20 07:22:52 +00:00
|
|
|
|
.parsedSafe<CryMoviesResponse>()?.streams?.filter {
|
|
|
|
|
matchingIndex(
|
|
|
|
|
it.title,
|
|
|
|
|
null,
|
|
|
|
|
title,
|
|
|
|
|
year,
|
|
|
|
|
season,
|
|
|
|
|
episode,
|
2023-06-22 01:26:45 +00:00
|
|
|
|
false
|
2023-04-20 07:22:52 +00:00
|
|
|
|
)
|
2023-06-22 01:26:45 +00:00
|
|
|
|
}?.apmap { stream ->
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val quality = getIndexQuality(stream.title)
|
2023-04-20 07:22:52 +00:00
|
|
|
|
val tags = getIndexQualityTags(stream.title)
|
2023-04-19 09:52:31 +00:00
|
|
|
|
val size = getIndexSize(stream.title)
|
2023-04-17 14:47:08 +00:00
|
|
|
|
val headers = stream.behaviorHints?.proxyHeaders?.request ?: mapOf()
|
2023-04-14 08:34:27 +00:00
|
|
|
|
|
2023-06-22 01:26:45 +00:00
|
|
|
|
if(!app.get(stream.url ?: return@apmap, headers = headers).isSuccessful) return@apmap
|
|
|
|
|
|
2023-04-17 14:47:08 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"CryMovies",
|
|
|
|
|
"CryMovies $tags [${size}]",
|
2023-06-22 01:26:45 +00:00
|
|
|
|
stream.url,
|
2023-04-17 14:47:08 +00:00
|
|
|
|
"",
|
|
|
|
|
quality,
|
|
|
|
|
headers = headers
|
|
|
|
|
)
|
2023-04-15 14:53:51 +00:00
|
|
|
|
)
|
2023-04-17 14:47:08 +00:00
|
|
|
|
}
|
2023-04-14 08:34:27 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 23:35:52 +00:00
|
|
|
|
suspend fun invokeNowTv(
|
|
|
|
|
tmdbId: Int? = null,
|
2023-06-22 01:26:45 +00:00
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
2023-05-19 23:35:52 +00:00
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val referer = "https://2now.tv/"
|
2023-06-22 01:26:45 +00:00
|
|
|
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
|
|
|
|
val url = if(season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${episodeSlug}.mp4"
|
2023-06-09 18:44:28 +00:00
|
|
|
|
if (!app.get(url, referer = referer).isSuccessful) return
|
2023-05-19 23:35:52 +00:00
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"NowTv",
|
|
|
|
|
"NowTv",
|
|
|
|
|
url,
|
|
|
|
|
referer,
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-22 10:05:28 +00:00
|
|
|
|
suspend fun invokeRidomovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val iframe =
|
|
|
|
|
app.get("$ridomoviesAPI/movies/${title.createSlug()}-watch-online-$year").document.selectFirst(
|
|
|
|
|
"div.player-div iframe"
|
|
|
|
|
)?.attr("data-src")
|
|
|
|
|
val unpacked = getAndUnpack(app.get(iframe ?: return, referer = "$ridomoviesAPI/").text)
|
|
|
|
|
val video = Regex("=\"(aHR.*?)\";").find(unpacked)?.groupValues?.get(1)
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"Ridomovies",
|
|
|
|
|
"Ridomovies",
|
|
|
|
|
base64Decode(video ?: return),
|
|
|
|
|
"${getBaseUrl(iframe)}/",
|
|
|
|
|
Qualities.P1080.value,
|
|
|
|
|
isM3u8 = true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-24 04:32:21 +00:00
|
|
|
|
suspend fun invokeNavy(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
2023-07-28 21:41:04 +00:00
|
|
|
|
) {
|
|
|
|
|
invokeHindi(navyAPI, navyAPI, imdbId, season, episode, callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
suspend fun invokeMoment(
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
invokeHindi(momentAPI, "https://hdmovies4u.green", imdbId, season, episode, callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private suspend fun invokeHindi(
|
|
|
|
|
host: String? = null,
|
|
|
|
|
referer: String? = null,
|
|
|
|
|
imdbId: String? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
2023-06-24 04:32:21 +00:00
|
|
|
|
) {
|
|
|
|
|
val res = app.get(
|
2023-07-28 21:41:04 +00:00
|
|
|
|
"$host/play/$imdbId",
|
|
|
|
|
referer = "$referer/"
|
2023-06-24 04:32:21 +00:00
|
|
|
|
).document.selectFirst("script:containsData(player =)")?.data()?.substringAfter("{")
|
|
|
|
|
?.substringBefore(";")?.substringBefore(")")
|
|
|
|
|
val json = tryParseJson<NavyPlaylist>("{${res ?: return}")
|
|
|
|
|
val headers = mapOf(
|
|
|
|
|
"X-CSRF-TOKEN" to "${json?.key}"
|
|
|
|
|
)
|
2023-07-28 21:41:04 +00:00
|
|
|
|
|
2023-06-24 04:32:21 +00:00
|
|
|
|
val serverRes = app.get(
|
2023-07-28 21:41:04 +00:00
|
|
|
|
fixUrl(json?.file ?: return, navyAPI), headers = headers, referer = "$referer/"
|
2023-06-24 04:32:21 +00:00
|
|
|
|
).text.replace(Regex(""",\s*\[]"""), "")
|
|
|
|
|
val server = tryParseJson<ArrayList<NavyServer>>(serverRes).let { server ->
|
|
|
|
|
if (season == null) {
|
|
|
|
|
server?.find { it.title == "English" }?.file
|
|
|
|
|
} else {
|
|
|
|
|
server?.find { it.id.equals("$season") }?.folder?.find { it.episode.equals("$episode") }?.folder?.find {
|
|
|
|
|
it.title.equals(
|
|
|
|
|
"English"
|
|
|
|
|
)
|
|
|
|
|
}?.file
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val path = app.post(
|
2023-07-28 21:41:04 +00:00
|
|
|
|
"${host}/playlist/${server ?: return}.txt",
|
2023-06-24 04:32:21 +00:00
|
|
|
|
headers = headers,
|
2023-07-28 21:41:04 +00:00
|
|
|
|
referer = "$referer/"
|
2023-06-24 04:32:21 +00:00
|
|
|
|
).text
|
|
|
|
|
|
|
|
|
|
M3u8Helper.generateM3u8(
|
2023-07-28 21:41:04 +00:00
|
|
|
|
if(host == navyAPI) "Navy" else "Moment",
|
2023-06-24 04:32:21 +00:00
|
|
|
|
path,
|
2023-07-28 21:41:04 +00:00
|
|
|
|
"${referer}/"
|
2023-06-24 04:32:21 +00:00
|
|
|
|
).forEach(callback)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-04 09:38:14 +00:00
|
|
|
|
suspend fun invokeEmovies(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
|
callback: (ExtractorLink) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
val slug = title.createSlug()
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$emoviesAPI/watch-$slug-$year-1080p-hd-online-free/watching.html"
|
|
|
|
|
} else {
|
|
|
|
|
val first = "$emoviesAPI/watch-$slug-season-$season-$year-1080p-hd-online-free.html"
|
|
|
|
|
val second = "$emoviesAPI/watch-$slug-$year-1080p-hd-online-free.html"
|
|
|
|
|
if (app.get(first).isSuccessful) first else second
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val res = app.get(url).document
|
|
|
|
|
val id = (if (season == null) {
|
|
|
|
|
res.selectFirst("select#selectServer option[sv=oserver]")?.attr("value")
|
|
|
|
|
} else {
|
|
|
|
|
res.select("div.le-server a").find {
|
|
|
|
|
val num =
|
|
|
|
|
Regex("Episode (\\d+)").find(it.text())?.groupValues?.get(1)?.toIntOrNull()
|
|
|
|
|
num == episode
|
|
|
|
|
}?.attr("href")
|
|
|
|
|
})?.substringAfter("id=")?.substringBefore("&")
|
|
|
|
|
|
|
|
|
|
val server =
|
|
|
|
|
app.get(
|
|
|
|
|
"$emoviesAPI/ajax/v4_get_sources?s=oserver&id=${id ?: return}&_=${APIHolder.unixTimeMS}",
|
|
|
|
|
headers = mapOf(
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest"
|
|
|
|
|
)
|
|
|
|
|
).parsedSafe<EMovieServer>()?.value
|
|
|
|
|
|
|
|
|
|
val script = app.get(server ?: return, referer = "$emoviesAPI/").document.selectFirst("script:containsData(sources:)")?.data() ?: return
|
|
|
|
|
val sources = Regex("sources:\\s*\\[(.*)],").find(script)?.groupValues?.get(1)?.let {
|
|
|
|
|
tryParseJson<List<EMovieSources>>("[$it]")
|
|
|
|
|
}
|
|
|
|
|
val tracks = Regex("tracks:\\s*\\[(.*)],").find(script)?.groupValues?.get(1)?.let {
|
|
|
|
|
tryParseJson<List<EMovieTraks>>("[$it]")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sources?.map { source ->
|
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
|
"Emovies",
|
|
|
|
|
source.file ?: return@map,
|
|
|
|
|
"https://embed.vodstream.xyz/"
|
|
|
|
|
).forEach(callback)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tracks?.map { track ->
|
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
|
SubtitleFile(
|
|
|
|
|
track.label ?: "",
|
|
|
|
|
track.file ?: return@map,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-07 07:32:57 +00:00
|
|
|
|
suspend fun invokeFourCartoon(
|
|
|
|
|
title: String? = null,
|
|
|
|
|
year: Int? = null,
|
|
|
|
|
season: Int? = null,
|
|
|
|
|
episode: Int? = null,
|
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
val fixTitle = title.createSlug()
|
|
|
|
|
val headers = mapOf(
|
|
|
|
|
"X-Requested-With" to "XMLHttpRequest"
|
|
|
|
|
)
|
|
|
|
|
val url = if (season == null) {
|
|
|
|
|
"$fourCartoonAPI/movies/$fixTitle-$year"
|
|
|
|
|
} else {
|
|
|
|
|
"$fourCartoonAPI/episode/$fixTitle-season-$season-episode-$episode"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val document = app.get(url).document
|
|
|
|
|
val id = document.selectFirst("input[name=idpost]")?.attr("value")
|
|
|
|
|
val server = app.get(
|
|
|
|
|
"$fourCartoonAPI/ajax-get-link-stream/?server=streamango&filmId=${id ?: return}",
|
|
|
|
|
headers = headers
|
|
|
|
|
).text
|
|
|
|
|
val hash =
|
|
|
|
|
getAndUnpack(app.get(server, referer = fourCartoonAPI).text).substringAfter("(\"")
|
|
|
|
|
.substringBefore("\",")
|
|
|
|
|
val iframeUrl = getBaseUrl(server)
|
|
|
|
|
val source = app.post(
|
|
|
|
|
"$iframeUrl/player/index.php?data=$hash&do=getVideo", data = mapOf(
|
|
|
|
|
"hast" to hash,
|
|
|
|
|
"r" to "$fourCartoonAPI/",
|
|
|
|
|
),
|
|
|
|
|
headers = headers
|
|
|
|
|
).parsedSafe<FourCartoonSources>()?.videoSource
|
|
|
|
|
|
|
|
|
|
callback.invoke(
|
|
|
|
|
ExtractorLink(
|
|
|
|
|
"4Cartoon",
|
|
|
|
|
"4Cartoon",
|
|
|
|
|
source ?: return,
|
|
|
|
|
"$iframeUrl/",
|
|
|
|
|
Qualities.P720.value,
|
|
|
|
|
true,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-14 18:01:07 +00:00
|
|
|
|
|
2022-12-09 08:44:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-26 07:31:20 +00:00
|
|
|
|
class Animefever : Filesim() {
|
|
|
|
|
override val name = "Animefever"
|
|
|
|
|
override var mainUrl = "https://animefever.fun"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Multimovies : Filesim() {
|
|
|
|
|
override val name = "Multimovies"
|
|
|
|
|
override var mainUrl = "https://multimovies.cloud"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MultimoviesSB : StreamSB() {
|
|
|
|
|
override var name = "Multimovies"
|
|
|
|
|
override var mainUrl = "https://multimovies.website"
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-31 04:30:48 +00:00
|
|
|
|
class Yipsu : Voe() {
|
|
|
|
|
override val name = "Yipsu"
|
|
|
|
|
override var mainUrl = "https://yip.su"
|
|
|
|
|
}
|
|
|
|
|
|