exts: Fix player parsing
This commit is contained in:
parent
ac28139783
commit
aec0fb49eb
12 changed files with 99 additions and 78 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 8
|
version = 9
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import com.lagradost.models.PlayerJson
|
import com.lagradost.models.PlayerJson
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||||
|
@ -17,6 +16,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
override var name = "Eneyida"
|
override var name = "Eneyida"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override var lang = "uk"
|
override var lang = "uk"
|
||||||
|
override val hasQuickSearch = true
|
||||||
override val hasDownloadSupport = true
|
override val hasDownloadSupport = true
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.Movie,
|
TvType.Movie,
|
||||||
|
@ -56,6 +56,8 @@ class EneyidaProvider : MainAPI() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override suspend fun quickSearch(query: String): List<SearchResponse> = search(query)
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val document = app.post(
|
val document = app.post(
|
||||||
url = mainUrl,
|
url = mainUrl,
|
||||||
|
@ -83,7 +85,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
val year = fullInfo[0].select("a").text().toIntOrNull()
|
val year = fullInfo[0].select("a").text().toIntOrNull()
|
||||||
val playerUrl = document.select(".tabs_b.visible iframe").attr("src")
|
val playerUrl = document.select(".tabs_b.visible iframe").attr("src")
|
||||||
|
|
||||||
val tvType = if (tags.contains("фільм") or playerUrl.contains("/vod/")) TvType.Movie else TvType.TvSeries
|
val tvType = if (tags.contains("фільм") or tags.contains("мультьфільм") or playerUrl.contains("/vod/")) TvType.Movie else TvType.TvSeries
|
||||||
val description = document.selectFirst(".full_content-desc p")?.text()?.trim()
|
val description = document.selectFirst(".full_content-desc p")?.text()?.trim()
|
||||||
val trailer = document.selectFirst("div#trailer_place iframe")?.attr("src").toString()
|
val trailer = document.selectFirst("div#trailer_place iframe")?.attr("src").toString()
|
||||||
val rating = document.selectFirst(".r_kp span, .r_imdb span")?.text().toRatingInt()
|
val rating = document.selectFirst(".r_kp span, .r_imdb span")?.text().toRatingInt()
|
||||||
|
@ -101,16 +103,16 @@ class EneyidaProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for (episode in season.folder) { // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for (dubs in episode.folder) { // Episodes
|
||||||
episodes.add(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
season.title.replace(" Сезон ","").toIntOrNull(),
|
season.title.replace(" сезон","").toIntOrNull(),
|
||||||
episode.title.replace("Серія ","").toIntOrNull(),
|
episode.title.replace(" серія","").toIntOrNull(),
|
||||||
episode.poster
|
dubs.poster
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -118,7 +120,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||||
this.posterUrl = poster
|
this.posterUrl = poster
|
||||||
this.backgroundPosterUrl = banner
|
this.backgroundPosterUrl = "$mainUrl$banner"
|
||||||
this.year = year
|
this.year = year
|
||||||
this.plot = description
|
this.plot = description
|
||||||
this.tags = tags
|
this.tags = tags
|
||||||
|
@ -130,7 +132,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
} else { // Parse as Movie.
|
} else { // Parse as Movie.
|
||||||
newMovieLoadResponse(title, url, TvType.Movie, "$title, $playerUrl") {
|
newMovieLoadResponse(title, url, TvType.Movie, "$title, $playerUrl") {
|
||||||
this.posterUrl = poster
|
this.posterUrl = poster
|
||||||
this.backgroundPosterUrl = banner
|
this.backgroundPosterUrl = "$mainUrl$banner"
|
||||||
this.year = year
|
this.year = year
|
||||||
this.plot = description
|
this.plot = description
|
||||||
this.tags = tags
|
this.tags = tags
|
||||||
|
@ -180,28 +182,26 @@ class EneyidaProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
|
||||||
for(season in dubs.folder){ // Seasons
|
if(season.title != dataList[0]) return@map
|
||||||
if(season.title == dataList[0]){
|
|
||||||
for(episode in season.folder){ // Episodes
|
|
||||||
if(episode.title == dataList[1]){
|
|
||||||
// Add as source
|
|
||||||
M3u8Helper.generateM3u8(
|
|
||||||
source = dubs.title,
|
|
||||||
streamUrl = episode.file.replace("https://", "http://"),
|
|
||||||
referer = "https://tortuga.wtf/"
|
|
||||||
).last().let(callback)
|
|
||||||
|
|
||||||
if(episode.subtitle.isBlank()) return@map
|
for (episode in season.folder) {
|
||||||
episode.subtitle.split(",").forEach{
|
if(episode.title != dataList[1]) return@map
|
||||||
subtitleCallback.invoke(
|
|
||||||
SubtitleFile(
|
for (dubs in episode.folder) {
|
||||||
it.substringAfterLast("[").substringBefore("]"),
|
M3u8Helper.generateM3u8(
|
||||||
it.substringAfter("]")
|
source = dubs.title,
|
||||||
)
|
streamUrl = dubs.file,
|
||||||
)
|
referer = "https://tortuga.wtf/"
|
||||||
}
|
).last().let(callback)
|
||||||
}
|
|
||||||
|
if(dubs.subtitle.isNullOrBlank()) {
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
|
||||||
|
dubs.subtitle.substringAfter("]")
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,14 @@ package com.lagradost.models
|
||||||
data class PlayerJson (
|
data class PlayerJson (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val season : Int,
|
||||||
val folder : List<Season>
|
val folder : List<Season>
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Season (
|
data class Season (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val number: Int,
|
||||||
val folder : List<Episode>
|
val folder : List<Episode>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 5
|
version = 6
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
|
|
|
@ -14,6 +14,7 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
override var name = "KinoVezha"
|
override var name = "KinoVezha"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override var lang = "uk"
|
override var lang = "uk"
|
||||||
|
override val hasQuickSearch = true
|
||||||
override val hasDownloadSupport = true
|
override val hasDownloadSupport = true
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.Movie,
|
TvType.Movie,
|
||||||
|
@ -53,6 +54,8 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override suspend fun quickSearch(query: String): List<SearchResponse> = search(query)
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val document = app.post(
|
val document = app.post(
|
||||||
url = "$mainUrl/index.php?do=search",
|
url = "$mainUrl/index.php?do=search",
|
||||||
|
@ -95,16 +98,16 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for (episode in season.folder) { // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for (dubs in episode.folder) { // Episodes
|
||||||
episodes.add(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
season.title.replace(" Сезон ","").toIntOrNull(),
|
season.season,
|
||||||
episode.title.replace("Серія ","").toIntOrNull(),
|
episode.number,
|
||||||
episode.poster
|
dubs.poster
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -156,18 +159,26 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
|
||||||
for(season in dubs.folder){ // Seasons
|
if(season.title != dataList[0]) return@map
|
||||||
if(season.title == dataList[0]){
|
|
||||||
for(episode in season.folder){ // Episodes
|
for (episode in season.folder) {
|
||||||
if(episode.title == dataList[1]){
|
if(episode.title != dataList[1]) return@map
|
||||||
// Add as source
|
|
||||||
M3u8Helper.generateM3u8(
|
for (dubs in episode.folder) {
|
||||||
source = dubs.title,
|
M3u8Helper.generateM3u8(
|
||||||
streamUrl = episode.file,
|
source = dubs.title,
|
||||||
referer = "https://tortuga.wtf/"
|
streamUrl = dubs.file,
|
||||||
).last().let(callback)
|
referer = "https://tortuga.wtf/"
|
||||||
}
|
).last().let(callback)
|
||||||
|
|
||||||
|
if(dubs.subtitle.isNullOrBlank()) {
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
|
||||||
|
dubs.subtitle.substringAfter("]")
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,14 @@ package com.lagradost.models
|
||||||
data class PlayerJson (
|
data class PlayerJson (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val season : Int,
|
||||||
val folder : List<Season>
|
val folder : List<Season>
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Season (
|
data class Season (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val number: Int,
|
||||||
val folder : List<Episode>
|
val folder : List<Episode>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 6
|
version = 7
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
|
|
|
@ -10,7 +10,7 @@ data class GeneralInfo (
|
||||||
val isFamilyFriendly : Boolean,
|
val isFamilyFriendly : Boolean,
|
||||||
val timeRequired : Int,
|
val timeRequired : Int,
|
||||||
val datePublished : String,
|
val datePublished : String,
|
||||||
val director : List<Director>,
|
val director : List<Director>?,
|
||||||
val actor : List<Actor>,
|
val actor : List<Actor>,
|
||||||
val countryOfOrigin : List<CountryOfOrigin>,
|
val countryOfOrigin : List<CountryOfOrigin>,
|
||||||
val aggregateRating : AggregateRating?,
|
val aggregateRating : AggregateRating?,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 6
|
version = 7
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
|
|
|
@ -27,6 +27,7 @@ class SerialnoProvider : MainAPI() {
|
||||||
override var name = "Serialno"
|
override var name = "Serialno"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override var lang = "uk"
|
override var lang = "uk"
|
||||||
|
override val hasQuickSearch = true
|
||||||
override val hasDownloadSupport = true
|
override val hasDownloadSupport = true
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.Movie,
|
TvType.Movie,
|
||||||
|
@ -66,6 +67,8 @@ class SerialnoProvider : MainAPI() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override suspend fun quickSearch(query: String): List<SearchResponse> = search(query)
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val document = app.post(
|
val document = app.post(
|
||||||
url = "$mainUrl/",
|
url = "$mainUrl/",
|
||||||
|
@ -115,16 +118,16 @@ class SerialnoProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season -> // Dubs
|
||||||
for (season in dubs.folder) { // Seasons
|
for (episode in season.folder) { // Seasons
|
||||||
for (episode in season.folder) { // Episodes
|
for (dubs in episode.folder) { // Episodes
|
||||||
episodes.add(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
season.title.replace(" Сезон ", "").toIntOrNull(),
|
season.season,
|
||||||
episode.title.replace("Серія ", "").toIntOrNull(),
|
episode.number,
|
||||||
episode.poster
|
dubs.poster
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -153,26 +156,26 @@ class SerialnoProvider : MainAPI() {
|
||||||
.substringAfterLast("file: \'")
|
.substringAfterLast("file: \'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { season ->
|
||||||
for(season in dubs.folder){ // Seasons
|
if(season.title != dataList[0]) return@map
|
||||||
if(season.title == dataList[0]){
|
|
||||||
for(episode in season.folder){ // Episodes
|
|
||||||
if(episode.title == dataList[1]){
|
|
||||||
// Add as source
|
|
||||||
M3u8Helper.generateM3u8(
|
|
||||||
source = dubs.title,
|
|
||||||
streamUrl = episode.file,
|
|
||||||
referer = "https://tortuga.wtf/"
|
|
||||||
).last().let(callback)
|
|
||||||
|
|
||||||
if(episode.subtitle.isNullOrBlank()) return true
|
for (episode in season.folder) {
|
||||||
subtitleCallback.invoke(
|
if(episode.title != dataList[1]) return@map
|
||||||
SubtitleFile(
|
|
||||||
episode.subtitle.substringAfterLast("[").substringBefore("]"),
|
for (dubs in episode.folder) {
|
||||||
episode.subtitle.substringAfter("]")
|
M3u8Helper.generateM3u8(
|
||||||
)
|
source = dubs.title,
|
||||||
|
streamUrl = dubs.file,
|
||||||
|
referer = "https://tortuga.wtf/"
|
||||||
|
).last().let(callback)
|
||||||
|
|
||||||
|
if(dubs.subtitle.isNullOrBlank()) {
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
dubs.subtitle.substringAfterLast("[").substringBefore("]"),
|
||||||
|
dubs.subtitle.substringAfter("]")
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,14 @@ package com.lagradost.models
|
||||||
data class PlayerJson (
|
data class PlayerJson (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val season : Int,
|
||||||
val folder : List<Season>
|
val folder : List<Season>
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Season (
|
data class Season (
|
||||||
|
|
||||||
val title : String,
|
val title : String,
|
||||||
|
val number: Int,
|
||||||
val folder : List<Episode>
|
val folder : List<Episode>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
import com.lagradost.cloudstreamtest.ProviderTester
|
import com.lagradost.cloudstreamtest.ProviderTester
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
Loading…
Reference in a new issue