SuperStream: Remove jackson dependency to reduce size significantly (#832)
This commit is contained in:
@ -1,16 +1,13 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
apply plugin: 'kotlinx-serialization'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
extName = 'SuperStream'
|
extName = 'SuperStream'
|
||||||
pkgNameSuffix = 'en.superstream'
|
pkgNameSuffix = 'en.superstream'
|
||||||
extClass = '.SuperStream'
|
extClass = '.SuperStream'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package eu.kanade.tachiyomi.animeextension.en.superstream
|
package eu.kanade.tachiyomi.animeextension.en.superstream
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class LinkData(
|
data class LinkData(
|
||||||
val id: Int,
|
val id: Int,
|
||||||
val type: Int,
|
val type: Int,
|
||||||
@ -9,269 +11,279 @@ data class LinkData(
|
|||||||
val episode: Int?
|
val episode: Int?
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class LinkDataProp(
|
data class LinkDataProp(
|
||||||
@JsonProperty("code") val code: Int? = null,
|
val code: Int? = null,
|
||||||
@JsonProperty("msg") val msg: String? = null,
|
val msg: String? = null,
|
||||||
@JsonProperty("data") val data: ArrayList<ParsedLinkData?> = arrayListOf()
|
val data: ParsedLinkData? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class ParsedLinkData(
|
data class ParsedLinkData(
|
||||||
@JsonProperty("seconds") val seconds: Int? = null,
|
val seconds: Int? = null,
|
||||||
@JsonProperty("quality") val quality: ArrayList<String> = arrayListOf(),
|
val quality: ArrayList<String> = arrayListOf(),
|
||||||
@JsonProperty("list") val list: ArrayList<LinkList> = arrayListOf()
|
val list: ArrayList<LinkList> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class LinkList(
|
data class LinkList(
|
||||||
@JsonProperty("path") val path: String? = null,
|
val path: String? = null,
|
||||||
@JsonProperty("quality") val quality: String? = null,
|
val quality: String? = null,
|
||||||
@JsonProperty("real_quality") val realQuality: String? = null,
|
val real_quality: String? = null,
|
||||||
@JsonProperty("format") val format: String? = null,
|
val format: String? = null,
|
||||||
@JsonProperty("size") val size: String? = null,
|
val size: String? = null,
|
||||||
@JsonProperty("size_bytes") val sizeBytes: Long? = null,
|
val size_bytes: Long? = null,
|
||||||
@JsonProperty("count") val count: Int? = null,
|
val count: Int? = null,
|
||||||
@JsonProperty("dateline") val dateline: Long? = null,
|
val dateline: Long? = null,
|
||||||
@JsonProperty("fid") val fid: Int? = null,
|
val fid: Int? = null,
|
||||||
@JsonProperty("mmfid") val mmfid: Int? = null,
|
val mmfid: Int? = null,
|
||||||
@JsonProperty("h265") val h265: Int? = null,
|
val h265: Int? = null,
|
||||||
@JsonProperty("hdr") val hdr: Int? = null,
|
val hdr: Int? = null,
|
||||||
@JsonProperty("filename") val filename: String? = null,
|
val filename: String? = null,
|
||||||
@JsonProperty("original") val original: Int? = null,
|
val original: Int? = null,
|
||||||
@JsonProperty("colorbit") val colorbit: Int? = null,
|
val colorbit: Int? = null,
|
||||||
@JsonProperty("success") val success: Int? = null,
|
val success: Int? = null,
|
||||||
@JsonProperty("timeout") val timeout: Int? = null,
|
val timeout: Int? = null,
|
||||||
@JsonProperty("vip_link") val vipLink: Int? = null,
|
val vip_link: Int? = null,
|
||||||
@JsonProperty("fps") val fps: Int? = null,
|
val fps: Int? = null,
|
||||||
@JsonProperty("bitstream") val bitstream: String? = null,
|
val bitstream: String? = null,
|
||||||
@JsonProperty("width") val width: Int? = null,
|
val width: Int? = null,
|
||||||
@JsonProperty("height") val height: Int? = null
|
val height: Int? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class LoadData(
|
data class LoadData(
|
||||||
val id: Int,
|
val id: Int,
|
||||||
val type: Int?
|
val type: Int?
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class DataJSON(
|
data class DataJSON(
|
||||||
@JsonProperty("data") val data: ArrayList<ListJSON> = arrayListOf()
|
val data: ArrayList<ListJSON> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class ListJSON(
|
data class ListJSON(
|
||||||
@JsonProperty("code") val code: Int? = null,
|
val code: Int? = null,
|
||||||
@JsonProperty("type") val type: String? = null,
|
val type: String? = null,
|
||||||
@JsonProperty("name") val name: String? = null,
|
val name: String? = null,
|
||||||
@JsonProperty("box_type") val boxType: Int? = null,
|
val box_type: Int? = null,
|
||||||
@JsonProperty("list") val list: ArrayList<PostJSON> = arrayListOf(),
|
val list: ArrayList<PostJSON> = arrayListOf(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class PostJSON(
|
data class PostJSON(
|
||||||
@JsonProperty("id") val id: Int? = null,
|
val id: Int? = null,
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("poster") val poster: String? = null,
|
val poster: String? = null,
|
||||||
@JsonProperty("poster_2") val poster2: String? = null,
|
val poster_2: String? = null,
|
||||||
@JsonProperty("box_type") val boxType: Int? = null,
|
val box_type: Int? = null,
|
||||||
@JsonProperty("imdb_rating") val imdbRating: String? = null,
|
val imdb_rating: String? = null,
|
||||||
@JsonProperty("quality_tag") val quality_tag: String? = null,
|
val quality_tag: String? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class MainData(
|
data class MainData(
|
||||||
@JsonProperty("data") val data: ArrayList<Data> = arrayListOf()
|
val data: ArrayList<Data> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class Data(
|
data class Data(
|
||||||
@JsonProperty("id") val id: Int? = null,
|
val id: Int? = null,
|
||||||
@JsonProperty("mid") val mid: Int? = null,
|
val mid: Int? = null,
|
||||||
@JsonProperty("tid") val tid: Int? = null,
|
val tid: Int? = null,
|
||||||
@JsonProperty("box_type") val boxType: Int? = null,
|
val box_type: Int? = null,
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("poster_org") val posterOrg: String? = null,
|
val poster_org: String? = null,
|
||||||
@JsonProperty("poster") val poster: String? = null,
|
val poster: String? = null,
|
||||||
@JsonProperty("cats") val cats: String? = null,
|
val cats: String? = null,
|
||||||
@JsonProperty("year") val year: Int? = null,
|
val year: Int? = null,
|
||||||
@JsonProperty("imdb_rating") val imdbRating: String? = null,
|
val imdb_rating: String? = null,
|
||||||
@JsonProperty("quality_tag") val qualityTag: String? = null,
|
val quality_tag: String? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class MovieDataProp(
|
data class MovieDataProp(
|
||||||
@JsonProperty("data") val data: MovieData? = MovieData()
|
val data: MovieData? = MovieData()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class MovieData(
|
data class MovieData(
|
||||||
@JsonProperty("id") val id: Int? = null,
|
val id: Int? = null,
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("director") val director: String? = null,
|
val director: String? = null,
|
||||||
@JsonProperty("writer") val writer: String? = null,
|
val writer: String? = null,
|
||||||
@JsonProperty("actors") val actors: String? = null,
|
val actors: String? = null,
|
||||||
@JsonProperty("runtime") val runtime: Int? = null,
|
val runtime: Int? = null,
|
||||||
@JsonProperty("poster") val poster: String? = null,
|
val poster: String? = null,
|
||||||
@JsonProperty("description") val description: String? = null,
|
val description: String? = null,
|
||||||
@JsonProperty("cats") val cats: String? = null,
|
val cats: String? = null,
|
||||||
@JsonProperty("year") val year: Int? = null,
|
val year: Int? = null,
|
||||||
@JsonProperty("update_time") val updateTime: Int? = null,
|
val update_time: Int? = null,
|
||||||
@JsonProperty("imdb_id") val imdbId: String? = null,
|
val imdbId: String? = null,
|
||||||
@JsonProperty("imdb_rating") val imdbRating: String? = null,
|
val imdb_rating: String? = null,
|
||||||
@JsonProperty("trailer") val trailer: String? = null,
|
val trailer: String? = null,
|
||||||
@JsonProperty("released") val released: String? = null,
|
val released: String? = null,
|
||||||
@JsonProperty("content_rating") val contentRating: String? = null,
|
val content_rating: String? = null,
|
||||||
@JsonProperty("tmdb_id") val tmdbId: Int? = null,
|
val tmdb_id: Int? = null,
|
||||||
@JsonProperty("tomato_meter") val tomatoMeter: Int? = null,
|
val tomatoMeter: Int? = null,
|
||||||
@JsonProperty("poster_org") val posterOrg: String? = null,
|
val poster_org: String? = null,
|
||||||
@JsonProperty("trailer_url") val trailerUrl: String? = null,
|
val trailer_url: String? = null,
|
||||||
@JsonProperty("imdb_link") val imdbLink: String? = null,
|
val imdb_link: String? = null,
|
||||||
@JsonProperty("box_type") val boxType: Int? = null,
|
val box_type: Int? = null,
|
||||||
@JsonProperty("recommend") val recommend: List<Data> = listOf() // series does not have any recommendations :pensive:
|
val recommend: List<Data> = listOf() // series does not have any recommendations :pensive:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SeriesDataProp(
|
data class SeriesDataProp(
|
||||||
@JsonProperty("code") val code: Int? = null,
|
val code: Int? = null,
|
||||||
@JsonProperty("msg") val msg: String? = null,
|
val msg: String? = null,
|
||||||
@JsonProperty("data") val data: SeriesData? = SeriesData()
|
val data: SeriesData? = SeriesData()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SeriesLanguage(
|
data class SeriesLanguage(
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("lang") val lang: String? = null
|
val lang: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SeriesData(
|
data class SeriesData(
|
||||||
@JsonProperty("id") val id: Int? = null,
|
val id: Int? = null,
|
||||||
@JsonProperty("mb_id") val mbId: Int? = null,
|
val mb_id: Int? = null,
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("display") val display: Int? = null,
|
val display: Int? = null,
|
||||||
@JsonProperty("state") val state: Int? = null,
|
val state: Int? = null,
|
||||||
@JsonProperty("vip_only") val vipOnly: Int? = null,
|
val vip_only: Int? = null,
|
||||||
@JsonProperty("code_file") val codeFile: Int? = null,
|
val code_file: Int? = null,
|
||||||
@JsonProperty("director") val director: String? = null,
|
val director: String? = null,
|
||||||
@JsonProperty("writer") val writer: String? = null,
|
val writer: String? = null,
|
||||||
@JsonProperty("actors") val actors: String? = null,
|
val actors: String? = null,
|
||||||
@JsonProperty("add_time") val addTime: Int? = null,
|
val add_time: Int? = null,
|
||||||
@JsonProperty("poster") val poster: String? = null,
|
val poster: String? = null,
|
||||||
@JsonProperty("poster_imdb") val posterImdb: Int? = null,
|
val poster_imdb: Int? = null,
|
||||||
@JsonProperty("banner_mini") val bannerMini: String? = null,
|
val banner_mini: String? = null,
|
||||||
@JsonProperty("description") val description: String? = null,
|
val description: String? = null,
|
||||||
@JsonProperty("imdb_id") val imdbId: String? = null,
|
val imdb_id: String? = null,
|
||||||
@JsonProperty("cats") val cats: String? = null,
|
val cats: String? = null,
|
||||||
@JsonProperty("year") val year: Int? = null,
|
val year: Int? = null,
|
||||||
@JsonProperty("collect") val collect: Int? = null,
|
val collect: Int? = null,
|
||||||
@JsonProperty("view") val view: Int? = null,
|
val view: Int? = null,
|
||||||
@JsonProperty("download") val download: Int? = null,
|
val download: Int? = null,
|
||||||
@JsonProperty("update_time") val updateTime: String? = null,
|
val update_time: String? = null,
|
||||||
@JsonProperty("released") val released: String? = null,
|
val released: String? = null,
|
||||||
@JsonProperty("released_timestamp") val releasedTimestamp: Int? = null,
|
val released_timestamp: Int? = null,
|
||||||
@JsonProperty("episode_released") val episodeReleased: String? = null,
|
val episode_released: String? = null,
|
||||||
@JsonProperty("episode_released_timestamp") val episodeReleasedTimestamp: Int? = null,
|
val episode_released_timestamp: Int? = null,
|
||||||
@JsonProperty("max_season") val maxSeason: Int? = null,
|
val max_season: Int? = null,
|
||||||
@JsonProperty("max_episode") val maxEpisode: Int? = null,
|
val max_episode: Int? = null,
|
||||||
@JsonProperty("remark") val remark: String? = null,
|
val remark: String? = null,
|
||||||
@JsonProperty("imdb_rating") val imdbRating: String? = null,
|
val imdb_rating: String? = null,
|
||||||
@JsonProperty("content_rating") val contentRating: String? = null,
|
val content_rating: String? = null,
|
||||||
@JsonProperty("tmdb_id") val tmdbId: Int? = null,
|
val tmdb_id: Int? = null,
|
||||||
@JsonProperty("tomato_url") val tomatoUrl: String? = null,
|
val tomato_url: String? = null,
|
||||||
@JsonProperty("tomato_meter") val tomatoMeter: Int? = null,
|
val tomato_meter: Int? = null,
|
||||||
@JsonProperty("tomato_meter_count") val tomatoMeterCount: Int? = null,
|
val tomato_meter_count: Int? = null,
|
||||||
@JsonProperty("tomato_meter_state") val tomatoMeterState: String? = null,
|
val tomato_meter_state: String? = null,
|
||||||
@JsonProperty("reelgood_url") val reelgoodUrl: String? = null,
|
val reelgood_url: String? = null,
|
||||||
@JsonProperty("audience_score") val audienceScore: Int? = null,
|
val audience_score: Int? = null,
|
||||||
@JsonProperty("audience_score_count") val audienceScoreCount: Int? = null,
|
val audience_score_count: Int? = null,
|
||||||
@JsonProperty("no_tomato_url") val noTomatoUrl: Int? = null,
|
val no_tomato_url: Int? = null,
|
||||||
@JsonProperty("order_year") val orderYear: Int? = null,
|
val order_year: Int? = null,
|
||||||
@JsonProperty("episodate_id") val episodateId: String? = null,
|
val episodate_id: String? = null,
|
||||||
@JsonProperty("weights_day") val weightsDay: Double? = null,
|
val weights_day: Double? = null,
|
||||||
@JsonProperty("poster_min") val posterMin: String? = null,
|
val poster_min: String? = null,
|
||||||
@JsonProperty("poster_org") val posterOrg: String? = null,
|
val poster_org: String? = null,
|
||||||
@JsonProperty("banner_mini_min") val bannerMiniMin: String? = null,
|
val banner_mini_min: String? = null,
|
||||||
@JsonProperty("banner_mini_org") val bannerMiniOrg: String? = null,
|
val banner_mini_org: String? = null,
|
||||||
@JsonProperty("trailer_url") val trailerUrl: String? = null,
|
val trailer_url: String? = null,
|
||||||
@JsonProperty("years") val years: ArrayList<Int> = arrayListOf(),
|
val years: ArrayList<Int> = arrayListOf(),
|
||||||
@JsonProperty("season") val season: ArrayList<Int> = arrayListOf(),
|
val season: ArrayList<Int> = arrayListOf(),
|
||||||
@JsonProperty("history") val history: ArrayList<String> = arrayListOf(),
|
val history: ArrayList<String> = arrayListOf(),
|
||||||
@JsonProperty("imdb_link") val imdbLink: String? = null,
|
val imdb_link: String? = null,
|
||||||
@JsonProperty("episode") val episode: ArrayList<SeriesEpisode> = arrayListOf(),
|
val episode: ArrayList<SeriesEpisode> = arrayListOf(),
|
||||||
// @JsonProperty("is_collect") val isCollect: Int? = null,
|
val language: ArrayList<SeriesLanguage> = arrayListOf(),
|
||||||
@JsonProperty("language") val language: ArrayList<SeriesLanguage> = arrayListOf(),
|
val box_type: Int? = null,
|
||||||
@JsonProperty("box_type") val boxType: Int? = null,
|
val year_year: String? = null,
|
||||||
@JsonProperty("year_year") val yearYear: String? = null,
|
val season_episode: String? = null,
|
||||||
@JsonProperty("season_episode") val seasonEpisode: String? = null,
|
val recommend: List<Data> = listOf()
|
||||||
@JsonProperty("recommend") val recommend: List<Data> = listOf()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SeriesSeasonProp(
|
data class SeriesSeasonProp(
|
||||||
@JsonProperty("code") val code: Int? = null,
|
val code: Int? = null,
|
||||||
@JsonProperty("msg") val msg: String? = null,
|
val msg: String? = null,
|
||||||
@JsonProperty("data") val data: ArrayList<SeriesEpisode>? = arrayListOf()
|
val data: ArrayList<SeriesEpisode>? = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SeriesEpisode(
|
data class SeriesEpisode(
|
||||||
@JsonProperty("id") val id: Int? = null,
|
val id: Int? = null,
|
||||||
@JsonProperty("tid") val tid: Int? = null,
|
val tid: Int? = null,
|
||||||
@JsonProperty("mb_id") val mbId: Int? = null,
|
val mb_id: Int? = null,
|
||||||
@JsonProperty("imdb_id") val imdbId: String? = null,
|
val imdb_id: String? = null,
|
||||||
@JsonProperty("imdb_id_status") val imdbIdStatus: Int? = null,
|
val imdb_id_status: Int? = null,
|
||||||
@JsonProperty("srt_status") val srtStatus: Int? = null,
|
val srt_status: Int? = null,
|
||||||
@JsonProperty("season") val season: Int? = null,
|
val season: Int? = null,
|
||||||
@JsonProperty("episode") val episode: Int? = null,
|
val episode: Int? = null,
|
||||||
@JsonProperty("state") val state: Int? = null,
|
val state: Int? = null,
|
||||||
@JsonProperty("title") val title: String? = null,
|
val title: String? = null,
|
||||||
@JsonProperty("thumbs") val thumbs: String? = null,
|
val thumbs: String? = null,
|
||||||
@JsonProperty("thumbs_bak") val thumbsBak: String? = null,
|
val thumbs_bak: String? = null,
|
||||||
@JsonProperty("thumbs_original") val thumbsOriginal: String? = null,
|
val thumbs_original: String? = null,
|
||||||
@JsonProperty("poster_imdb") val posterImdb: Int? = null,
|
val poster_imdb: Int? = null,
|
||||||
@JsonProperty("synopsis") val synopsis: String? = null,
|
val synopsis: String? = null,
|
||||||
@JsonProperty("runtime") val runtime: Int? = null,
|
val runtime: Int? = null,
|
||||||
@JsonProperty("view") val view: Int? = null,
|
val view: Int? = null,
|
||||||
@JsonProperty("download") val download: Int? = null,
|
val download: Int? = null,
|
||||||
@JsonProperty("source_file") val sourceFile: Int? = null,
|
val source_file: Int? = null,
|
||||||
@JsonProperty("code_file") val codeFile: Int? = null,
|
val code_file: Int? = null,
|
||||||
@JsonProperty("add_time") val addTime: Int? = null,
|
val add_time: Int? = null,
|
||||||
@JsonProperty("update_time") val updateTime: Int? = null,
|
val update_time: Int? = null,
|
||||||
@JsonProperty("released") val released: String? = null,
|
val released: String? = null,
|
||||||
@JsonProperty("released_timestamp") val releasedTimestamp: Long? = null,
|
val released_timestamp: Long? = null,
|
||||||
@JsonProperty("audio_lang") val audioLang: String? = null,
|
val audio_lang: String? = null,
|
||||||
@JsonProperty("quality_tag") val qualityTag: String? = null,
|
val quality_tag: String? = null,
|
||||||
@JsonProperty("3d") val _3d: Int? = null,
|
val remark: String? = null,
|
||||||
@JsonProperty("remark") val remark: String? = null,
|
val pending: String? = null,
|
||||||
@JsonProperty("pending") val pending: String? = null,
|
val imdb_rating: String? = null,
|
||||||
@JsonProperty("imdb_rating") val imdbRating: String? = null,
|
val display: Int? = null,
|
||||||
@JsonProperty("display") val display: Int? = null,
|
val sync: Int? = null,
|
||||||
@JsonProperty("sync") val sync: Int? = null,
|
val tomato_meter: Int? = null,
|
||||||
@JsonProperty("tomato_meter") val tomatoMeter: Int? = null,
|
val imdb_link: String? = null
|
||||||
@JsonProperty("tomato_meter_count") val tomatoMeterCount: Int? = null,
|
|
||||||
@JsonProperty("tomato_audience") val tomatoAudience: Int? = null,
|
|
||||||
@JsonProperty("tomato_audience_count") val tomatoAudienceCount: Int? = null,
|
|
||||||
@JsonProperty("thumbs_min") val thumbsMin: String? = null,
|
|
||||||
@JsonProperty("thumbs_org") val thumbsOrg: String? = null,
|
|
||||||
@JsonProperty("imdb_link") val imdbLink: String? = null,
|
|
||||||
// @JsonProperty("quality_tags") val qualityTags: ArrayList<String> = arrayListOf(),
|
|
||||||
// @JsonProperty("play_progress" ) val playProgress : PlayProgress? = PlayProgress()
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SubtitleList(
|
data class SubtitleList(
|
||||||
@JsonProperty("language") val language: String? = null,
|
val language: String? = null,
|
||||||
@JsonProperty("subtitles") val subtitles: ArrayList<Subtitles> = arrayListOf()
|
val subtitles: ArrayList<Subtitles> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class Subtitles(
|
data class Subtitles(
|
||||||
@JsonProperty("sid") val sid: Int? = null,
|
val sid: Int? = null,
|
||||||
@JsonProperty("mid") val mid: String? = null,
|
val mid: String? = null,
|
||||||
@JsonProperty("file_path") val filePath: String? = null,
|
val file_path: String? = null,
|
||||||
@JsonProperty("lang") val lang: String? = null,
|
val lang: String? = null,
|
||||||
@JsonProperty("language") val language: String? = null,
|
val language: String? = null,
|
||||||
@JsonProperty("delay") val delay: Int? = null,
|
val delay: Int? = null,
|
||||||
@JsonProperty("point") val point: String? = null,
|
val point: JsonElement? = null,
|
||||||
@JsonProperty("order") val order: Int? = null,
|
val order: Int? = null,
|
||||||
@JsonProperty("admin_order") val adminOrder: Int? = null,
|
val admin_order: Int? = null,
|
||||||
@JsonProperty("myselect") val myselect: Int? = null,
|
val myselect: Int? = null,
|
||||||
@JsonProperty("add_time") val addTime: Long? = null,
|
val add_time: Long? = null,
|
||||||
@JsonProperty("count") val count: Int? = null
|
val count: Int? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class PrivateSubtitleData(
|
data class PrivateSubtitleData(
|
||||||
@JsonProperty("select") val select: ArrayList<String> = arrayListOf(),
|
val select: ArrayList<String> = arrayListOf(),
|
||||||
@JsonProperty("list") val list: ArrayList<SubtitleList> = arrayListOf()
|
val list: ArrayList<SubtitleList> = arrayListOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class SubtitleDataProp(
|
data class SubtitleDataProp(
|
||||||
@JsonProperty("code") val code: Int? = null,
|
val code: Int? = null,
|
||||||
@JsonProperty("msg") val msg: String? = null,
|
val msg: String? = null,
|
||||||
@JsonProperty("data") val data: PrivateSubtitleData? = PrivateSubtitleData()
|
val data: PrivateSubtitleData? = PrivateSubtitleData()
|
||||||
)
|
)
|
||||||
|
@ -12,11 +12,14 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
|
|||||||
import eu.kanade.tachiyomi.animesource.model.Video
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
|
import kotlinx.serialization.encodeToString
|
||||||
|
import kotlinx.serialization.json.Json
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
@ExperimentalSerializationApi
|
@ExperimentalSerializationApi
|
||||||
@ -30,7 +33,9 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
|
|
||||||
override val supportsLatest = false
|
override val supportsLatest = false
|
||||||
|
|
||||||
private val superStreamAPI = SuperStreamAPI()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
|
private val superStreamAPI = SuperStreamAPI(json)
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient
|
override val client: OkHttpClient = network.cloudflareClient
|
||||||
|
|
||||||
@ -56,22 +61,22 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
mov.id?.let {
|
mov.id?.let {
|
||||||
episodes.add(
|
episodes.add(
|
||||||
SEpisode.create().apply {
|
SEpisode.create().apply {
|
||||||
url = LinkData(mov.id, mov.boxType ?: 1, 0, 1).toJson()
|
url = LinkData(mov.id, mov.box_type ?: 1, 0, 1).toJson()
|
||||||
name = "Movie"
|
name = "Movie"
|
||||||
date_upload = getDateTime(mov.updateTime)
|
date_upload = getDateTime(mov.update_time)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
series?.mapNotNull { ser ->
|
series?.mapNotNull { ser ->
|
||||||
ser.id?.let {
|
ser.id?.let {
|
||||||
if (ser.sourceFile!! == 1) {
|
if (ser.source_file!! == 1) {
|
||||||
episodes.add(
|
episodes.add(
|
||||||
SEpisode.create().apply {
|
SEpisode.create().apply {
|
||||||
url = LinkData(ser.tid ?: ser.id, 2, ser.season, ser.episode).toJson()
|
url = LinkData(ser.tid ?: ser.id, 2, ser.season, ser.episode).toJson()
|
||||||
episode_number = ser.episode?.toFloat() ?: 0F
|
episode_number = ser.episode?.toFloat() ?: 0F
|
||||||
name = "Season ${ser.season} Ep ${ser.episode}: ${ser.title}"
|
name = "Season ${ser.season} Ep ${ser.episode}: ${ser.title}"
|
||||||
date_upload = getDateTime(ser.updateTime)
|
date_upload = getDateTime(ser.update_time)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -209,9 +214,8 @@ class SuperStream : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
screen.addPreference(videoQualityPref)
|
screen.addPreference(videoQualityPref)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Any.toJson(): String {
|
private fun LinkData.toJson(): String {
|
||||||
if (this is String) return this
|
return json.encodeToString(this)
|
||||||
return superStreamAPI.mapper.writeValueAsString(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDateTime(s: Int?): Long {
|
private fun getDateTime(s: Int?): Long {
|
||||||
|
@ -681,15 +681,15 @@ package eu.kanade.tachiyomi.animeextension.en.superstream
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature
|
|
||||||
import com.fasterxml.jackson.databind.json.JsonMapper
|
|
||||||
import com.fasterxml.jackson.module.kotlin.KotlinModule
|
|
||||||
import com.fasterxml.jackson.module.kotlin.readValue
|
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||||
import eu.kanade.tachiyomi.animesource.model.Track
|
import eu.kanade.tachiyomi.animesource.model.Track
|
||||||
import eu.kanade.tachiyomi.animesource.model.Video
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
import eu.kanade.tachiyomi.network.POST
|
import eu.kanade.tachiyomi.network.POST
|
||||||
|
import kotlinx.serialization.decodeFromString
|
||||||
|
import kotlinx.serialization.encodeToString
|
||||||
|
import kotlinx.serialization.json.Json
|
||||||
|
import kotlinx.serialization.json.jsonPrimitive
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -713,7 +713,7 @@ const val TYPE_SERIES = 2
|
|||||||
const val TYPE_MOVIES = 1
|
const val TYPE_MOVIES = 1
|
||||||
|
|
||||||
// Ported from CS3
|
// Ported from CS3
|
||||||
class SuperStreamAPI {
|
class SuperStreamAPI(val json: Json) {
|
||||||
|
|
||||||
private val client = configureToIgnoreCertificate()
|
private val client = configureToIgnoreCertificate()
|
||||||
|
|
||||||
@ -878,8 +878,8 @@ class SuperStreamAPI {
|
|||||||
it.list.mapNotNull second@{ post ->
|
it.list.mapNotNull second@{ post ->
|
||||||
animes.add(
|
animes.add(
|
||||||
SAnime.create().apply {
|
SAnime.create().apply {
|
||||||
url = LoadData(post.id ?: return@mapNotNull null, post.boxType).toJson()
|
url = LoadData(post.id ?: return@mapNotNull null, post.box_type).toJson()
|
||||||
thumbnail_url = post.poster ?: post.poster2
|
thumbnail_url = post.poster ?: post.poster_2
|
||||||
title = post.title ?: return@second null
|
title = post.title ?: return@second null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -892,9 +892,9 @@ class SuperStreamAPI {
|
|||||||
val it = this
|
val it = this
|
||||||
return SAnime.create().apply {
|
return SAnime.create().apply {
|
||||||
title = it.title ?: return null
|
title = it.title ?: return null
|
||||||
thumbnail_url = it.posterOrg ?: it.poster
|
thumbnail_url = it.poster_org ?: it.poster
|
||||||
url = (
|
url = (
|
||||||
it.id?.let { id -> LoadData(id, it.boxType ?: return@let null) }
|
it.id?.let { id -> LoadData(id, it.box_type ?: return@let null) }
|
||||||
?: it.mid?.let { id ->
|
?: it.mid?.let { id ->
|
||||||
LoadData(
|
LoadData(
|
||||||
id,
|
id,
|
||||||
@ -967,7 +967,7 @@ class SuperStreamAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Should really run this query for every link :(
|
// Should really run this query for every link :(
|
||||||
val fid = linkData.data[0]!!.list.firstOrNull { it.fid != null }?.fid
|
val fid = linkData.data!!.list.firstOrNull { it.fid != null }?.fid
|
||||||
|
|
||||||
val subtitleQuery = if (parsed.type == TYPE_MOVIES) {
|
val subtitleQuery = if (parsed.type == TYPE_MOVIES) {
|
||||||
"""{"childmode":"0","fid":"$fid","uid":"","app_version":"11.5","appid":"$appId","module":"Movie_srt_list_v2","channel":"Website","mid":"${parsed.id}","lang":"en","expired_date":"${getExpiryDate()}","platform":"android"}"""
|
"""{"childmode":"0","fid":"$fid","uid":"","app_version":"11.5","appid":"$appId","module":"Movie_srt_list_v2","channel":"Website","mid":"${parsed.id}","lang":"en","expired_date":"${getExpiryDate()}","platform":"android"}"""
|
||||||
@ -979,11 +979,11 @@ class SuperStreamAPI {
|
|||||||
try {
|
try {
|
||||||
subtitles?.list?.forEach {
|
subtitles?.list?.forEach {
|
||||||
it.subtitles.forEachIndexed second@{ index, sub ->
|
it.subtitles.forEachIndexed second@{ index, sub ->
|
||||||
if (sub.filePath.isNullOrBlank().not()) {
|
sub.file_path?.let {
|
||||||
subsList.add(
|
subsList.add(
|
||||||
Track(
|
Track(
|
||||||
sub.filePath ?: return listOf(),
|
sub.file_path,
|
||||||
(sub.language ?: sub.lang ?: "Sub") + " ${index + 1} (${sub.point})"
|
(sub.language ?: sub.lang ?: "Sub") + " ${index + 1} (${sub.point!!.jsonPrimitive.content})"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -991,14 +991,14 @@ class SuperStreamAPI {
|
|||||||
}
|
}
|
||||||
} catch (e: Error) {}
|
} catch (e: Error) {}
|
||||||
|
|
||||||
linkData.data[0]!!.list.forEach {
|
linkData.data!!.list.forEach {
|
||||||
if (it.path.isNullOrBlank().not()) {
|
if (it.path.isNullOrBlank().not()) {
|
||||||
val videoUrl = it.path?.replace("\\/", "") ?: ""
|
val videoUrl = it.path?.replace("\\/", "") ?: ""
|
||||||
try {
|
try {
|
||||||
videoList.add(
|
videoList.add(
|
||||||
Video(
|
Video(
|
||||||
videoUrl,
|
videoUrl,
|
||||||
(it.quality ?: it.realQuality ?: "quality") + " ${it.size}",
|
(it.quality ?: it.real_quality ?: "quality") + " ${it.size}",
|
||||||
videoUrl,
|
videoUrl,
|
||||||
subtitleTracks = subsList,
|
subtitleTracks = subsList,
|
||||||
headers = headers
|
headers = headers
|
||||||
@ -1008,7 +1008,7 @@ class SuperStreamAPI {
|
|||||||
videoList.add(
|
videoList.add(
|
||||||
Video(
|
Video(
|
||||||
videoUrl,
|
videoUrl,
|
||||||
(it.quality ?: it.realQuality ?: "quality") + " ${it.size}",
|
(it.quality ?: it.real_quality ?: "quality") + " ${it.size}",
|
||||||
videoUrl,
|
videoUrl,
|
||||||
headers = headers
|
headers = headers
|
||||||
)
|
)
|
||||||
@ -1019,9 +1019,8 @@ class SuperStreamAPI {
|
|||||||
return videoList
|
return videoList
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Any.toJson(): String {
|
private fun LoadData.toJson(): String {
|
||||||
if (this is String) return this
|
return json.encodeToString(this)
|
||||||
return mapper.writeValueAsString(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun base64Decode(string: String): String {
|
private fun base64Decode(string: String): String {
|
||||||
@ -1037,13 +1036,8 @@ class SuperStreamAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val mapper: JsonMapper = JsonMapper.builder().addModule(KotlinModule.Builder().build())
|
|
||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
|
||||||
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
private inline fun <reified T> parseJson(value: String): T {
|
private inline fun <reified T> parseJson(value: String): T {
|
||||||
return mapper.readValue(value)
|
return json.decodeFromString(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user