sora: added navy

This commit is contained in:
hexated 2023-06-24 11:32:21 +07:00
parent 13c9debd62
commit 3a89c83ae7
4 changed files with 82 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers
version = 139
version = 140
android {
defaultConfig {

View file

@ -2993,6 +2993,50 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeNavy(
imdbId: String? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val res = app.get(
"$navyAPI/play/$imdbId",
referer = "$navyAPI/"
).document.selectFirst("script:containsData(player =)")?.data()?.substringAfter("{")
?.substringBefore(";")?.substringBefore(")")
val json = tryParseJson<NavyPlaylist>("{${res ?: return}")
val headers = mapOf(
"X-CSRF-TOKEN" to "${json?.key}"
)
val serverRes = app.get(
fixUrl(json?.file ?: return, navyAPI), headers = headers, referer = "$navyAPI/"
).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(
"${navyAPI}/playlist/${server ?: return}.txt",
headers = headers,
referer = "$navyAPI/"
).text
M3u8Helper.generateM3u8(
"Navy",
path,
"${navyAPI}/"
).forEach(callback)
}
}
@ -3449,3 +3493,28 @@ data class GokuData(
data class GokuServer(
@JsonProperty("data") val data: GokuData? = GokuData(),
)
data class NavyEpisodeFolder(
@JsonProperty("title") val title: String? = null,
@JsonProperty("id") val id: String? = null,
@JsonProperty("file") val file: String? = null,
)
data class NavySeasonFolder(
@JsonProperty("episode") val episode: String? = null,
@JsonProperty("id") val id: String? = null,
@JsonProperty("folder") val folder: ArrayList<NavyEpisodeFolder>? = arrayListOf(),
)
data class NavyServer(
@JsonProperty("title") val title: String? = null,
@JsonProperty("id") val id: String? = null,
@JsonProperty("file") val file: String? = null,
@JsonProperty("folder") val folder: ArrayList<NavySeasonFolder>? = arrayListOf(),
)
data class NavyPlaylist(
@JsonProperty("file") val file: String? = null,
@JsonProperty("key") val key: String? = null,
@JsonProperty("href") val href: String? = null,
)

View file

@ -38,6 +38,7 @@ import com.hexated.SoraExtractor.invokeM4uhd
import com.hexated.SoraExtractor.invokeMovie123Net
import com.hexated.SoraExtractor.invokeMoviesbay
import com.hexated.SoraExtractor.invokeMoviezAdd
import com.hexated.SoraExtractor.invokeNavy
import com.hexated.SoraExtractor.invokeNinetv
import com.hexated.SoraExtractor.invokeNowTv
import com.hexated.SoraExtractor.invokePutlocker
@ -126,6 +127,7 @@ open class SoraStream : TmdbProvider() {
const val nowTvAPI = "https://myfilestorage.xyz"
const val gokuAPI = "https://goku.sx"
const val ridomoviesAPI = "https://ridomovies.pw"
const val navyAPI = "https://navy-issue-i-239.site"
// INDEX SITE
const val blackMoviesAPI = "https://dl.blacklistedbois.workers.dev/0:"
@ -794,11 +796,14 @@ open class SoraStream : TmdbProvider() {
)
},
{
if (!res.isAnime && res.season == null) invokeNowTv(res.id, res.season, res.episode, callback)
if (!res.isAnime) invokeNowTv(res.id, res.season, res.episode, callback)
},
{
if (res.season == null) invokeRidomovies(res.title, res.year, callback)
}
},
{
invokeNavy(res.imdbId, res.season, res.episode, callback)
},
)
return true

View file

@ -18,6 +18,7 @@ import com.hexated.SoraExtractor.invokeLing
import com.hexated.SoraExtractor.invokeM4uhd
import com.hexated.SoraExtractor.invokeMovie123Net
import com.hexated.SoraExtractor.invokeMovieHab
import com.hexated.SoraExtractor.invokeNavy
import com.hexated.SoraExtractor.invokeNinetv
import com.hexated.SoraExtractor.invokeNowTv
import com.hexated.SoraExtractor.invokePutlocker
@ -275,7 +276,10 @@ class SoraStreamLite : SoraStream() {
)
},
{
if (!res.isAnime && res.season == null) invokeNowTv(res.id, res.season, res.episode, callback)
if (!res.isAnime) invokeNowTv(res.id, res.season, res.episode, callback)
},
{
invokeNavy(res.imdbId, res.season, res.episode, callback)
},
{
if (res.season == null) invokeRidomovies(