diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index be879fef..e6136602 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 24 +version = 25 cloudstream { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 59cb06e8..e396d60e 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -302,7 +302,7 @@ object SoraExtractor : SoraStream() { loadExtractor(url, databaseGdriveAPI, subtitleCallback, callback) } - suspend fun invokeSoraVIP( +/* suspend fun invokeSoraVIP( title: String? = null, orgTitle: String? = null, year: Int? = null, @@ -350,7 +350,7 @@ object SoraExtractor : SoraStream() { ) } } - + */ suspend fun invokeGogo( aniId: String? = null, animeId: String? = null, @@ -756,6 +756,91 @@ object SoraExtractor : SoraStream() { } } + suspend fun invokeSoraVIP( + title: String? = null, + year: Int? = null, + season: Int? = null, + episode: Int? = null, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val headers = mapOf( + "lang" to "en", + "versioncode" to "11", + "clienttype" to "ios_jike_default" + ) + val vipAPI = base64DecodeAPI("cA==YXA=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=") + val vipUrl = base64DecodeAPI("b20=LmM=b2s=a2w=bG8=Ly8=czo=dHA=aHQ=") + + val doc = app.get( + "$vipUrl/search?keyword=$title", + ).document + + val scriptData = doc.select("div.search-list div.search-video-card").map { + Triple( + it.selectFirst("h2.title")?.text().toString(), + it.selectFirst("div.desc")?.text() + ?.substringBefore(".")?.toIntOrNull(), + it.selectFirst("a")?.attr("href")?.split("/") + ) + } + + val script = if (scriptData.size == 1) { + scriptData.first() + } else { + scriptData.first { + if (season == null) { + it.first.equals( + title, + true + ) && it.second == year + } else { + it.first.contains( + "$title", + true + ) && (it.second == year || it.first.contains("Season $season", true)) + } + } + } + + val id = script.third?.last() + val type = script.third?.get(2) + + val json = app.get( + "$vipAPI/movieDrama/get?id=${id}&category=${type}", + headers = headers + ).parsedSafe()?.data?.episodeVo?.first { it.seriesNo == (episode ?: 0) } + + json?.definitionList?.apmap { video -> + app.get( + "${vipAPI}/media/previewInfo?category=${type}&contentId=${id}&episodeId=${json.id}&definition=${video.code}", + headers = headers + ).parsedSafe