small fixed into SoraStream

This commit is contained in:
hexated 2022-11-27 04:25:36 +07:00
parent 89230ce991
commit e31a2203ac
3 changed files with 17 additions and 5 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 38 version = 39
cloudstream { cloudstream {

View file

@ -1233,10 +1233,19 @@ object SoraExtractor : SoraStream() {
iframe.apmap { (quality, size, link) -> iframe.apmap { (quality, size, link) ->
delay(1000) delay(1000)
val res = app.get(link ?: return@apmap null).document val res = app.get(link ?: return@apmap null).document
val bitLink = res.selectFirst("a.btn.btn-outline-success")?.attr("href") ?: return@apmap null val resDoc = res.selectFirst("script")?.data()?.substringAfter("replace(\"")
val downLink = app.get(fixUrl(bitLink, base)).document.select("div.mb-4 a").randomOrNull()?.attr("href") ?.substringBefore("\")")?.let {
app.get(fixUrl(it, base)).document
}
val bitLink = resDoc?.selectFirst("a.btn.btn-outline-success")?.attr("href") ?: return@apmap null
val baseDoc = app.get(fixUrl(bitLink, base)).document
val downLink = baseDoc.select("div.mb-4 a").randomOrNull()
?.attr("href") ?: run {
val server = baseDoc.select("div.text-center a:contains(Server 2)").attr("href")
app.get(fixUrl(server, base)).document.selectFirst("div.mb-4 a")
?.attr("href")
}
val downPage = app.get(downLink ?: return@apmap null).document val downPage = app.get(downLink ?: return@apmap null).document
val downloadLink = downPage.selectFirst("form[method=post] a.btn.btn-success") val downloadLink = downPage.selectFirst("form[method=post] a.btn.btn-success")
?.attr("onclick")?.substringAfter("Openblank('")?.substringBefore("')") ?: run { ?.attr("onclick")?.substringAfter("Openblank('")?.substringBefore("')") ?: run {
val mirror = downPage.selectFirst("form[method=post] a.btn.btn-primary") val mirror = downPage.selectFirst("form[method=post] a.btn.btn-primary")

View file

@ -169,7 +169,8 @@ open class SoraStream : TmdbProvider() {
val res = app.get(resUrl).parsedSafe<MediaDetail>() ?: throw ErrorLoadingException("Invalid Json Response") val res = app.get(resUrl).parsedSafe<MediaDetail>() ?: throw ErrorLoadingException("Invalid Json Response")
val title = res.title ?: res.name ?: return null val title = res.title ?: res.name ?: return null
val poster = getOriImageUrl(res.backdropPath) val poster = getOriImageUrl(res.posterPath)
val bgPoster = getOriImageUrl(res.backdropPath)
val orgTitle = res.originalTitle ?: res.originalName ?: return null val orgTitle = res.originalTitle ?: res.originalName ?: return null
val year = (res.releaseDate ?: res.firstAirDate)?.split("-")?.first()?.toIntOrNull() val year = (res.releaseDate ?: res.firstAirDate)?.split("-")?.first()?.toIntOrNull()
val rating = res.vote_average.toString().toRatingInt() val rating = res.vote_average.toString().toRatingInt()
@ -228,6 +229,7 @@ open class SoraStream : TmdbProvider() {
episodes episodes
) { ) {
this.posterUrl = poster this.posterUrl = poster
this.backgroundPosterUrl = bgPoster
this.year = year this.year = year
this.plot = res.overview this.plot = res.overview
this.tags = genres this.tags = genres
@ -253,6 +255,7 @@ open class SoraStream : TmdbProvider() {
).toJson(), ).toJson(),
) { ) {
this.posterUrl = poster this.posterUrl = poster
this.backgroundPosterUrl = bgPoster
this.year = year this.year = year
this.plot = res.overview this.plot = res.overview
this.tags = genres this.tags = genres