exts: Test all providers and fix them
All checks were successful
Build / build (push) Successful in 4m56s
All checks were successful
Build / build (push) Successful in 4m56s
This commit is contained in:
parent
9a71bccfcf
commit
63d65acdf3
26 changed files with 26 additions and 661 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 10
|
||||
version = 11
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.junit)
|
||||
|
|
|
@ -2,10 +2,10 @@ package com.lagradost
|
|||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||
import com.lagradost.cloudstream3.extractors.Mp4Upload
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
import com.lagradost.cloudstream3.utils.getExtractorApiFromName
|
||||
import com.lagradost.extractors.AshdiExtractor
|
||||
import com.lagradost.extractors.csstExtractor
|
||||
import com.lagradost.models.Ajax
|
||||
|
@ -233,7 +233,7 @@ class AnitubeinuaProvider : MainAPI() {
|
|||
}
|
||||
}
|
||||
it.urls.url.contains("https://www.mp4upload.com/") -> {
|
||||
Mp4Upload().getUrl(it.urls.url)?.forEach { extlink ->
|
||||
getExtractorApiFromName("Mp4Upload").getUrl(it.urls.url)?.forEach { extlink ->
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
extlink.source,
|
||||
|
@ -309,7 +309,7 @@ class AnitubeinuaProvider : MainAPI() {
|
|||
}
|
||||
}
|
||||
contains("https://www.mp4upload.com/") -> {
|
||||
Mp4Upload().getUrl(this)?.forEach { extlink ->
|
||||
getExtractorApiFromName("Mp4Upload").getUrl(this)?.forEach { extlink ->
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
extlink.source,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.junit)
|
||||
|
|
|
@ -96,11 +96,11 @@ class KinoTronProvider : MainAPI() {
|
|||
|
||||
val year = document.select(".flist li")[0].select("a").text().toIntOrNull()
|
||||
|
||||
var tvType = with(document.select(".fsubtitle").text()) {
|
||||
var tvType = with(document.select("div.fsubtitle").text()) {
|
||||
when {
|
||||
contains("аніме") -> TvType.Anime
|
||||
contains("серіал") -> TvType.TvSeries
|
||||
contains("мультсеріал") -> TvType.Cartoon
|
||||
contains("Аніме") -> TvType.Anime
|
||||
contains("Серіал") -> TvType.TvSeries
|
||||
contains("Мультсеріал") -> TvType.Cartoon
|
||||
else -> {
|
||||
TvType.Movie
|
||||
}
|
||||
|
@ -168,8 +168,8 @@ class KinoTronProvider : MainAPI() {
|
|||
// Its film, parse one m3u8
|
||||
if(dataList.size == 2){
|
||||
val m3u8Url = app.get(dataList[1]).document.select("script").html()
|
||||
.substringAfterLast("file:\"")
|
||||
.substringBefore("\",")
|
||||
.substringAfterLast("file:\'")
|
||||
.substringBefore("\',")
|
||||
M3u8Helper.generateM3u8(
|
||||
source = dataList[0],
|
||||
streamUrl = m3u8Url,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.junit)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.api.Log
|
||||
import com.lagradost.cloudstream3.Episode
|
||||
import com.lagradost.cloudstream3.HomePageResponse
|
||||
import com.lagradost.cloudstream3.LoadResponse
|
||||
|
@ -149,7 +148,7 @@ class SerialnoProvider : MainAPI() {
|
|||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val dataList = data.split(", ")
|
||||
Log.d("CakesTwix-Debug", data)
|
||||
|
||||
val playerRawJson = app.get(dataList[2]).document.select("script").html()
|
||||
.substringAfterLast("file: \'")
|
||||
.substringBefore("\',")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
dependencies {
|
||||
implementation(libs.gson)
|
||||
|
|
|
@ -60,7 +60,7 @@ class TeleportalProvider : MainAPI() {
|
|||
// Movies
|
||||
if(request.data.substringAfterLast("/") == "documentaries"){
|
||||
val homeList = Gson().fromJson(app.get(request.data).text, Media::class.java).items.map{
|
||||
newAnimeSearchResponse(it.title, "$apiUrl/ua${it.videoSlug}", TvType.TvSeries) {
|
||||
newAnimeSearchResponse(it.title, "$apiUrl/ua/${it.videoSlug}", TvType.TvSeries) {
|
||||
this.posterUrl = "$mainUrl${it.image}"
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ class TeleportalProvider : MainAPI() {
|
|||
}
|
||||
return newAnimeLoadResponse(
|
||||
title.title,
|
||||
"$mainUrl${title.projectSlug}",
|
||||
"$apiUrl/ua/${title.typeSlug}/${title.channelSlug}/${title.projectSlug}",
|
||||
tvType,
|
||||
) {
|
||||
this.posterUrl = "$mainUrl${title.image}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 10
|
||||
version = 11
|
||||
|
||||
dependencies {
|
||||
implementation(libs.gson)
|
||||
|
|
|
@ -36,7 +36,7 @@ open class UASerialProvider(url: String, name: String) : MainAPI() {
|
|||
): HomePageResponse {
|
||||
val document = app.get(request.data.format(page)).document
|
||||
|
||||
val home = document.select(".row .col").map {
|
||||
val home = document.select("div[id=filters-grid-content]").select("div.row .col").map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
return newHomePageResponse(request.name, home)
|
||||
|
@ -183,6 +183,7 @@ open class UASerialProvider(url: String, name: String) : MainAPI() {
|
|||
.substringBefore("',")
|
||||
}
|
||||
|
||||
if (!m3u8Url.startsWith("http")) return@map
|
||||
M3u8Helper.generateM3u8(
|
||||
source = "${dub.text()} (${player.attr("data-player-id").replaceFirstChar { it.uppercase() }})",
|
||||
streamUrl = m3u8Url,
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.kotlinx.coroutines.test)
|
||||
}
|
||||
|
||||
cloudstream {
|
||||
language = "uk"
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = "Наша мета — популяризація нашої рідної мови, шляхом збору в одному місці величезної колекції найкращих і найпопулярніших фільмів, серіалів, мультфільмів та мультсеріалів українською мовою, які ви можете дивитися онлайн в HD якості безкоштовно. Приємного перегляду!"
|
||||
authors = listOf("CakesTwix")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 0 // will be 3 if unspecified
|
||||
tvTypes = listOf(
|
||||
"Cartoon",
|
||||
"TvSeries",
|
||||
"Anime",
|
||||
)
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=uaserials.vip&sz=%size%"
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
|
@ -1,182 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.models.PlayerJson
|
||||
import com.lagradost.cloudstream3.utils.AppUtils
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class UAserialsVipProvider : MainAPI() {
|
||||
|
||||
// Basic Info
|
||||
override var mainUrl = "https://uaserials.vip"
|
||||
override var name = "UAserialsVip"
|
||||
override val hasMainPage = true
|
||||
override var lang = "uk"
|
||||
override val hasDownloadSupport = true
|
||||
override val supportedTypes = setOf(
|
||||
TvType.Cartoon,
|
||||
TvType.TvSeries,
|
||||
TvType.Anime
|
||||
)
|
||||
|
||||
// Sections
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/series/page/" to "Серіали",
|
||||
"$mainUrl/cartoons/page/" to "Мультфільми",
|
||||
"$mainUrl/anime/page/" to "Аніме",
|
||||
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(
|
||||
page: Int,
|
||||
request: MainPageRequest
|
||||
): HomePageResponse {
|
||||
val document = app.get(request.data + page).document
|
||||
|
||||
// Delete popular items
|
||||
document.select(".sect--top").remove()
|
||||
val home = document.select(".poster-item").map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
return newHomePageResponse(request.name, home)
|
||||
}
|
||||
|
||||
private fun Element.toSearchResponse(): SearchResponse {
|
||||
val title = this.select("div.poster-item__title").text()
|
||||
val href = this.select("a.poster-item").attr("href").toString()
|
||||
val posterUrl = mainUrl + this.select(".img-responsive > img").attr("data-src")
|
||||
|
||||
return newMovieSearchResponse(title, href, TvType.TvSeries) {
|
||||
this.posterUrl = posterUrl
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val document = app.post(
|
||||
url = "$mainUrl/index.php?do=search",
|
||||
data = mapOf(
|
||||
"do" to "search",
|
||||
"subaction" to "search",
|
||||
"story" to query.replace(" ", "+")
|
||||
)
|
||||
).document
|
||||
|
||||
return document.select(".movie-item").map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
}
|
||||
|
||||
// Detailed information
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val document = app.get(url).document
|
||||
|
||||
// Parse info
|
||||
val title = document.select(".page__header h1").text()
|
||||
val poster = mainUrl + document.select(".img-fit-cover img").attr("data-src")
|
||||
var tags = document.select(".page__meta-item--genres a").map { it.text() }
|
||||
|
||||
val year = document.select(".page__year").text().toIntOrNull()
|
||||
val tvType = with(document.select(".page__details .page__subtitle").text()) {
|
||||
when {
|
||||
contains("мультсеріал") -> TvType.Cartoon
|
||||
contains("аніме") -> TvType.Anime // 0 Anime in site, lol
|
||||
else -> {
|
||||
TvType.TvSeries
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val description = document.select(".full-text").text()
|
||||
// val author = someInfo.select("strong:contains(Студія:)").next().html()
|
||||
val rating = document.selectFirst(".page__rating-item--critics div")?.text().toRatingInt()
|
||||
|
||||
val recommendations = document.select(".poster-item").map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
|
||||
// Parse episodes
|
||||
var episodes: List<Episode> = emptyList()
|
||||
val playerUrl = document.select(".video-responsive > iframe").attr("data-src")
|
||||
|
||||
// Return to app
|
||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||
.substringAfterLast("file:\'")
|
||||
.substringBefore("\',")
|
||||
|
||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||
for (season in dubs.folder) { // Seasons
|
||||
for (episode in season.folder) { // Episodes
|
||||
episodes = episodes.plus(
|
||||
Episode(
|
||||
"${season.title}, ${episode.title}, $playerUrl",
|
||||
episode.title,
|
||||
season.title.replace(" Сезон ", "").toIntOrNull(),
|
||||
episode.title.replace("Серія ", "").toIntOrNull(),
|
||||
episode.poster
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newTvSeriesLoadResponse(title, url, tvType, episodes) {
|
||||
this.posterUrl = poster
|
||||
this.year = year
|
||||
this.plot = description
|
||||
this.tags = tags
|
||||
this.rating = rating
|
||||
this.recommendations = recommendations
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// It works when I click to view the series
|
||||
override suspend fun loadLinks(
|
||||
data: String, // (Serisl) [Season, Episode, Player Url] | (Film) [Title, Player Url]
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val dataList = data.split(", ")
|
||||
|
||||
// Its film, parse one m3u8
|
||||
if(dataList.size == 2){
|
||||
val m3u8Url = app.get(dataList[1]).document.select("script").html()
|
||||
.substringAfterLast("file:\"")
|
||||
.substringBefore("\",")
|
||||
M3u8Helper.generateM3u8(
|
||||
source = dataList[0],
|
||||
streamUrl = m3u8Url,
|
||||
referer = "https://tortuga.wtf/"
|
||||
).forEach(callback)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
val playerRawJson = app.get(dataList[2]).document.select("script").html()
|
||||
.substringAfterLast("file:\'")
|
||||
.substringBefore("\',")
|
||||
|
||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||
for(season in dubs.folder){ // Seasons
|
||||
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/"
|
||||
).forEach(callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class UAserialsVipProviderPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(UAserialsVipProvider())
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.lagradost.models
|
||||
|
||||
data class PlayerJson (
|
||||
|
||||
val title : String,
|
||||
val folder : List<Season>
|
||||
)
|
||||
|
||||
data class Season (
|
||||
|
||||
val title : String,
|
||||
val folder : List<Episode>
|
||||
)
|
||||
|
||||
data class Episode (
|
||||
|
||||
val title : String,
|
||||
val file : String,
|
||||
val id : String,
|
||||
val poster : String,
|
||||
val subtitle : String,
|
||||
)
|
|
@ -1,14 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstreamtest.ProviderTester
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class UAserialsVipProviderTest {
|
||||
|
||||
@Test
|
||||
fun testProvider() = runTest {
|
||||
val providerTester = ProviderTester(UAserialsVipProvider())
|
||||
providerTester.testAll()
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 4
|
||||
version = 5
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.junit)
|
||||
|
|
|
@ -130,14 +130,15 @@ class UFDubProvider : MainAPI() {
|
|||
val matchResult = regexUFDubEpisodes.findAll(player)
|
||||
|
||||
// Drop trailers from episodes
|
||||
matchResult.filter { !(Uri.parse(it.value).getQueryParameter("Seriya")!!.contains("Трейлер")) }
|
||||
matchResult.filter { !(it.value.contains("Seriya=") && it.value.contains("Трейлер")) }
|
||||
.forEach { item ->
|
||||
|
||||
val parsedUrl = Uri.parse(item.value)
|
||||
val url = item.value.dropLast(1)
|
||||
val seriya = url.substringAfter("Seriya=", "").substringBefore("&")
|
||||
episodes.add(
|
||||
Episode(
|
||||
item.value.dropLast(1), // Drop '
|
||||
parsedUrl.getQueryParameter("Seriya")!!,
|
||||
url,
|
||||
seriya
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
// use an integer for version numbers
|
||||
version = 2
|
||||
|
||||
dependencies {
|
||||
implementation(libs.gson)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.kotlinx.coroutines.test)
|
||||
}
|
||||
|
||||
cloudstream {
|
||||
language = "uk"
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = "В ОДНЕ РИЛО ЦЕ УКРАЇНСЬКОЮ!"
|
||||
authors = listOf("CakesTwix")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 0 // will be 3 if unspecified
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=vodnerilo.com&sz=%size%"
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
|
@ -1,256 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.AnimeSearchResponse
|
||||
import com.lagradost.cloudstream3.DubStatus
|
||||
import com.lagradost.cloudstream3.Episode
|
||||
import com.lagradost.cloudstream3.HomePageResponse
|
||||
import com.lagradost.cloudstream3.LoadResponse
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
|
||||
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.addDubStatus
|
||||
import com.lagradost.cloudstream3.addEpisodes
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.fixUrl
|
||||
import com.lagradost.cloudstream3.mainPageOf
|
||||
import com.lagradost.cloudstream3.newAnimeLoadResponse
|
||||
import com.lagradost.cloudstream3.newAnimeSearchResponse
|
||||
import com.lagradost.cloudstream3.newHomePageResponse
|
||||
import com.lagradost.cloudstream3.newMovieLoadResponse
|
||||
import com.lagradost.cloudstream3.toRatingInt
|
||||
import com.lagradost.cloudstream3.utils.AppUtils
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
import com.lagradost.models.PlayerJson
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class VodneriloProvider : MainAPI() {
|
||||
|
||||
// Basic Info
|
||||
override var mainUrl = "https://vodnerilo.com"
|
||||
override var name = "Vodnerilo"
|
||||
override val hasMainPage = true
|
||||
override var lang = "uk"
|
||||
override val hasDownloadSupport = true
|
||||
override val supportedTypes = setOf(
|
||||
TvType.TvSeries,
|
||||
TvType.Cartoon,
|
||||
TvType.Movie,
|
||||
TvType.Anime
|
||||
)
|
||||
|
||||
// Sections
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/serialy/page/" to "Серіали",
|
||||
"$mainUrl/multserialy/page/" to "Мультсеріали",
|
||||
"$mainUrl/multfilmy/page/" to "Мультфільми",
|
||||
"$mainUrl/anime/page/" to "Аніме",
|
||||
"$mainUrl/filmy/page/" to "Фільми"
|
||||
)
|
||||
|
||||
// Main Page
|
||||
private val animeSelector = ".short-item"
|
||||
private val titleSelector = ".short-title"
|
||||
// private val engTitleSelector = "div.th-title-oname.truncate"
|
||||
private val hrefSelector = ".short-title"
|
||||
private val posterSelector = "img"
|
||||
|
||||
// Load info
|
||||
// private val titleLoadSelector = ".page__subcol-main h1"
|
||||
// private val genresSelector = "li span:contains(Жанр:) a"
|
||||
// private val yearSelector = "a[href*=https://uaserials.pro/year/]"
|
||||
// private val playerSelector = "iframe"
|
||||
private val descriptionSelector = ".full-text"
|
||||
private val ratingSelector = ".mrating .unit-rating li.current-rating"
|
||||
|
||||
override suspend fun getMainPage(
|
||||
page: Int,
|
||||
request: MainPageRequest
|
||||
): HomePageResponse {
|
||||
val document = app.get(request.data + page).document
|
||||
|
||||
val home = document.select(animeSelector).map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
return newHomePageResponse(request.name, home)
|
||||
}
|
||||
|
||||
private fun Element.toSearchResponse(): AnimeSearchResponse {
|
||||
val title = this.selectFirst(titleSelector)?.text()?.trim().toString()
|
||||
// val engTitle = this.selectFirst(engTitleSelector)?.text()?.trim().toString()
|
||||
val href = this.selectFirst(hrefSelector)?.attr("href").toString()
|
||||
val posterUrl = fixUrl(this.select(posterSelector).attr("src"))
|
||||
|
||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||
// this.otherName = engTitle
|
||||
this.posterUrl = posterUrl
|
||||
addDubStatus(isDub = true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val document = app.post(
|
||||
url = mainUrl,
|
||||
data = mapOf(
|
||||
"do" to "search",
|
||||
"subaction" to "search",
|
||||
"story" to query.replace(" ", "+")
|
||||
)
|
||||
).document
|
||||
|
||||
return document.select(animeSelector).map {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
}
|
||||
|
||||
// Detailed information
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val document = app.get(url).document
|
||||
// Parse info
|
||||
|
||||
val title = document.select(".short-title").text().trim().toString()
|
||||
val engTitle = document.select(".pmovie__original-title").text()
|
||||
val poster = fixUrl(document.select("div.img-wide img").attr("src"))
|
||||
val tags = mutableListOf<String>()
|
||||
val actors = mutableListOf<String>()
|
||||
var year = "0".toRatingInt()
|
||||
|
||||
document.select(".short-list li").forEach { menu ->
|
||||
with(menu){
|
||||
when{
|
||||
this.select("span").text() == "Жанр:" -> menu.ownText().split(", ").map { tags.add(it) }
|
||||
this.select("span").text() == "У ролях:" -> menu.ownText().split(", ").map { actors.add(it) }
|
||||
this.select("span").text() == "Рік виходу:" -> year = menu.ownText().toIntOrNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tvType = with(url){
|
||||
when{
|
||||
contains("serialy") -> TvType.TvSeries
|
||||
contains("multserialy") -> TvType.Cartoon
|
||||
contains("filmy") -> TvType.Movie
|
||||
contains("multfilmy") -> TvType.Movie
|
||||
contains("anime") -> TvType.Anime
|
||||
else -> TvType.TvSeries
|
||||
}
|
||||
}
|
||||
val description = document.selectFirst(descriptionSelector)?.text()?.trim()
|
||||
val rating = document.select(ratingSelector).next().text().toRatingInt()
|
||||
|
||||
// TODO: Fix
|
||||
val recommendations = document.select("div.owl-item").map {
|
||||
val title = it.select(".popular-item-title").text().trim().toString()
|
||||
// val engTitle = this.selectFirst(engTitleSelector)?.text()?.trim().toString()
|
||||
val href = it.select("a.popular-item-img").attr("href").toString()
|
||||
val posterUrl = fixUrl(it.select(".img-fit img").attr("src"))
|
||||
|
||||
newAnimeSearchResponse(title, href, TvType.TvSeries) {
|
||||
// this.otherName = engTitle
|
||||
this.posterUrl = posterUrl
|
||||
addDubStatus(isDub = true)
|
||||
}
|
||||
}
|
||||
|
||||
// Parse episodes
|
||||
val episodes = mutableListOf<Episode>()
|
||||
val playerUrl = document.select("div.video-box iframe").attr("src")
|
||||
if(playerUrl.contains("/serial/") && tvType == TvType.Movie) tvType = TvType.TvSeries
|
||||
if(playerUrl.contains("/vod/") && tvType != TvType.Movie) tvType = TvType.Movie
|
||||
|
||||
// Parse Episodes as Series
|
||||
return if (tvType != TvType.Movie) {
|
||||
val playerRawJson = app.get(playerUrl).document.select("script").html()
|
||||
.substringAfterLast("file:\'")
|
||||
.substringBefore("\',")
|
||||
|
||||
tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||
for(season in dubs.folder){ // Seasons
|
||||
for(episode in season.folder){ // Episodes
|
||||
episodes.add(
|
||||
Episode(
|
||||
"${season.title}, ${episode.title}, $playerUrl",
|
||||
episode.title,
|
||||
season.title.replace(" Сезон ","").toIntOrNull(),
|
||||
episode.title.replace("Серія ","").toIntOrNull(),
|
||||
episode.poster
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
newAnimeLoadResponse(title, url, tvType) {
|
||||
this.posterUrl = poster
|
||||
this.engName = engTitle
|
||||
this.year = year
|
||||
this.plot = description
|
||||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
addEpisodes(DubStatus.Dubbed, episodes)
|
||||
addActors(actors)
|
||||
}
|
||||
} else { // Parse as Movie.
|
||||
|
||||
newMovieLoadResponse(title, url, tvType, "$title, $playerUrl") {
|
||||
this.posterUrl = poster
|
||||
this.name = engTitle
|
||||
this.year = year
|
||||
this.plot = description
|
||||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
addActors(actors)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// It works when I click to view the series
|
||||
override suspend fun loadLinks(
|
||||
data: String, // (Serial) [Season Index, Episode Name, url] | (Film) [Title, Player Url]
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val dataList = data.split(", ")
|
||||
// Its film, parse one m3u8
|
||||
if(dataList.size == 2){
|
||||
val m3u8Url = app.get(dataList[1]).document.select("script").html()
|
||||
.substringAfterLast("file:\"")
|
||||
.substringBefore("\",")
|
||||
|
||||
M3u8Helper.generateM3u8(
|
||||
source = dataList[0],
|
||||
streamUrl = m3u8Url,
|
||||
referer = "https://tortuga.wtf/"
|
||||
).last().let(callback)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
val playerRawJson = app.get(dataList[2]).document.select("script").html()
|
||||
.substringAfterLast("file:\'")
|
||||
.substringBefore("\',")
|
||||
|
||||
AppUtils.tryParseJson<List<PlayerJson>>(playerRawJson)?.map { dubs -> // Dubs
|
||||
for(season in dubs.folder){ // Seasons
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class VodneriloProviderPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(VodneriloProvider())
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.lagradost.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
|
||||
data class DecodedJSON (
|
||||
|
||||
@SerializedName("tabName") val tabName : String,
|
||||
@SerializedName("seasons") val seasons : List<Seasons>
|
||||
)
|
||||
|
||||
data class Seasons (
|
||||
|
||||
@SerializedName("title") val title : String,
|
||||
@SerializedName("episodes") val episodes : List<Episodes>
|
||||
)
|
||||
|
||||
data class Episodes (
|
||||
|
||||
@SerializedName("title") val title : String,
|
||||
@SerializedName("sounds") val sounds : List<Sounds>
|
||||
)
|
||||
|
||||
data class Sounds (
|
||||
|
||||
@SerializedName("title") val title : String,
|
||||
@SerializedName("url") val url : String
|
||||
)
|
||||
|
||||
data class AESPlayerDecodedModel (
|
||||
|
||||
@SerializedName("tabName") val tabName : String,
|
||||
@SerializedName("url") val url : String
|
||||
)
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.lagradost.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class PlayerJson (
|
||||
|
||||
val title : String,
|
||||
val folder : List<Season>
|
||||
)
|
||||
|
||||
data class Season (
|
||||
|
||||
val title : String,
|
||||
val folder : List<Episode>
|
||||
)
|
||||
|
||||
data class Episode (
|
||||
|
||||
val title : String,
|
||||
val file : String,
|
||||
val id : String,
|
||||
val poster : String,
|
||||
val subtitle : String,
|
||||
)
|
|
@ -1,14 +0,0 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstreamtest.ProviderTester
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class VodneriloProviderTest {
|
||||
|
||||
@Test
|
||||
fun testProvider() = runTest {
|
||||
val providerTester = ProviderTester(VodneriloProvider())
|
||||
providerTester.testAll()
|
||||
}
|
||||
}
|
|
@ -86,5 +86,5 @@ subprojects {
|
|||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.buildDir)
|
||||
delete(getLayout().buildDirectory)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue