mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: fix UHD
This commit is contained in:
parent
860fbe2eac
commit
d6777e5ea3
7 changed files with 404 additions and 62 deletions
25
Minioppai/build.gradle.kts
Normal file
25
Minioppai/build.gradle.kts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
// use an integer for version numbers
|
||||||
|
version = 1
|
||||||
|
|
||||||
|
|
||||||
|
cloudstream {
|
||||||
|
language = "id"
|
||||||
|
// All of these properties are optional, you can safely remove them
|
||||||
|
|
||||||
|
// description = "Lorem Ipsum"
|
||||||
|
authors = listOf("Sora")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status int as the following:
|
||||||
|
* 0: Down
|
||||||
|
* 1: Ok
|
||||||
|
* 2: Slow
|
||||||
|
* 3: Beta only
|
||||||
|
* */
|
||||||
|
status = 1 // will be 3 if unspecified
|
||||||
|
tvTypes = listOf(
|
||||||
|
"NSFW",
|
||||||
|
)
|
||||||
|
|
||||||
|
iconUrl = "https://www.google.com/s2/favicons?domain=minioppai.org&sz=%size%"
|
||||||
|
}
|
2
Minioppai/src/main/AndroidManifest.xml
Normal file
2
Minioppai/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="com.hexated"/>
|
237
Minioppai/src/main/kotlin/com/hexated/Minioppai.kt
Normal file
237
Minioppai/src/main/kotlin/com/hexated/Minioppai.kt
Normal file
|
@ -0,0 +1,237 @@
|
||||||
|
package com.hexated
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||||
|
import org.jsoup.Jsoup
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import java.net.URLDecoder
|
||||||
|
|
||||||
|
class Minioppai : MainAPI() {
|
||||||
|
override var mainUrl = "https://minioppai.org"
|
||||||
|
override var name = "Minioppai"
|
||||||
|
override val hasMainPage = true
|
||||||
|
override var lang = "id"
|
||||||
|
override val hasDownloadSupport = true
|
||||||
|
override val hasQuickSearch = true
|
||||||
|
|
||||||
|
override val supportedTypes = setOf(
|
||||||
|
TvType.NSFW,
|
||||||
|
)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val libPaistream = "https://lb.paistream.my.id"
|
||||||
|
const val paistream = "https://paistream.my.id"
|
||||||
|
|
||||||
|
fun getType(t: String): TvType {
|
||||||
|
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
|
||||||
|
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||||
|
else TvType.Anime
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getStatus(t: String?): ShowStatus {
|
||||||
|
return when (t) {
|
||||||
|
"Completed" -> ShowStatus.Completed
|
||||||
|
"Ongoing" -> ShowStatus.Ongoing
|
||||||
|
else -> ShowStatus.Completed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override val mainPage = mainPageOf(
|
||||||
|
"$mainUrl/watch" to "New Episode",
|
||||||
|
"$mainUrl/popular" to "Popular Hentai",
|
||||||
|
)
|
||||||
|
|
||||||
|
override suspend fun getMainPage(
|
||||||
|
page: Int,
|
||||||
|
request: MainPageRequest
|
||||||
|
): HomePageResponse {
|
||||||
|
val document = app.get("${request.data}/page/$page").document
|
||||||
|
val home = document.select("div.latest a").mapNotNull {
|
||||||
|
it.toSearchResult()
|
||||||
|
}
|
||||||
|
return newHomePageResponse(
|
||||||
|
list = HomePageList(
|
||||||
|
name = request.name,
|
||||||
|
list = home,
|
||||||
|
isHorizontalImages = request.name == "New Episode"
|
||||||
|
),
|
||||||
|
hasNext = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getProperAnimeLink(uri: String): String {
|
||||||
|
return if (uri.contains("-episode-")) {
|
||||||
|
uri.substringBefore("-episode-")
|
||||||
|
} else {
|
||||||
|
uri
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Element.toSearchResult(): AnimeSearchResponse? {
|
||||||
|
val title = this.selectFirst("h2.entry-title")?.text()?.trim() ?: return null
|
||||||
|
val href = getProperAnimeLink(this.attr("href"))
|
||||||
|
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
|
||||||
|
val epNum = this.selectFirst("i.dot")?.text()?.filter { it.isDigit() }?.toIntOrNull()
|
||||||
|
return newAnimeSearchResponse(title, href, TvType.NSFW) {
|
||||||
|
this.posterUrl = posterUrl
|
||||||
|
addSub(epNum)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun quickSearch(query: String): List<SearchResponse>? = search(query)
|
||||||
|
|
||||||
|
override suspend fun search(query: String): List<SearchResponse>? {
|
||||||
|
return app.post(
|
||||||
|
"$mainUrl/wp-admin/admin-ajax.php", data = mapOf(
|
||||||
|
"action" to "ts_ac_do_search",
|
||||||
|
"ts_ac_query" to query,
|
||||||
|
), headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
||||||
|
).parsedSafe<SearchResponses>()?.post?.firstOrNull()?.all?.mapNotNull { item ->
|
||||||
|
newAnimeSearchResponse(
|
||||||
|
item.postTitle ?: "",
|
||||||
|
item.postLink ?: return@mapNotNull null,
|
||||||
|
TvType.NSFW
|
||||||
|
) {
|
||||||
|
this.posterUrl = item.postImage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun load(url: String): LoadResponse? {
|
||||||
|
val document = app.get(url).document
|
||||||
|
|
||||||
|
val title = document.selectFirst("h1.entry-title")?.text()?.trim() ?: return null
|
||||||
|
val poster = fixUrlNull(document.selectFirst("div.limage img")?.attr("src"))
|
||||||
|
val table = document.select("ul.data")
|
||||||
|
val tags = table.select("ul.data li:nth-child(1) a").map { it.text() }
|
||||||
|
val year =
|
||||||
|
document.selectFirst("ul.data time[itemprop=dateCreated]")?.text()?.substringBefore("-")
|
||||||
|
?.toIntOrNull()
|
||||||
|
val status = getStatus(document.selectFirst("ul.data li:nth-child(2) span")?.text()?.trim())
|
||||||
|
val description = document.select("div[itemprop=description] > p").text()
|
||||||
|
|
||||||
|
val episodes = document.select("div.epsdlist ul li").mapNotNull {
|
||||||
|
val name = it.selectFirst("div.epl-num")?.text()
|
||||||
|
val link = fixUrlNull(it.selectFirst("a")?.attr("href")) ?: return@mapNotNull null
|
||||||
|
Episode(link, name = name)
|
||||||
|
}.reversed()
|
||||||
|
|
||||||
|
return newAnimeLoadResponse(title, url, TvType.NSFW) {
|
||||||
|
engName = title
|
||||||
|
posterUrl = poster
|
||||||
|
this.year = year
|
||||||
|
addEpisodes(DubStatus.Subbed, episodes)
|
||||||
|
showStatus = status
|
||||||
|
plot = description
|
||||||
|
this.tags = tags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun loadLinks(
|
||||||
|
data: String,
|
||||||
|
isCasting: Boolean,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
): Boolean {
|
||||||
|
|
||||||
|
val document = app.get(data).document
|
||||||
|
document.select("div.server ul.mirror li a").mapNotNull {
|
||||||
|
fixUrl(
|
||||||
|
Jsoup.parse(base64Decode(it.attr("data-em"))).select("iframe").attr("src")
|
||||||
|
) to it.text()
|
||||||
|
}.apmap { (link, server) ->
|
||||||
|
if (link.startsWith(paistream)) {
|
||||||
|
invokeLocal(link, server, subtitleCallback, callback)
|
||||||
|
} else {
|
||||||
|
loadExtractor(fixUrl(decode(link.substringAfter("data="))), mainUrl, subtitleCallback, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun invokeLocal(
|
||||||
|
url: String,
|
||||||
|
server: String,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
) {
|
||||||
|
val script = getAndUnpack(app.get(url).text)
|
||||||
|
val sources = script.substringAfter("sources:[").substringBefore("]").replace("'", "\"")
|
||||||
|
val subtitles = script.substringAfter("\"tracks\":[").substringBefore("]")
|
||||||
|
|
||||||
|
tryParseJson<List<Sources>>("[$sources]")?.map {
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
server,
|
||||||
|
server,
|
||||||
|
fixLink(it.file ?: return@map, if(server == "Stream 1") libPaistream else paistream),
|
||||||
|
"$paistream/",
|
||||||
|
getQualityFromName(it.label)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
tryParseJson<List<Subtitles>>("[$subtitles]")?.map {
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
it.label ?: "",
|
||||||
|
fixLink(it.file ?: return@map, paistream)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun decode(input: String): String = URLDecoder.decode(input, "utf-8")
|
||||||
|
|
||||||
|
private fun fixLink(url: String, domain: String): String {
|
||||||
|
if (url.startsWith("http")) {
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
if (url.isEmpty()) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
val startsWithNoHttp = url.startsWith("//")
|
||||||
|
if (startsWithNoHttp) {
|
||||||
|
return "https:$url"
|
||||||
|
} else {
|
||||||
|
if (url.startsWith('/')) {
|
||||||
|
return domain + url
|
||||||
|
}
|
||||||
|
return "$domain/$url"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class Subtitles(
|
||||||
|
@JsonProperty("file") var file: String? = null,
|
||||||
|
@JsonProperty("label") var label: String? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Sources(
|
||||||
|
@JsonProperty("label") var label: String? = null,
|
||||||
|
@JsonProperty("file") var file: String? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class SearchResponses(
|
||||||
|
@JsonProperty("post") var post: ArrayList<Post> = arrayListOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
data class All(
|
||||||
|
@JsonProperty("ID") var ID: Int? = null,
|
||||||
|
@JsonProperty("post_image") var postImage: String? = null,
|
||||||
|
@JsonProperty("post_title") var postTitle: String? = null,
|
||||||
|
@JsonProperty("post_link") var postLink: String? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Post(
|
||||||
|
@JsonProperty("all") var all: ArrayList<All> = arrayListOf(),
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
13
Minioppai/src/main/kotlin/com/hexated/MinioppaiPlugin.kt
Normal file
13
Minioppai/src/main/kotlin/com/hexated/MinioppaiPlugin.kt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package com.hexated
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||||
|
import com.lagradost.cloudstream3.plugins.Plugin
|
||||||
|
import android.content.Context
|
||||||
|
|
||||||
|
@CloudstreamPlugin
|
||||||
|
class MinioppaiPlugin: Plugin() {
|
||||||
|
override fun load(context: Context) {
|
||||||
|
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||||
|
registerMainAPI(Minioppai())
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
import org.jetbrains.kotlin.konan.properties.Properties
|
import org.jetbrains.kotlin.konan.properties.Properties
|
||||||
|
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 136
|
version = 137
|
||||||
|
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
|
@ -518,7 +518,8 @@ object SoraExtractor : SoraStream() {
|
||||||
|
|
||||||
val cookiesDoc = mapOf(
|
val cookiesDoc = mapOf(
|
||||||
"G_ENABLED_IDPS" to "google",
|
"G_ENABLED_IDPS" to "google",
|
||||||
"wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to (filmxyCookies.wLog ?: return),
|
"wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to (filmxyCookies.wLog
|
||||||
|
?: return),
|
||||||
"PHPSESSID" to (filmxyCookies.phpsessid ?: return)
|
"PHPSESSID" to (filmxyCookies.phpsessid ?: return)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -761,7 +762,13 @@ object SoraExtractor : SoraStream() {
|
||||||
?.attr("data-id")
|
?.attr("data-id")
|
||||||
|
|
||||||
val servers =
|
val servers =
|
||||||
app.get("$fmoviesAPI/ajax/server/list/${episodeId ?: return}?vrf=${comsumetEncodeVrf(episodeId)}")
|
app.get(
|
||||||
|
"$fmoviesAPI/ajax/server/list/${episodeId ?: return}?vrf=${
|
||||||
|
comsumetEncodeVrf(
|
||||||
|
episodeId
|
||||||
|
)
|
||||||
|
}"
|
||||||
|
)
|
||||||
.parsedSafe<FmoviesResult>()?.result?.let { Jsoup.parse(it) }
|
.parsedSafe<FmoviesResult>()?.result?.let { Jsoup.parse(it) }
|
||||||
?.select("ul li")?.map { it.attr("data-id") to it.attr("data-link-id") }
|
?.select("ul li")?.map { it.attr("data-id") to it.attr("data-link-id") }
|
||||||
|
|
||||||
|
@ -769,7 +776,8 @@ object SoraExtractor : SoraStream() {
|
||||||
it.first == "41" || it.first == "45"
|
it.first == "41" || it.first == "45"
|
||||||
}?.apmap { (serverid, linkId) ->
|
}?.apmap { (serverid, linkId) ->
|
||||||
delay(2000)
|
delay(2000)
|
||||||
val decryptServer = app.get("$fmoviesAPI/ajax/server/$linkId?vrf=${comsumetEncodeVrf(linkId)}")
|
val decryptServer =
|
||||||
|
app.get("$fmoviesAPI/ajax/server/$linkId?vrf=${comsumetEncodeVrf(linkId)}")
|
||||||
.parsedSafe<FmoviesResponses>()?.result?.url?.let { comsumetDecodeVrf(it) }
|
.parsedSafe<FmoviesResponses>()?.result?.url?.let { comsumetDecodeVrf(it) }
|
||||||
if (serverid == "41") {
|
if (serverid == "41") {
|
||||||
invokeVizcloud(serverid, decryptServer ?: return@apmap, subtitleCallback, callback)
|
invokeVizcloud(serverid, decryptServer ?: return@apmap, subtitleCallback, callback)
|
||||||
|
@ -868,7 +876,12 @@ object SoraExtractor : SoraStream() {
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val (aniId, malId) = convertTmdbToAnimeId(title, date, airedDate, if(season == null) TvType.AnimeMovie else TvType.Anime)
|
val (aniId, malId) = convertTmdbToAnimeId(
|
||||||
|
title,
|
||||||
|
date,
|
||||||
|
airedDate,
|
||||||
|
if (season == null) TvType.AnimeMovie else TvType.Anime
|
||||||
|
)
|
||||||
|
|
||||||
argamap(
|
argamap(
|
||||||
{
|
{
|
||||||
|
@ -881,7 +894,15 @@ object SoraExtractor : SoraStream() {
|
||||||
invokeBiliBili(aniId, episode, subtitleCallback, callback)
|
invokeBiliBili(aniId, episode, subtitleCallback, callback)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
if (season != null) invokeCrunchyroll(aniId, malId, epsTitle, season, episode, subtitleCallback, callback)
|
if (season != null) invokeCrunchyroll(
|
||||||
|
aniId,
|
||||||
|
malId,
|
||||||
|
epsTitle,
|
||||||
|
season,
|
||||||
|
episode,
|
||||||
|
subtitleCallback,
|
||||||
|
callback
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -892,18 +913,27 @@ object SoraExtractor : SoraStream() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val res = app.get("$biliBiliAPI/anime/episodes?id=${aniId ?: return}&source_id=bilibili", referer = kaguyaBaseUrl)
|
val res = app.get(
|
||||||
|
"$biliBiliAPI/anime/episodes?id=${aniId ?: return}&source_id=bilibili",
|
||||||
|
referer = kaguyaBaseUrl
|
||||||
|
)
|
||||||
.parsedSafe<BiliBiliDetails>()?.episodes?.find {
|
.parsedSafe<BiliBiliDetails>()?.episodes?.find {
|
||||||
it.episodeNumber == episode
|
it.episodeNumber == episode
|
||||||
} ?: return
|
} ?: return
|
||||||
|
|
||||||
val sources =
|
val sources =
|
||||||
app.get("$biliBiliAPI/source?episode_id=${res.sourceEpisodeId}&source_media_id=${res.sourceMediaId}&source_id=${res.sourceId}", referer = kaguyaBaseUrl)
|
app.get(
|
||||||
|
"$biliBiliAPI/source?episode_id=${res.sourceEpisodeId}&source_media_id=${res.sourceMediaId}&source_id=${res.sourceId}",
|
||||||
|
referer = kaguyaBaseUrl
|
||||||
|
)
|
||||||
.parsedSafe<BiliBiliSourcesResponse>()
|
.parsedSafe<BiliBiliSourcesResponse>()
|
||||||
|
|
||||||
sources?.sources?.apmap { source ->
|
sources?.sources?.apmap { source ->
|
||||||
val quality =
|
val quality =
|
||||||
app.get(source.file ?: return@apmap null, referer = kaguyaBaseUrl).document.selectFirst("Representation")
|
app.get(
|
||||||
|
source.file ?: return@apmap null,
|
||||||
|
referer = kaguyaBaseUrl
|
||||||
|
).document.selectFirst("Representation")
|
||||||
?.attr("height")
|
?.attr("height")
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
|
@ -946,7 +976,8 @@ object SoraExtractor : SoraStream() {
|
||||||
}?.select("div.ss-list a")?.find { it.attr("data-number") == "${episode ?: 1}" }
|
}?.select("div.ss-list a")?.find { it.attr("data-number") == "${episode ?: 1}" }
|
||||||
?.attr("data-id")
|
?.attr("data-id")
|
||||||
|
|
||||||
val servers = app.get("$zoroAPI/ajax/v2/episode/servers?episodeId=${episodeId ?: return@apmap}")
|
val servers =
|
||||||
|
app.get("$zoroAPI/ajax/v2/episode/servers?episodeId=${episodeId ?: return@apmap}")
|
||||||
.parsedSafe<ZoroResponses>()?.html?.let { Jsoup.parse(it) }
|
.parsedSafe<ZoroResponses>()?.html?.let { Jsoup.parse(it) }
|
||||||
?.select("div.item.server-item")?.map {
|
?.select("div.item.server-item")?.map {
|
||||||
Triple(
|
Triple(
|
||||||
|
@ -957,7 +988,8 @@ object SoraExtractor : SoraStream() {
|
||||||
}
|
}
|
||||||
|
|
||||||
servers?.apmap servers@{ server ->
|
servers?.apmap servers@{ server ->
|
||||||
val iframe = app.get("$zoroAPI/ajax/v2/episode/sources?id=${server.second ?: return@servers}")
|
val iframe =
|
||||||
|
app.get("$zoroAPI/ajax/v2/episode/sources?id=${server.second ?: return@servers}")
|
||||||
.parsedSafe<ZoroResponses>()?.link ?: return@servers
|
.parsedSafe<ZoroResponses>()?.link ?: return@servers
|
||||||
val audio = if (server.third == "sub") "Raw" else "English Dub"
|
val audio = if (server.third == "sub") "Raw" else "English Dub"
|
||||||
if (server.first == "Vidstreaming" || server.first == "Vidcloud") {
|
if (server.first == "Vidstreaming" || server.first == "Vidcloud") {
|
||||||
|
@ -1503,14 +1535,18 @@ object SoraExtractor : SoraStream() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val id = getCrunchyrollId("${aniId ?: return}") ?: getCrunchyrollIdFromMalSync("${malId ?: return}") ?: return
|
val id = getCrunchyrollId("${aniId ?: return}")
|
||||||
|
?: getCrunchyrollIdFromMalSync("${malId ?: return}") ?: return
|
||||||
val audioLocal = listOf(
|
val audioLocal = listOf(
|
||||||
"ja-JP",
|
"ja-JP",
|
||||||
"en-US",
|
"en-US",
|
||||||
"zh-CN",
|
"zh-CN",
|
||||||
)
|
)
|
||||||
val headers = getCrunchyrollToken()
|
val headers = getCrunchyrollToken()
|
||||||
val seasonIdData = app.get("$crunchyrollAPI/content/v2/cms/series/${id ?: return}/seasons", headers = headers)
|
val seasonIdData = app.get(
|
||||||
|
"$crunchyrollAPI/content/v2/cms/series/${id ?: return}/seasons",
|
||||||
|
headers = headers
|
||||||
|
)
|
||||||
.parsedSafe<CrunchyrollResponses>()?.data?.let { s ->
|
.parsedSafe<CrunchyrollResponses>()?.data?.let { s ->
|
||||||
if (s.size == 1) {
|
if (s.size == 1) {
|
||||||
s.firstOrNull()
|
s.firstOrNull()
|
||||||
|
@ -1897,7 +1933,7 @@ object SoraExtractor : SoraStream() {
|
||||||
invokeSmashyDude(it.second, it.first, callback)
|
invokeSmashyDude(it.second, it.first, callback)
|
||||||
}
|
}
|
||||||
it.first.contains("/nflim") -> {
|
it.first.contains("/nflim") -> {
|
||||||
invokeSmashyNflim(it.second, it.first, callback)
|
invokeSmashyNflim(it.second, it.first, subtitleCallback, callback)
|
||||||
}
|
}
|
||||||
it.first.contains("/rip") -> {
|
it.first.contains("/rip") -> {
|
||||||
invokeSmashyRip(it.second, it.first, subtitleCallback, callback)
|
invokeSmashyRip(it.second, it.first, subtitleCallback, callback)
|
||||||
|
@ -2875,7 +2911,8 @@ object SoraExtractor : SoraStream() {
|
||||||
episode: Int? = null,
|
episode: Int? = null,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val apiUrl = base64DecodeAPI("dWI=Y2w=cC4=bXU=ZWE=LWI=Ynk=YmE=bS4=ZWE=dHI=ZXM=aW4=LWM=NDA=MDg=NjE=YmQ=Y2I=MmU=Ly8=czo=dHA=aHQ=")
|
val apiUrl =
|
||||||
|
base64DecodeAPI("dWI=Y2w=cC4=bXU=ZWE=LWI=Ynk=YmE=bS4=ZWE=dHI=ZXM=aW4=LWM=NDA=MDg=NjE=YmQ=Y2I=MmU=Ly8=czo=dHA=aHQ=")
|
||||||
val url = if (season == null) {
|
val url = if (season == null) {
|
||||||
"$apiUrl/stream/movie/$imdbId.json"
|
"$apiUrl/stream/movie/$imdbId.json"
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -435,7 +435,8 @@ suspend fun invokeSmashyFfix(
|
||||||
callback: (ExtractorLink) -> Unit,
|
callback: (ExtractorLink) -> Unit,
|
||||||
) {
|
) {
|
||||||
val script =
|
val script =
|
||||||
app.get(url, referer = ref).document.selectFirst("script:containsData(player =)")?.data() ?: return
|
app.get(url, referer = ref).document.selectFirst("script:containsData(player =)")?.data()
|
||||||
|
?: return
|
||||||
|
|
||||||
val source =
|
val source =
|
||||||
Regex("file:\\s['\"](\\S+?)['|\"]").find(script)?.groupValues?.get(
|
Regex("file:\\s['\"](\\S+?)['|\"]").find(script)?.groupValues?.get(
|
||||||
|
@ -516,31 +517,39 @@ suspend fun invokeSmashyDude(
|
||||||
suspend fun invokeSmashyNflim(
|
suspend fun invokeSmashyNflim(
|
||||||
name: String,
|
name: String,
|
||||||
url: String,
|
url: String,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit,
|
callback: (ExtractorLink) -> Unit,
|
||||||
) {
|
) {
|
||||||
val script =
|
val script =
|
||||||
app.get(url).document.selectFirst("script:containsData(player =)")?.data() ?: return
|
app.get(url).document.selectFirst("script:containsData(player =)")?.data() ?: return
|
||||||
|
|
||||||
val source =
|
val sources = Regex("file:\\s*\"([^\"]+)").find(script)?.groupValues?.get(1) ?: return
|
||||||
Regex("file:\\s*\"([^\"]+)").find(script)?.groupValues?.get(
|
val subtitles = Regex("subtitle:\\s*\"([^\"]+)").find(script)?.groupValues?.get(1) ?: return
|
||||||
1
|
|
||||||
) ?: return
|
|
||||||
|
|
||||||
source.split(",").map { links ->
|
sources.split(",").map { links ->
|
||||||
val quality = Regex("\\[(\\d+)]").find(links)?.groupValues?.getOrNull(1)?.trim()
|
val quality = Regex("\\[(\\d+)]").find(links)?.groupValues?.getOrNull(1)?.trim()
|
||||||
val trimmedLink = links.removePrefix("[$quality]").trim()
|
val trimmedLink = links.removePrefix("[$quality]").trim()
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
"Smashy [$name]",
|
"Smashy [$name]",
|
||||||
"Smashy [$name]",
|
"Smashy [$name]",
|
||||||
trimmedLink.substringAfter("url=").substringBefore("&cookie=").trim(),
|
trimmedLink,
|
||||||
"",
|
"",
|
||||||
quality?.toIntOrNull() ?: return@map,
|
quality?.toIntOrNull() ?: return@map,
|
||||||
isM3u8 = true,
|
isM3u8 = true,
|
||||||
headers = mapOf(
|
|
||||||
"Cookie" to trimmedLink.substringAfter("&cookie=").trim()
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
subtitles.split(",").map { sub ->
|
||||||
|
val lang = Regex("\\[(.*?)]").find(sub)?.groupValues?.getOrNull(1)?.trim()
|
||||||
|
val trimmedSubLink = sub.removePrefix("[$lang]").trim()
|
||||||
|
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
lang ?: return@map,
|
||||||
|
trimmedSubLink
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,7 +752,9 @@ suspend fun bypassHrefli(url: String): String? {
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun bypassTechmny(url: String): String? {
|
suspend fun bypassTechmny(url: String): String? {
|
||||||
|
val techRes = app.get(url).document
|
||||||
val postUrl = url.substringBefore("?id=").substringAfter("/?")
|
val postUrl = url.substringBefore("?id=").substringAfter("/?")
|
||||||
|
val (goUrl, goHeader) = if (techRes.selectFirst("form#landing input[name=_wp_http_c]") != null) {
|
||||||
var res = app.post(
|
var res = app.post(
|
||||||
postUrl, data = mapOf(
|
postUrl, data = mapOf(
|
||||||
"_wp_http_c" to url.substringAfter("?id=")
|
"_wp_http_c" to url.substringAfter("?id=")
|
||||||
|
@ -752,7 +763,6 @@ suspend fun bypassTechmny(url: String): String? {
|
||||||
val (longC, catC, _) = getTechmnyCookies(res.text)
|
val (longC, catC, _) = getTechmnyCookies(res.text)
|
||||||
var headers = mapOf("Cookie" to "$longC; $catC")
|
var headers = mapOf("Cookie" to "$longC; $catC")
|
||||||
var formLink = res.document.selectFirst("center a")?.attr("href")
|
var formLink = res.document.selectFirst("center a")?.attr("href")
|
||||||
|
|
||||||
res = app.get(formLink ?: return null, headers = headers)
|
res = app.get(formLink ?: return null, headers = headers)
|
||||||
val (longC2, _, postC) = getTechmnyCookies(res.text)
|
val (longC2, _, postC) = getTechmnyCookies(res.text)
|
||||||
headers = mapOf("Cookie" to "$catC; $longC2; $postC")
|
headers = mapOf("Cookie" to "$catC; $longC2; $postC")
|
||||||
|
@ -763,9 +773,17 @@ suspend fun bypassTechmny(url: String): String? {
|
||||||
val tokenUrl = "$postUrl?go=$goToken"
|
val tokenUrl = "$postUrl?go=$goToken"
|
||||||
val newLongC = "$goToken=" + longC2.substringAfter("=")
|
val newLongC = "$goToken=" + longC2.substringAfter("=")
|
||||||
headers = mapOf("Cookie" to "$catC; rdst_post=; $newLongC")
|
headers = mapOf("Cookie" to "$catC; rdst_post=; $newLongC")
|
||||||
|
Pair(tokenUrl, headers)
|
||||||
|
} else {
|
||||||
|
val secondPage = techRes.getNextTechPage().document
|
||||||
|
val thirdPage = secondPage.getNextTechPage().text
|
||||||
|
val goToken = thirdPage.substringAfter("?go=").substringBefore("\"")
|
||||||
|
val tokenUrl = "$postUrl?go=$goToken"
|
||||||
|
val headers = mapOf("Cookie" to "$goToken=${secondPage.select("form#landing input[name=_wp_http2]").attr("value")}")
|
||||||
|
Pair(tokenUrl, headers)
|
||||||
|
}
|
||||||
val driveUrl =
|
val driveUrl =
|
||||||
app.get(tokenUrl, headers = headers).document.selectFirst("meta[http-equiv=refresh]")
|
app.get(goUrl, headers = goHeader).document.selectFirst("meta[http-equiv=refresh]")
|
||||||
?.attr("content")?.substringAfter("url=")
|
?.attr("content")?.substringAfter("url=")
|
||||||
val path = app.get(driveUrl ?: return null).text.substringAfter("replace(\"")
|
val path = app.get(driveUrl ?: return null).text.substringAfter("replace(\"")
|
||||||
.substringBefore("\")")
|
.substringBefore("\")")
|
||||||
|
@ -773,6 +791,15 @@ suspend fun bypassTechmny(url: String): String? {
|
||||||
return fixUrl(path, getBaseUrl(driveUrl))
|
return fixUrl(path, getBaseUrl(driveUrl))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun Document.getNextTechPage(): NiceResponse {
|
||||||
|
return app.post(
|
||||||
|
this.select("form").attr("action"),
|
||||||
|
data = this.select("form input").mapNotNull {
|
||||||
|
it.attr("name") to it.attr("value")
|
||||||
|
}.toMap().toMutableMap()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun bypassDriveleech(url: String): String? {
|
suspend fun bypassDriveleech(url: String): String? {
|
||||||
val path = app.get(url).text.substringAfter("replace(\"")
|
val path = app.get(url).text.substringAfter("replace(\"")
|
||||||
.substringBefore("\")")
|
.substringBefore("\")")
|
||||||
|
@ -990,7 +1017,8 @@ suspend fun getCrunchyrollIdFromMalSync(aniId: String?): String? {
|
||||||
val vrv = res?.get("Vrv")?.map { it.value }?.firstOrNull()?.get("url")
|
val vrv = res?.get("Vrv")?.map { it.value }?.firstOrNull()?.get("url")
|
||||||
val crunchyroll = res?.get("Vrv")?.map { it.value }?.firstOrNull()?.get("url")
|
val crunchyroll = res?.get("Vrv")?.map { it.value }?.firstOrNull()?.get("url")
|
||||||
val regex = Regex("series/(\\w+)/?")
|
val regex = Regex("series/(\\w+)/?")
|
||||||
return regex.find("$vrv")?.groupValues?.getOrNull(1) ?: regex.find("$crunchyroll")?.groupValues?.getOrNull(1)
|
return regex.find("$vrv")?.groupValues?.getOrNull(1)
|
||||||
|
?: regex.find("$crunchyroll")?.groupValues?.getOrNull(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun extractPutlockerSources(url: String?): NiceResponse? {
|
suspend fun extractPutlockerSources(url: String?): NiceResponse? {
|
||||||
|
|
Loading…
Reference in a new issue