exts: Small Refactor.
This commit is contained in:
parent
0c70c755f0
commit
e6db533c71
18 changed files with 78 additions and 56 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -62,6 +62,8 @@ class AnimeUAProvider : MainAPI() {
|
||||||
val title = this.selectFirst(titleSelector)?.text()?.trim().toString()
|
val title = this.selectFirst(titleSelector)?.text()?.trim().toString()
|
||||||
val href = this.selectFirst(hrefSelector)?.attr("href").toString()
|
val href = this.selectFirst(hrefSelector)?.attr("href").toString()
|
||||||
val posterUrl = mainUrl + this.selectFirst(posterSelector)?.attr("data-src")
|
val posterUrl = mainUrl + this.selectFirst(posterSelector)?.attr("data-src")
|
||||||
|
|
||||||
|
// TODO: Use it
|
||||||
val status = this.select(".poster__label").text()
|
val status = this.select(".poster__label").text()
|
||||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||||
this.posterUrl = posterUrl
|
this.posterUrl = posterUrl
|
||||||
|
@ -118,7 +120,7 @@ class AnimeUAProvider : MainAPI() {
|
||||||
// Return to app
|
// Return to app
|
||||||
// Parse Episodes as Series
|
// Parse Episodes as Series
|
||||||
return if (tvType == TvType.Anime || tvType == TvType.OVA) {
|
return if (tvType == TvType.Anime || tvType == TvType.OVA) {
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||||
.substringAfterLast("file:\'")
|
.substringAfterLast("file:\'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
@ -126,7 +128,7 @@ class AnimeUAProvider : MainAPI() {
|
||||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for(season in dubs.folder){ // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for(episode in season.folder){ // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.google.code.gson:gson:2.9.0")
|
implementation("com.google.code.gson:gson:2.9.0")
|
||||||
|
|
|
@ -121,15 +121,15 @@ class BambooUAProvider : MainAPI() {
|
||||||
it.toSearchResponse()
|
it.toSearchResponse()
|
||||||
}
|
}
|
||||||
|
|
||||||
var subEpisodes: List<Episode> = emptyList()
|
val subEpisodes = mutableListOf<Episode>()
|
||||||
var dubEpisodes: List<Episode> = emptyList()
|
val dubEpisodes = mutableListOf<Episode>()
|
||||||
|
|
||||||
// Parse episodes (sub/dub)
|
// Parse episodes (sub/dub)
|
||||||
document.select(".mt-4").forEach {
|
document.select(".mt-4").forEach {
|
||||||
// Parse sub
|
// Parse sub
|
||||||
if(it.select("h3.my-4").text() == "Субтитри"){
|
if(it.select("h3.my-4").text() == "Субтитри"){
|
||||||
it.select("span.play_me").forEach{ episode ->
|
it.select("span.play_me").forEach{ episode ->
|
||||||
subEpisodes = subEpisodes.plus(
|
subEpisodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
episode.attr("data-file"),
|
episode.attr("data-file"),
|
||||||
episode.attr("data-title"),
|
episode.attr("data-title"),
|
||||||
|
@ -140,7 +140,7 @@ class BambooUAProvider : MainAPI() {
|
||||||
// Parse dub
|
// Parse dub
|
||||||
} else if(it.select("h3.my-4").text() == "Озвучення"){
|
} else if(it.select("h3.my-4").text() == "Озвучення"){
|
||||||
it.select("span.play_me").forEach{ episode ->
|
it.select("span.play_me").forEach{ episode ->
|
||||||
dubEpisodes = dubEpisodes.plus(
|
dubEpisodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
episode.attr("data-file"),
|
episode.attr("data-file"),
|
||||||
episode.attr("data-title"),
|
episode.attr("data-title"),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
page: Int,
|
page: Int,
|
||||||
request: MainPageRequest
|
request: MainPageRequest
|
||||||
): HomePageResponse {
|
): HomePageResponse {
|
||||||
var document = app.get(request.data + page).document
|
val document = app.get(request.data + page).document
|
||||||
|
|
||||||
val home = document.select("article.short").map {
|
val home = document.select("article.short").map {
|
||||||
it.toSearchResponse()
|
it.toSearchResponse()
|
||||||
|
@ -57,7 +57,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
|
|
||||||
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,
|
||||||
data = mapOf(
|
data = mapOf(
|
||||||
"do" to "search",
|
"do" to "search",
|
||||||
"subaction" to "search",
|
"subaction" to "search",
|
||||||
|
@ -74,18 +74,18 @@ class EneyidaProvider : MainAPI() {
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
// Parse info
|
// Parse info
|
||||||
val full_info = document.select(".full_info li")
|
val fullInfo = document.select(".full_info li")
|
||||||
val title = document.selectFirst("div.full_header-title h1")?.text()?.trim().toString()
|
val title = document.selectFirst("div.full_header-title h1")?.text()?.trim().toString()
|
||||||
val poster = mainUrl + document.selectFirst(".full_content-poster img")?.attr("src")
|
val poster = mainUrl + document.selectFirst(".full_content-poster img")?.attr("src")
|
||||||
val tags = full_info[1].select("a").map { it.text() }
|
val tags = fullInfo[1].select("a").map { it.text() }
|
||||||
val year = full_info[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 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()
|
||||||
val actors = full_info[4].select("a").map { it.text() }
|
val actors = fullInfo[4].select("a").map { it.text() }
|
||||||
|
|
||||||
val recommendations = document.select(".short.related_item").map {
|
val recommendations = document.select(".short.related_item").map {
|
||||||
it.toSearchResponse()
|
it.toSearchResponse()
|
||||||
|
@ -94,7 +94,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
// Return to app
|
// Return to app
|
||||||
// Parse Episodes as Series
|
// Parse Episodes as Series
|
||||||
return if (tvType == TvType.TvSeries) {
|
return if (tvType == TvType.TvSeries) {
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||||
.substringAfterLast("file:\'")
|
.substringAfterLast("file:\'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
@ -102,7 +102,7 @@ class EneyidaProvider : MainAPI() {
|
||||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for(season in dubs.folder){ // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for(episode in season.folder){ // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -1,12 +1,25 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.Episode
|
||||||
import com.lagradost.models.PlayerJson
|
import com.lagradost.cloudstream3.HomePageResponse
|
||||||
|
import com.lagradost.cloudstream3.LoadResponse
|
||||||
|
import com.lagradost.cloudstream3.MainAPI
|
||||||
|
import com.lagradost.cloudstream3.MainPageRequest
|
||||||
|
import com.lagradost.cloudstream3.SearchResponse
|
||||||
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
|
import com.lagradost.cloudstream3.TvType
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.mainPageOf
|
||||||
|
import com.lagradost.cloudstream3.newHomePageResponse
|
||||||
|
import com.lagradost.cloudstream3.newMovieLoadResponse
|
||||||
|
import com.lagradost.cloudstream3.newMovieSearchResponse
|
||||||
|
import com.lagradost.cloudstream3.newTvSeriesLoadResponse
|
||||||
|
import com.lagradost.cloudstream3.toRatingInt
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils
|
import com.lagradost.cloudstream3.utils.AppUtils
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
import com.lagradost.cloudstream3.utils.Qualities
|
import com.lagradost.models.PlayerJson
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class KinoTronProvider : MainAPI() {
|
class KinoTronProvider : MainAPI() {
|
||||||
|
@ -80,7 +93,7 @@ class KinoTronProvider : MainAPI() {
|
||||||
// Parse info
|
// Parse info
|
||||||
val title = document.select(".full h1").text()
|
val title = document.select(".full h1").text()
|
||||||
val poster = mainUrl + document.select(".img-box img").attr("data-src")
|
val poster = mainUrl + document.select(".img-box img").attr("data-src")
|
||||||
var tags = document.select(".flist li")[2].select("a").map { it.text() }
|
val tags = document.select(".flist li")[2].select("a").map { it.text() }
|
||||||
|
|
||||||
val year = document.select(".flist li")[0].select("a").text().toIntOrNull()
|
val year = document.select(".flist li")[0].select("a").text().toIntOrNull()
|
||||||
|
|
||||||
|
@ -99,14 +112,13 @@ class KinoTronProvider : MainAPI() {
|
||||||
val rating = document.selectFirst(".fqualityimdb")?.text().toRatingInt()
|
val rating = document.selectFirst(".fqualityimdb")?.text().toRatingInt()
|
||||||
|
|
||||||
// Parse episodes
|
// Parse episodes
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerUrl = document.select("div.video-box iframe").attr("data-src")
|
val playerUrl = document.select("div.video-box iframe").attr("data-src")
|
||||||
if (playerUrl.contains("/vod/")) { tvType = TvType.Movie }
|
if (playerUrl.contains("/vod/")) { tvType = TvType.Movie }
|
||||||
Log.d("load-debug", playerUrl)
|
Log.d("load-debug", playerUrl)
|
||||||
// Return to app
|
// Return to app
|
||||||
// Parse Episodes as Series
|
// Parse Episodes as Series
|
||||||
return if (tvType == TvType.TvSeries || tvType == TvType.Anime) {
|
return if (tvType == TvType.TvSeries || tvType == TvType.Anime) {
|
||||||
var episodes: List<Episode> = emptyList()
|
|
||||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||||
.substringAfterLast("file:\'")
|
.substringAfterLast("file:\'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
@ -114,7 +126,7 @@ class KinoTronProvider : MainAPI() {
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for(season in dubs.folder){ // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for(episode in season.folder){ // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -88,13 +88,12 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
val rating = document.selectFirst(".dd-imdb-colours")?.text().toRatingInt()
|
val rating = document.selectFirst(".dd-imdb-colours")?.text().toRatingInt()
|
||||||
|
|
||||||
// Parse episodes
|
// Parse episodes
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerUrl = document.select(".video-responsive > iframe").attr("src")
|
val playerUrl = document.select(".video-responsive > iframe").attr("src")
|
||||||
|
|
||||||
// Return to app
|
// Return to app
|
||||||
// Parse Episodes as Series
|
// Parse Episodes as Series
|
||||||
return if (tvType == TvType.TvSeries) {
|
return if (tvType == TvType.TvSeries) {
|
||||||
var episodes: List<Episode> = emptyList()
|
|
||||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||||
.substringAfterLast("file:\'")
|
.substringAfterLast("file:\'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
@ -102,7 +101,7 @@ class KinoVezhaProvider : MainAPI() {
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for(season in dubs.folder){ // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for(episode in season.folder){ // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -124,7 +124,7 @@ class KlonTVProvider : MainAPI() {
|
||||||
// Return to app
|
// Return to app
|
||||||
// Parse Episodes as Series
|
// Parse Episodes as Series
|
||||||
return if (tvType != TvType.Movie) {
|
return if (tvType != TvType.Movie) {
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||||
.substringAfterLast("file:\'")
|
.substringAfterLast("file:\'")
|
||||||
.substringBefore("\',")
|
.substringBefore("\',")
|
||||||
|
@ -132,7 +132,7 @@ class KlonTVProvider : MainAPI() {
|
||||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for(season in dubs.folder){ // Seasons
|
for(season in dubs.folder){ // Seasons
|
||||||
for(episode in season.folder){ // Episodes
|
for(episode in season.folder){ // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -1,12 +1,23 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
import android.util.Log
|
import com.lagradost.cloudstream3.Episode
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.HomePageResponse
|
||||||
import com.lagradost.models.PlayerJson
|
import com.lagradost.cloudstream3.LoadResponse
|
||||||
|
import com.lagradost.cloudstream3.MainAPI
|
||||||
|
import com.lagradost.cloudstream3.MainPageRequest
|
||||||
|
import com.lagradost.cloudstream3.SearchResponse
|
||||||
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
|
import com.lagradost.cloudstream3.TvType
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.mainPageOf
|
||||||
|
import com.lagradost.cloudstream3.newHomePageResponse
|
||||||
|
import com.lagradost.cloudstream3.newMovieSearchResponse
|
||||||
|
import com.lagradost.cloudstream3.newTvSeriesLoadResponse
|
||||||
|
import com.lagradost.cloudstream3.toRatingInt
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils
|
import com.lagradost.cloudstream3.utils.AppUtils
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
import com.lagradost.cloudstream3.utils.Qualities
|
import com.lagradost.models.PlayerJson
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class SerialnoProvider : MainAPI() {
|
class SerialnoProvider : MainAPI() {
|
||||||
|
@ -81,20 +92,21 @@ class SerialnoProvider : MainAPI() {
|
||||||
val title = document.select(".full h1").text()
|
val title = document.select(".full h1").text()
|
||||||
val poster = document.select(".fposter a").attr("href")
|
val poster = document.select(".fposter a").attr("href")
|
||||||
|
|
||||||
|
val tags = mutableListOf<String>()
|
||||||
// Can be smaller
|
// Can be smaller
|
||||||
if (generalInfo.size > 4) {
|
if (generalInfo.size > 4) {
|
||||||
var tags = document.select(".flist li")[4].select("a").map { it.text() }
|
document.select(".flist li")[4].select("a").map { tags.add(it.text()) }
|
||||||
} else {
|
} else {
|
||||||
var tags = document.select(".flist li")[3].select("a").map { it.text() }
|
document.select(".flist li")[3].select("a").map { tags.add(it.text()) }
|
||||||
}
|
}
|
||||||
val year = document.select(".flist li")[1].select("a").text().toIntOrNull()
|
val year = document.select(".flist li")[1].select("a").text().toIntOrNull()
|
||||||
var tvType = TvType.TvSeries
|
val tvType = TvType.TvSeries
|
||||||
val description = document.select(".full-text").text()
|
val description = document.select(".full-text").text()
|
||||||
// val author = someInfo.select("strong:contains(Студія:)").next().html()
|
// val author = someInfo.select("strong:contains(Студія:)").next().html()
|
||||||
val rating = document.selectFirst(".th-voice")?.text().toRatingInt()
|
val rating = document.selectFirst(".th-voice")?.text().toRatingInt()
|
||||||
|
|
||||||
// Parse episodes
|
// Parse episodes
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
val playerUrl = document.select("div.video-box iframe").attr("src")
|
val playerUrl = document.select("div.video-box iframe").attr("src")
|
||||||
|
|
||||||
// Return to app
|
// Return to app
|
||||||
|
@ -106,7 +118,7 @@ class SerialnoProvider : MainAPI() {
|
||||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||||
for (season in dubs.folder) { // Seasons
|
for (season in dubs.folder) { // Seasons
|
||||||
for (episode in season.folder) { // Episodes
|
for (episode in season.folder) { // Episodes
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.title}, ${episode.title}, $playerUrl",
|
"${season.title}, ${episode.title}, $playerUrl",
|
||||||
episode.title,
|
episode.title,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.google.code.gson:gson:2.9.0")
|
implementation("com.google.code.gson:gson:2.9.0")
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.util.Log
|
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
import com.lagradost.models.GeneralInfo
|
import com.lagradost.models.GeneralInfo
|
||||||
|
@ -36,7 +33,7 @@ class UASerialProvider : MainAPI() {
|
||||||
page: Int,
|
page: Int,
|
||||||
request: MainPageRequest
|
request: MainPageRequest
|
||||||
): HomePageResponse {
|
): HomePageResponse {
|
||||||
var document = app.get(request.data.format(page)).document
|
val document = app.get(request.data.format(page)).document
|
||||||
|
|
||||||
val home = document.select(".row .col").map {
|
val home = document.select(".row .col").map {
|
||||||
it.toSearchResponse()
|
it.toSearchResponse()
|
||||||
|
@ -57,7 +54,7 @@ class UASerialProvider : MainAPI() {
|
||||||
|
|
||||||
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,
|
||||||
data = mapOf(
|
data = mapOf(
|
||||||
"do" to "search",
|
"do" to "search",
|
||||||
"subaction" to "search",
|
"subaction" to "search",
|
||||||
|
@ -77,9 +74,9 @@ class UASerialProvider : MainAPI() {
|
||||||
val titleJson = Gson().fromJson(document.select("script[type*=json]").html(), GeneralInfo::class.java)
|
val titleJson = Gson().fromJson(document.select("script[type*=json]").html(), GeneralInfo::class.java)
|
||||||
|
|
||||||
if(titleJson.type == "Movie"){
|
if(titleJson.type == "Movie"){
|
||||||
val titleJson = Gson().fromJson(document.select("script[type*=json]").html(), GeneralInfoMovie::class.java)
|
val titleJsonMovie = Gson().fromJson(document.select("script[type*=json]").html(), GeneralInfoMovie::class.java)
|
||||||
// Parse info for Serials
|
// Parse info for Serials
|
||||||
val title = titleJson.name
|
val title = titleJsonMovie.name
|
||||||
val poster = mainUrl + document.selectFirst("img.cover")?.attr("src")
|
val poster = mainUrl + document.selectFirst("img.cover")?.attr("src")
|
||||||
val tags = document.select("div.genre div a").map { it.text() }
|
val tags = document.select("div.genre div a").map { it.text() }
|
||||||
val year = document.select("div.release div a").text().toIntOrNull()
|
val year = document.select("div.release div a").text().toIntOrNull()
|
||||||
|
@ -87,7 +84,7 @@ class UASerialProvider : MainAPI() {
|
||||||
val tvType = TvType.Movie
|
val tvType = TvType.Movie
|
||||||
val description = document.selectFirst(".text")?.text()?.trim()
|
val description = document.selectFirst(".text")?.text()?.trim()
|
||||||
val rating = document.select("div.rating__item--imdb div.number").text().toRatingInt()
|
val rating = document.select("div.rating__item--imdb div.number").text().toRatingInt()
|
||||||
val actors = titleJson.actor.map { it.name }
|
val actors = titleJsonMovie.actor.map { it.name }
|
||||||
|
|
||||||
return newMovieLoadResponse(title, url, tvType, url) {
|
return newMovieLoadResponse(title, url, tvType, url) {
|
||||||
this.posterUrl = poster
|
this.posterUrl = poster
|
||||||
|
@ -110,13 +107,13 @@ class UASerialProvider : MainAPI() {
|
||||||
|
|
||||||
val actors = titleJson.partOfTVSeries.actor.map { it.name }
|
val actors = titleJson.partOfTVSeries.actor.map { it.name }
|
||||||
|
|
||||||
var episodes: List<Episode> = emptyList()
|
val episodes = mutableListOf<Episode>()
|
||||||
titleJson.partOfTVSeries.containsSeason.map { season ->
|
titleJson.partOfTVSeries.containsSeason.map { season ->
|
||||||
val documentSeason = app.get(season.url).document
|
val documentSeason = app.get(season.url).document
|
||||||
season.episode.map { episode ->
|
season.episode.map { episode ->
|
||||||
var episodeName = documentSeason.select("div[data-episode-id=${episode.episodeNumber}] div.name").text().replaceFirstChar { it.uppercase() }
|
var episodeName = documentSeason.select("div[data-episode-id=${episode.episodeNumber}] div.name").text().replaceFirstChar { it.uppercase() }
|
||||||
if (episodeName.isBlank()) { episodeName = episode.name.replaceFirstChar { it.uppercase() } }
|
if (episodeName.isBlank()) { episodeName = episode.name.replaceFirstChar { it.uppercase() } }
|
||||||
episodes = episodes.plus(
|
episodes.add(
|
||||||
Episode(
|
Episode(
|
||||||
"${season.url}, ${episode.episodeNumber}",
|
"${season.url}, ${episode.episodeNumber}",
|
||||||
episodeName,
|
episodeName,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -83,7 +83,7 @@ class UFDubProvider : MainAPI() {
|
||||||
// Parse info
|
// Parse info
|
||||||
val title = document.select("h1.top-title").text()
|
val title = document.select("h1.top-title").text()
|
||||||
val poster = mainUrl + document.select("div.f-poster img").attr("src")
|
val poster = mainUrl + document.select("div.f-poster img").attr("src")
|
||||||
var tags = emptyList<String>()
|
val tags = mutableListOf<String>()
|
||||||
val year = someInfo.select("strong:contains(Рік випуску аніме:)").next().html().toIntOrNull()
|
val year = someInfo.select("strong:contains(Рік випуску аніме:)").next().html().toIntOrNull()
|
||||||
|
|
||||||
// TODO: Check type by url
|
// TODO: Check type by url
|
||||||
|
@ -101,7 +101,7 @@ class UFDubProvider : MainAPI() {
|
||||||
ele ->
|
ele ->
|
||||||
when (ele.select("span").text()) {
|
when (ele.select("span").text()) {
|
||||||
//"Студія:" -> tags = ele.select("a").text().split(" / ")
|
//"Студія:" -> tags = ele.select("a").text().split(" / ")
|
||||||
"Жанр:" -> ele.select("a").map { tags = tags.plus(it.text()) }
|
"Жанр:" -> ele.select("a").map { tags.add(it.text()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue