sora: remove smashy1 from anime

This commit is contained in:
hexated 2023-05-25 05:18:47 +07:00
parent b08c3a3204
commit 560648da29
3 changed files with 12 additions and 23 deletions

View file

@ -920,17 +920,15 @@ object SoraExtractor : SoraStream() {
) )
} }
app.get("https://api.bilibili.tv/intl/gateway/web/v2/subtitle?s_locale=en_US&platform=web&episode_id=${res.sourceEpisodeId}&spm_id=bstar-web.pgc-video-detail.0.0&from_spm_id=bstar-web.homepage.anime.all") sources?.subtitles?.map { sub ->
.parsedSafe<BiliBiliSubtitlesResponses>()?.data?.subtitles?.map { sub -> subtitleCallback.invoke(
subtitleCallback.invoke( SubtitleFile(
SubtitleFile( SubtitleHelper.fromTwoLettersToLanguage(sub.lang ?: "") ?: sub.language
SubtitleHelper.fromTwoLettersToLanguage(sub.lang_key ?: "") ?: sub.lang ?: return@map null,
?: return@map null, sub.file ?: return@map null
sub.url ?: return@map null
)
) )
} )
}
} }
@ -1875,6 +1873,7 @@ object SoraExtractor : SoraStream() {
imdbId: String? = null, imdbId: String? = null,
season: Int? = null, season: Int? = null,
episode: Int? = null, episode: Int? = null,
isAnime: Boolean = false,
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
@ -1891,7 +1890,7 @@ object SoraExtractor : SoraStream() {
it.attr("data-id") to it.text() it.attr("data-id") to it.text()
}.apmap { }.apmap {
when { when {
it.first.contains("/ffix") -> { it.first.contains("/ffix") && !isAnime -> {
invokeSmashyFfix(it.second, it.first, callback) invokeSmashyFfix(it.second, it.first, callback)
} }
it.first.contains("/gtop") -> { it.first.contains("/gtop") -> {
@ -3156,9 +3155,7 @@ data class BiliBiliDetails(
data class BiliBiliSubtitles( data class BiliBiliSubtitles(
@JsonProperty("file") val file: String? = null, @JsonProperty("file") val file: String? = null,
@JsonProperty("url") val url: String? = null,
@JsonProperty("lang") val lang: String? = null, @JsonProperty("lang") val lang: String? = null,
@JsonProperty("lang_key") val lang_key: String? = null,
@JsonProperty("language") val language: String? = null, @JsonProperty("language") val language: String? = null,
) )
@ -3172,14 +3169,6 @@ data class BiliBiliSourcesResponse(
@JsonProperty("subtitles") val subtitles: ArrayList<BiliBiliSubtitles>? = arrayListOf(), @JsonProperty("subtitles") val subtitles: ArrayList<BiliBiliSubtitles>? = arrayListOf(),
) )
data class BiliBiliSubtitlesData(
@JsonProperty("subtitles") val subtitles: ArrayList<BiliBiliSubtitles>? = arrayListOf(),
)
data class BiliBiliSubtitlesResponses(
@JsonProperty("data") val data: BiliBiliSubtitlesData? = BiliBiliSubtitlesData(),
)
data class WatchOnlineItems( data class WatchOnlineItems(
@JsonProperty("slug") val slug: String? = null, @JsonProperty("slug") val slug: String? = null,
@JsonProperty("tmdb_id") val tmdb_id: Int? = null, @JsonProperty("tmdb_id") val tmdb_id: Int? = null,

View file

@ -609,7 +609,7 @@ open class SoraStream : TmdbProvider() {
invokeMovie123Net(res.title, res.season, res.episode, subtitleCallback, callback) invokeMovie123Net(res.title, res.season, res.episode, subtitleCallback, callback)
}, },
{ {
invokeSmashyStream(res.imdbId, res.season, res.episode, subtitleCallback, callback) invokeSmashyStream(res.imdbId, res.season, res.episode, res.isAnime, subtitleCallback, callback)
}, },
{ {
invokeWatchsomuch( invokeWatchsomuch(

View file

@ -174,7 +174,7 @@ class SoraStreamLite : SoraStream() {
invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback) invokeKimcartoon(res.title, res.season, res.episode, subtitleCallback, callback)
}, },
{ {
invokeSmashyStream(res.imdbId, res.season, res.episode, subtitleCallback, callback) invokeSmashyStream(res.imdbId, res.season, res.episode, res.isAnime, subtitleCallback, callback)
}, },
{ {
invokeXmovies( invokeXmovies(