Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lagradost.cloudstream3.extractors

import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.newSubtitleFile
Expand Down Expand Up @@ -82,25 +83,25 @@ open class Dailymotion : ExtractorApi() {

@Serializable
data class MetaData(
@SerialName("qualities") val qualities: Map<String, List<Quality>>?,
@SerialName("subtitles") val subtitles: SubtitlesWrapper?,
@JsonProperty("qualities") @SerialName("qualities") val qualities: Map<String, List<Quality>>?,
@JsonProperty("subtitles") @SerialName("subtitles") val subtitles: SubtitlesWrapper?,
)

@Serializable
data class Quality(
@SerialName("type") val type: String?,
@SerialName("url") val url: String?,
@JsonProperty("type") @SerialName("type") val type: String?,
@JsonProperty("url") @SerialName("url") val url: String?,
)

@Serializable
data class SubtitlesWrapper(
@SerialName("enable") val enable: Boolean,
@SerialName("data") val data: Map<String, SubtitleData>?,
@JsonProperty("enable") @SerialName("enable") val enable: Boolean,
@JsonProperty("data") @SerialName("data") val data: Map<String, SubtitleData>?,
)

@Serializable
data class SubtitleData(
@SerialName("label") val label: String,
@SerialName("urls") val urls: List<String>,
@JsonProperty("label") @SerialName("label") val label: String,
@JsonProperty("urls") @SerialName("urls") val urls: List<String>,
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lagradost.cloudstream3.extractors

import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.api.Log
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
Expand All @@ -25,18 +26,18 @@ open class GDMirrorbot : ExtractorApi() {

@Serializable
private data class EmbedData(
@SerialName("data") val data: List<FileSlug>? = null,
@JsonProperty("data") @SerialName("data") val data: List<FileSlug>? = null,
)

@Serializable
private data class FileSlug(
@SerialName("fileslug") val fileslug: String? = null,
@JsonProperty("fileslug") @SerialName("fileslug") val fileslug: String? = null,
)

@Serializable
private data class EmbedHelper(
@SerialName("siteUrls") val siteUrls: Map<String, String>? = null,
@SerialName("siteFriendlyNames") val siteFriendlyNames: Map<String, String>? = null,
@JsonProperty("siteUrls") @SerialName("siteUrls") val siteUrls: Map<String, String>? = null,
@JsonProperty("siteFriendlyNames") @SerialName("siteFriendlyNames") val siteFriendlyNames: Map<String, String>? = null,
)

override suspend fun getUrl(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.lagradost.cloudstream3.extractors

import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.INFER_TYPE
Expand Down Expand Up @@ -104,8 +105,8 @@ open class Voe : ExtractorApi() {

@Serializable
private data class VoeDecrypted(
@SerialName("source") val source: String? = null,
@SerialName("direct_access_url") val directAccessUrl: String? = null,
@JsonProperty("source") @SerialName("source") val source: String? = null,
@JsonProperty("direct_access_url") @SerialName("direct_access_url") val directAccessUrl: String? = null,
)

private fun decryptF7(p8: String): VoeDecrypted? {
Expand All @@ -117,7 +118,7 @@ open class Voe : ExtractorApi() {
val vF5 = charShift(vF4, 3)
val vF6 = reverse(vF5)
val vAtob = base64Decode(vF6)
tryParseJson<VoeDecrypted>(vAtob)
parseJson<VoeDecrypted>(vAtob)
} catch (e: Exception) {
println("Decryption error: ${e.message}")
null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lagradost.cloudstream3.metaproviders

import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.Actor
import com.lagradost.cloudstream3.ActorData
import com.lagradost.cloudstream3.Episode
Expand Down Expand Up @@ -41,11 +42,11 @@ import kotlinx.serialization.Serializable
*/
@Serializable
data class TmdbLink(
@SerialName("imdbID") val imdbID: String?,
@SerialName("tmdbID") val tmdbID: Int?,
@SerialName("episode") val episode: Int?,
@SerialName("season") val season: Int?,
@SerialName("movieName") val movieName: String? = null,
@JsonProperty("imdbID") @SerialName("imdbID") val imdbID: String?,
@JsonProperty("tmdbID") @SerialName("tmdbID") val tmdbID: Int?,
@JsonProperty("episode") @SerialName("episode") val episode: Int?,
@JsonProperty("season") @SerialName("season") val season: Int?,
@JsonProperty("movieName") @SerialName("movieName") val movieName: String? = null,
)

open class TmdbProvider : MainAPI() {
Expand All @@ -67,53 +68,53 @@ open class TmdbProvider : MainAPI() {

@Serializable
data class TmdbIds(
@SerialName("imdb_id") val imdbId: String? = null,
@SerialName("tvdb_id") val tvdbId: Int? = null,
@JsonProperty("imdb_id") @SerialName("imdb_id") val imdbId: String? = null,
@JsonProperty("tvdb_id") @SerialName("tvdb_id") val tvdbId: Int? = null,
)

@Serializable
data class TmdbGenre(
@SerialName("id") val id: Int? = null,
@SerialName("name") val name: String? = null,
@JsonProperty("id") @SerialName("id") val id: Int? = null,
@JsonProperty("name") @SerialName("name") val name: String? = null,
)

@Serializable
data class TmdbCastMember(
@SerialName("name") val name: String? = null,
@SerialName("character") val character: String? = null,
@SerialName("profile_path") val profilePath: String? = null,
@JsonProperty("name") @SerialName("name") val name: String? = null,
@JsonProperty("character") @SerialName("character") val character: String? = null,
@JsonProperty("profile_path") @SerialName("profile_path") val profilePath: String? = null,
)

@Serializable
data class TmdbCredits(
@SerialName("cast") val cast: List<TmdbCastMember>? = null,
@JsonProperty("cast") @SerialName("cast") val cast: List<TmdbCastMember>? = null,
)

@Serializable
data class TmdbVideo(
@SerialName("key") val key: String? = null,
@SerialName("site") val site: String? = null,
@SerialName("type") val type: String? = null,
@JsonProperty("key") @SerialName("key") val key: String? = null,
@JsonProperty("site") @SerialName("site") val site: String? = null,
@JsonProperty("type") @SerialName("type") val type: String? = null,
)

@Serializable
data class TmdbVideos(
@SerialName("results") val results: List<TmdbVideo>? = null,
@JsonProperty("results") @SerialName("results") val results: List<TmdbVideo>? = null,
)

// Shared between movie and tv search results
@Serializable
data class TmdbSearchResult(
@SerialName("id") val id: Int? = null,
@SerialName("title") val title: String? = null, // movies
@SerialName("original_title") val originalTitle: String? = null,
@SerialName("name") val name: String? = null, // tv
@SerialName("original_name") val originalName: String? = null,
@SerialName("poster_path") val posterPath: String? = null,
@SerialName("vote_average") val voteAverage: Double? = null,
@SerialName("release_date") val releaseDate: String? = null,
@SerialName("first_air_date") val firstAirDate: String? = null,
@SerialName("media_type") val mediaType: String? = null, // for multi-search
@JsonProperty("id") @SerialName("id") val id: Int? = null,
@JsonProperty("title") @SerialName("title") val title: String? = null, // movies
@JsonProperty("original_title") @SerialName("original_title") val originalTitle: String? = null,
@JsonProperty("name") @SerialName("name") val name: String? = null, // tv
@JsonProperty("original_name") @SerialName("original_name") val originalName: String? = null,
@JsonProperty("poster_path") @SerialName("poster_path") val posterPath: String? = null,
@JsonProperty("vote_average") @SerialName("vote_average") val voteAverage: Double? = null,
@JsonProperty("release_date") @SerialName("release_date") val releaseDate: String? = null,
@JsonProperty("first_air_date") @SerialName("first_air_date") val firstAirDate: String? = null,
@JsonProperty("media_type") @SerialName("media_type") val mediaType: String? = null, // for multi-search
) {
val isTv get() = name != null || mediaType == "tv"
val displayTitle get() = title ?: originalTitle ?: name ?: originalName ?: ""
Expand All @@ -122,110 +123,110 @@ open class TmdbProvider : MainAPI() {

@Serializable
data class TmdbPageResult<T>(
@SerialName("results") val results: List<T>? = null,
@SerialName("total_pages") val totalPages: Int? = null,
@SerialName("total_results") val totalResults: Int? = null,
@JsonProperty("results") @SerialName("results") val results: List<T>? = null,
@JsonProperty("total_pages") @SerialName("total_pages") val totalPages: Int? = null,
@JsonProperty("total_results") @SerialName("total_results") val totalResults: Int? = null,
)

@Serializable
data class TmdbMultiResult(
@SerialName("results") val results: List<TmdbSearchResult>? = null,
@JsonProperty("results") @SerialName("results") val results: List<TmdbSearchResult>? = null,
)

@Serializable
data class TmdbEpisode(
@SerialName("id") val id: Int? = null,
@SerialName("name") val name: String? = null,
@SerialName("overview") val overview: String? = null,
@SerialName("episode_number") val episodeNumber: Int? = null,
@SerialName("season_number") val seasonNumber: Int? = null,
@SerialName("still_path") val stillPath: String? = null,
@SerialName("air_date") val airDate: String? = null,
@SerialName("vote_average") val voteAverage: Double? = null,
@SerialName("external_ids") val externalIds: TmdbIds? = null,
@JsonProperty("id") @SerialName("id") val id: Int? = null,
@JsonProperty("name") @SerialName("name") val name: String? = null,
@JsonProperty("overview") @SerialName("overview") val overview: String? = null,
@JsonProperty("episode_number") @SerialName("episode_number") val episodeNumber: Int? = null,
@JsonProperty("season_number") @SerialName("season_number") val seasonNumber: Int? = null,
@JsonProperty("still_path") @SerialName("still_path") val stillPath: String? = null,
@JsonProperty("air_date") @SerialName("air_date") val airDate: String? = null,
@JsonProperty("vote_average") @SerialName("vote_average") val voteAverage: Double? = null,
@JsonProperty("external_ids") @SerialName("external_ids") val externalIds: TmdbIds? = null,
)

@Serializable
data class TmdbSeasonDetail(
@SerialName("season_number") val seasonNumber: Int? = null,
@SerialName("episodes") val episodes: List<TmdbEpisode>? = null,
@JsonProperty("season_number") @SerialName("season_number") val seasonNumber: Int? = null,
@JsonProperty("episodes") @SerialName("episodes") val episodes: List<TmdbEpisode>? = null,
)

@Serializable
data class TmdbSeasonSummary(
@SerialName("season_number") val seasonNumber: Int? = null,
@SerialName("episode_count") val episodeCount: Int? = null,
@JsonProperty("season_number") @SerialName("season_number") val seasonNumber: Int? = null,
@JsonProperty("episode_count") @SerialName("episode_count") val episodeCount: Int? = null,
)

@Serializable
data class TmdbContentRating(
@SerialName("iso_3166_1") val country: String? = null,
@SerialName("rating") val rating: String? = null,
@JsonProperty("iso_3166_1") @SerialName("iso_3166_1") val country: String? = null,
@JsonProperty("rating") @SerialName("rating") val rating: String? = null,
)

@Serializable
data class TmdbContentRatings(
@SerialName("results") val results: List<TmdbContentRating>? = null,
@JsonProperty("results") @SerialName("results") val results: List<TmdbContentRating>? = null,
)

@Serializable
data class TmdbReleaseDateEntry(
@SerialName("certification") val certification: String? = null,
@SerialName("type") val type: Int? = null,
@JsonProperty("certification") @SerialName("certification") val certification: String? = null,
@JsonProperty("type") @SerialName("type") val type: Int? = null,
)

@Serializable
data class TmdbReleaseDateResult(
@SerialName("iso_3166_1") val country: String? = null,
@SerialName("release_dates") val releaseDates: List<TmdbReleaseDateEntry>? = null,
@JsonProperty("iso_3166_1") @SerialName("iso_3166_1") val country: String? = null,
@JsonProperty("release_dates") @SerialName("release_dates") val releaseDates: List<TmdbReleaseDateEntry>? = null,
)

@Serializable
data class TmdbReleaseDates(
@SerialName("results") val results: List<TmdbReleaseDateResult>? = null,
@JsonProperty("results") @SerialName("results") val results: List<TmdbReleaseDateResult>? = null,
)

@Serializable
data class TmdbTvDetail(
@SerialName("id") val id: Int? = null,
@SerialName("name") val name: String? = null,
@SerialName("original_name") val originalName: String? = null,
@SerialName("overview") val overview: String? = null,
@SerialName("poster_path") val posterPath: String? = null,
@SerialName("first_air_date") val firstAirDate: String? = null,
@SerialName("vote_average") val voteAverage: Double? = null,
@SerialName("genres") val genres: List<TmdbGenre>? = null,
@SerialName("episode_run_time") val episodeRunTime: List<Int>? = null,
@SerialName("seasons") val seasons: List<TmdbSeasonSummary>? = null,
@SerialName("external_ids") val externalIds: TmdbIds? = null,
@SerialName("videos") val videos: TmdbVideos? = null,
@SerialName("credits") val credits: TmdbCredits? = null,
@SerialName("recommendations") val recommendations: TmdbPageResult<TmdbSearchResult>? = null,
@SerialName("similar") val similar: TmdbPageResult<TmdbSearchResult>? = null,
@SerialName("content_ratings") val contentRatings: TmdbContentRatings? = null,
@JsonProperty("id") @SerialName("id") val id: Int? = null,
@JsonProperty("name") @SerialName("name") val name: String? = null,
@JsonProperty("original_name") @SerialName("original_name") val originalName: String? = null,
@JsonProperty("overview") @SerialName("overview") val overview: String? = null,
@JsonProperty("poster_path") @SerialName("poster_path") val posterPath: String? = null,
@JsonProperty("first_air_date") @SerialName("first_air_date") val firstAirDate: String? = null,
@JsonProperty("vote_average") @SerialName("vote_average") val voteAverage: Double? = null,
@JsonProperty("genres") @SerialName("genres") val genres: List<TmdbGenre>? = null,
@JsonProperty("episode_run_time") @SerialName("episode_run_time") val episodeRunTime: List<Int>? = null,
@JsonProperty("seasons") @SerialName("seasons") val seasons: List<TmdbSeasonSummary>? = null,
@JsonProperty("external_ids") @SerialName("external_ids") val externalIds: TmdbIds? = null,
@JsonProperty("videos") @SerialName("videos") val videos: TmdbVideos? = null,
@JsonProperty("credits") @SerialName("credits") val credits: TmdbCredits? = null,
@JsonProperty("recommendations") @SerialName("recommendations") val recommendations: TmdbPageResult<TmdbSearchResult>? = null,
@JsonProperty("similar") @SerialName("similar") val similar: TmdbPageResult<TmdbSearchResult>? = null,
@JsonProperty("content_ratings") @SerialName("content_ratings") val contentRatings: TmdbContentRatings? = null,
) {
val displayTitle get() = name ?: originalName ?: ""
val year get() = firstAirDate?.take(4)?.toIntOrNull()
}

@Serializable
data class TmdbMovieDetail(
@SerialName("id") val id: Int? = null,
@SerialName("title") val title: String? = null,
@SerialName("original_title") val originalTitle: String? = null,
@SerialName("overview") val overview: String? = null,
@SerialName("poster_path") val posterPath: String? = null,
@SerialName("release_date") val releaseDate: String? = null,
@SerialName("vote_average") val voteAverage: Double? = null,
@SerialName("genres") val genres: List<TmdbGenre>? = null,
@SerialName("runtime") val runtime: Int? = null,
@SerialName("imdb_id") val imdbId: String? = null,
@SerialName("external_ids") val externalIds: TmdbIds? = null,
@SerialName("videos") val videos: TmdbVideos? = null,
@SerialName("credits") val credits: TmdbCredits? = null,
@SerialName("recommendations") val recommendations: TmdbPageResult<TmdbSearchResult>? = null,
@SerialName("similar") val similar: TmdbPageResult<TmdbSearchResult>? = null,
@SerialName("release_dates") val releaseDates: TmdbReleaseDates? = null,
@JsonProperty("id") @SerialName("id") val id: Int? = null,
@JsonProperty("title") @SerialName("title") val title: String? = null,
@JsonProperty("original_title") @SerialName("original_title") val originalTitle: String? = null,
@JsonProperty("overview") @SerialName("overview") val overview: String? = null,
@JsonProperty("poster_path") @SerialName("poster_path") val posterPath: String? = null,
@JsonProperty("release_date") @SerialName("release_date") val releaseDate: String? = null,
@JsonProperty("vote_average") @SerialName("vote_average") val voteAverage: Double? = null,
@JsonProperty("genres") @SerialName("genres") val genres: List<TmdbGenre>? = null,
@JsonProperty("runtime") @SerialName("runtime") val runtime: Int? = null,
@JsonProperty("imdb_id") @SerialName("imdb_id") val imdbId: String? = null,
@JsonProperty("external_ids") @SerialName("external_ids") val externalIds: TmdbIds? = null,
@JsonProperty("videos") @SerialName("videos") val videos: TmdbVideos? = null,
@JsonProperty("credits") @SerialName("credits") val credits: TmdbCredits? = null,
@JsonProperty("recommendations") @SerialName("recommendations") val recommendations: TmdbPageResult<TmdbSearchResult>? = null,
@JsonProperty("similar") @SerialName("similar") val similar: TmdbPageResult<TmdbSearchResult>? = null,
@JsonProperty("release_dates") @SerialName("release_dates") val releaseDates: TmdbReleaseDates? = null,
) {
val displayTitle get() = title ?: originalTitle ?: ""
val year get() = releaseDate?.take(4)?.toIntOrNull()
Expand Down