Merge remote-tracking branch 'origin/master'

This commit is contained in:
Blatzar 2022-07-30 21:07:41 +02:00
commit 9bb60a1677
13 changed files with 288 additions and 291 deletions

View file

@ -167,7 +167,7 @@ class GogoanimeProvider : MainAPI() {
}
}
override var mainUrl = "https://gogoanime.sk"
override var mainUrl = "https://gogoanime.lu"
override var name = "GogoAnime"
override val hasQuickSearch = false
override val hasMainPage = true
@ -178,52 +178,50 @@ class GogoanimeProvider : MainAPI() {
TvType.OVA
)
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val headers = mapOf(
"authority" to "ajax.gogo-load.com",
"sec-ch-ua" to "\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"",
"accept" to "text/html, */*; q=0.01",
"dnt" to "1",
"sec-ch-ua-mobile" to "?0",
"user-agent" to "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"origin" to mainUrl,
"sec-fetch-site" to "cross-site",
"sec-fetch-mode" to "cors",
"sec-fetch-dest" to "empty",
"referer" to "$mainUrl/"
)
val parseRegex =
Regex("""<li>\s*\n.*\n.*<a\s*href=["'](.*?-episode-(\d+))["']\s*title=["'](.*?)["']>\n.*?img src="(.*?)"""")
val headers = mapOf(
"authority" to "ajax.gogo-load.com",
"sec-ch-ua" to "\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"",
"accept" to "text/html, */*; q=0.01",
"dnt" to "1",
"sec-ch-ua-mobile" to "?0",
"user-agent" to "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
"origin" to mainUrl,
"sec-fetch-site" to "cross-site",
"sec-fetch-mode" to "cors",
"sec-fetch-dest" to "empty",
"referer" to "$mainUrl/"
)
val parseRegex =
Regex("""<li>\s*\n.*\n.*<a\s*href=["'](.*?-episode-(\d+))["']\s*title=["'](.*?)["']>\n.*?img src="(.*?)"""")
val urls = listOf(
Pair("1", "Recent Release - Sub"),
Pair("2", "Recent Release - Dub"),
Pair("3", "Recent Release - Chinese"),
)
override val mainPage = mainPageOf(
Pair("1", "Recent Release - Sub"),
Pair("2", "Recent Release - Dub"),
Pair("3", "Recent Release - Chinese"),
)
val items = ArrayList<HomePageList>()
for (i in urls) {
try {
val params = mapOf("page" to "1", "type" to i.first)
val html = app.get(
"https://ajax.gogo-load.com/ajax/page-recent-release.html",
headers = headers,
params = params
)
items.add(HomePageList(i.second, (parseRegex.findAll(html.text).map {
val (link, epNum, title, poster) = it.destructured
val isSub = listOf(1, 3).contains(i.first.toInt())
newAnimeSearchResponse(title, link) {
this.posterUrl = poster
addDubStatus(!isSub, epNum.toIntOrNull())
}
}).toList()))
} catch (e: Exception) {
e.printStackTrace()
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val params = mapOf("page" to page.toString(), "type" to categoryData)
val html = app.get(
"https://ajax.gogo-load.com/ajax/page-recent-release.html",
headers = headers,
params = params
)
val isSub = listOf(1, 3).contains(categoryData.toInt())
val home = parseRegex.findAll(html.text).map {
val (link, epNum, title, poster) = it.destructured
newAnimeSearchResponse(title, link) {
this.posterUrl = poster
addDubStatus(!isSub, epNum.toIntOrNull())
}
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
}.toList()
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): ArrayList<SearchResponse> {

View file

@ -3,7 +3,6 @@ package com.lagradost.cloudstream3.movieproviders
import androidx.core.text.parseAsHtml
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
@ -18,40 +17,37 @@ class AltadefinizioneProvider : MainAPI() {
TvType.Movie
)
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/azione/", "Azione"),
Pair("$mainUrl/avventura/", "Avventura"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home = soup.select("div.box").map {
val title = it.selectFirst("img")!!.attr("alt")
val link = it.selectFirst("a")!!.attr("href")
val image = mainUrl + it.selectFirst("img")!!.attr("src")
val quality = getQualityFromString(it.selectFirst("span")!!.text())
override val mainPage = mainPageOf(
Pair("$mainUrl/azione/page/", "Azione"),
Pair("$mainUrl/avventura/page/", "Avventura"),
)
MovieSearchResponse(
title,
link,
this.name,
TvType.Movie,
image,
null,
null,
quality,
)
}
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
}
val soup = app.get(url).document
val home = soup.select("div.box").map {
val title = it.selectFirst("img")!!.attr("alt")
val link = it.selectFirst("a")!!.attr("href")
val image = mainUrl + it.selectFirst("img")!!.attr("src")
val quality = getQualityFromString(it.selectFirst("span")!!.text())
MovieSearchResponse(
title,
link,
this.name,
TvType.Movie,
image,
null,
null,
quality,
)
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {

View file

@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.movieproviders
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.extractors.Cinestart
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
@ -19,39 +18,35 @@ class CinecalidadProvider : MainAPI() {
)
override val vpnStatus = VPNStatus.MightBeNeeded //Due to evoload sometimes not loading
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/ver-serie/", "Series"),
Pair("$mainUrl/", "Peliculas"),
Pair("$mainUrl/genero-de-la-pelicula/peliculas-en-calidad-4k/", "4K UHD"),
)
override val mainPage = mainPageOf(
Pair("$mainUrl/ver-serie/page/", "Series"),
Pair("$mainUrl/page/", "Peliculas"),
Pair("$mainUrl/genero-de-la-pelicula/peliculas-en-calidad-4k/page/", "4K UHD"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home = soup.select(".item.movies").map {
val title = it.selectFirst("div.in_title")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
if (link.contains("/ver-pelicula/")) TvType.Movie else TvType.TvSeries,
it.selectFirst(".poster.custom img")!!.attr("data-src"),
null,
null,
)
}
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
}
val soup = app.get(url).document
val home = soup.select(".item.movies").map {
val title = it.selectFirst("div.in_title")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
if (link.contains("/ver-pelicula/")) TvType.Movie else TvType.TvSeries,
it.selectFirst(".poster.custom img")!!.attr("data-src"),
null,
null,
)
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {

View file

@ -1,11 +1,10 @@
package com.lagradost.cloudstream3.movieproviders
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
class EntrepeliculasyseriesProvider:MainAPI() {
class EntrepeliculasyseriesProvider : MainAPI() {
override var mainUrl = "https://entrepeliculasyseries.nu"
override var name = "EntrePeliculasySeries"
override var lang = "es"
@ -18,39 +17,35 @@ class EntrepeliculasyseriesProvider:MainAPI() {
)
override val vpnStatus = VPNStatus.MightBeNeeded //Due to evoload sometimes not loading
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/series/", "Series"),
Pair("$mainUrl/peliculas/", "Peliculas"),
Pair("$mainUrl/anime/", "Animes"),
)
override val mainPage = mainPageOf(
Pair("$mainUrl/series/page/", "Series"),
Pair("$mainUrl/peliculas/page/", "Peliculas"),
Pair("$mainUrl/anime/page/", "Animes"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home = soup.select("ul.list-movie li").map {
val title = it.selectFirst("a.link-title h2")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
if (link.contains("/pelicula/")) TvType.Movie else TvType.TvSeries,
it.selectFirst("a.poster img")!!.attr("src"),
null,
null,
)
}
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
}
val soup = app.get(url).document
val home = soup.select("ul.list-movie li").map {
val title = it.selectFirst("a.link-title h2")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
if (link.contains("/pelicula/")) TvType.Movie else TvType.TvSeries,
it.selectFirst("a.poster img")!!.attr("src"),
null,
null,
)
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {
@ -110,7 +105,8 @@ class EntrepeliculasyseriesProvider:MainAPI() {
fixUrl(epThumb)
)
}
return when (val tvType = if (url.contains("/pelicula/")) TvType.Movie else TvType.TvSeries) {
return when (val tvType =
if (url.contains("/pelicula/")) TvType.Movie else TvType.TvSeries) {
TvType.TvSeries -> {
TvSeriesLoadResponse(
title,
@ -151,8 +147,10 @@ class EntrepeliculasyseriesProvider:MainAPI() {
val doc = app.get(servers).document
doc.select("input").apmap {
val postkey = it.attr("value")
app.post("https://entrepeliculasyseries.nu/r.php",
headers = mapOf("Host" to "entrepeliculasyseries.nu",
app.post(
"https://entrepeliculasyseries.nu/r.php",
headers = mapOf(
"Host" to "entrepeliculasyseries.nu",
"User-Agent" to USER_AGENT,
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5",
@ -165,9 +163,10 @@ class EntrepeliculasyseriesProvider:MainAPI() {
"Sec-Fetch-Dest" to "document",
"Sec-Fetch-Mode" to "navigate",
"Sec-Fetch-Site" to "same-origin",
"Sec-Fetch-User" to "?1",),
"Sec-Fetch-User" to "?1",
),
//params = mapOf(Pair("h", postkey)),
data = mapOf(Pair("h", postkey)),
data = mapOf(Pair("h", postkey)),
allowRedirects = false
).okhttpResponse.headers.values("location").apmap {
loadExtractor(it, data, subtitleCallback, callback)

View file

@ -1,13 +1,13 @@
package com.lagradost.cloudstream3.movieproviders
import androidx.core.text.parseAsHtml
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.LoadResponse.Companion.addRating
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
import com.lagradost.nicehttp.NiceResponse
import org.jsoup.nodes.Element
@ -23,42 +23,41 @@ class FilmpertuttiProvider : MainAPI() {
TvType.TvSeries
)
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/category/serie-tv/", "Serie Tv"),
Pair("$mainUrl/category/film/azione/", "Azione"),
Pair("$mainUrl/category/film/avventura/", "Avventura"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home = soup.select("ul.posts > li").map {
val title = it.selectFirst("div.title")!!.text().substringBeforeLast("(").substringBeforeLast("[")
val link = it.selectFirst("a")!!.attr("href")
val image = it.selectFirst("a")!!.attr("data-thumbnail")
val qualitydata = it.selectFirst("div.hd")
val quality = if (qualitydata!= null) {
getQualityFromString(qualitydata?.text())
}
else {
null
}
newTvSeriesSearchResponse(
title,
link) {
this.posterUrl = image
this.quality = quality
}
}
override val mainPage = mainPageOf(
Pair("$mainUrl/category/serie-tv/page/", "Serie Tv"),
Pair("$mainUrl/category/film/azione/page/", "Azione"),
Pair("$mainUrl/category/film/avventura/page/", "Avventura"),
)
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
val soup = app.get(url).document
val home = soup.select("ul.posts > li").map {
val title = it.selectFirst("div.title")!!.text().substringBeforeLast("(")
.substringBeforeLast("[")
val link = it.selectFirst("a")!!.attr("href")
val image = it.selectFirst("a")!!.attr("data-thumbnail")
val qualitydata = it.selectFirst("div.hd")
val quality = if (qualitydata != null) {
getQualityFromString(qualitydata.text())
} else {
null
}
newTvSeriesSearchResponse(
title,
link
) {
this.posterUrl = image
this.quality = quality
}
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {
@ -66,7 +65,8 @@ class FilmpertuttiProvider : MainAPI() {
val url = "$mainUrl/?s=$queryformatted"
val doc = app.get(url).document
return doc.select("ul.posts > li").map {
val title = it.selectFirst("div.title")!!.text().substringBeforeLast("(").substringBeforeLast("[")
val title = it.selectFirst("div.title")!!.text().substringBeforeLast("(")
.substringBeforeLast("[")
val link = it.selectFirst("a")!!.attr("href")
val image = it.selectFirst("a")!!.attr("data-thumbnail")
val quality = getQualityFromString(it.selectFirst("div.hd")?.text())
@ -90,28 +90,36 @@ class FilmpertuttiProvider : MainAPI() {
val title = document.selectFirst("#content > h1")!!.text().substringBeforeLast("(")
.substringBeforeLast("[")
val description = document.selectFirst("i.fa.fa-file-text-o.fa-fw")?.parent()?.nextSibling()?.toString()?.parseAsHtml().toString()
val description =
document.selectFirst("i.fa.fa-file-text-o.fa-fw")?.parent()?.nextSibling()?.toString()
?.parseAsHtml().toString()
val rating = document.selectFirst("div.rating > div.value")?.text()
val year =
document.selectFirst("#content > h1")?.text()?.substringAfterLast("(")?.filter { it.isDigit() }?.toIntOrNull() ?:
description.substringAfter("trasmessa nel").take(6).filter { it.isDigit() }.toIntOrNull() ?:
(document.selectFirst("i.fa.fa-calendar.fa-fw")?.parent()?.nextSibling() as Element?)?.text()?.substringAfterLast(" ")?.filter { it.isDigit() }?.toIntOrNull()
document.selectFirst("#content > h1")?.text()?.substringAfterLast("(")
?.filter { it.isDigit() }?.toIntOrNull()
?: description.substringAfter("trasmessa nel").take(6).filter { it.isDigit() }
.toIntOrNull() ?: (document.selectFirst("i.fa.fa-calendar.fa-fw")?.parent()
?.nextSibling() as Element?)?.text()?.substringAfterLast(" ")
?.filter { it.isDigit() }?.toIntOrNull()
val poster = document.selectFirst("div.meta > div > img")?.attr("data-src")
val trailerurl = document.selectFirst("div.youtube-player")?.attr("data-id")?.let{ urldata->
"https://www.youtube.com/watch?v=$urldata"
}
val trailerurl =
document.selectFirst("div.youtube-player")?.attr("data-id")?.let { urldata ->
"https://www.youtube.com/watch?v=$urldata"
}
if (type == TvType.TvSeries) {
val episodeList = ArrayList<Episode>()
document.select("div.accordion-item").filter{ it -> it.selectFirst("#season > ul > li.s_title > span")!!.text().isNotEmpty()}.map { element ->
document.select("div.accordion-item").filter { a ->
a.selectFirst("#season > ul > li.s_title > span")!!.text().isNotEmpty()
}.map { element ->
val season =
element.selectFirst("#season > ul > li.s_title > span")!!.text().toInt()
element.select("div.episode-wrap").map { episode ->
@ -147,10 +155,12 @@ class FilmpertuttiProvider : MainAPI() {
} else {
val urls0 = document.select("div.embed-player")
val urls = if (urls0.isNotEmpty()){
urls0.map { it.attr("data-id") }.toJson()
}
else{ document.select("#info > ul > li ").mapNotNull { it.selectFirst("a")?.attr("href") }.toJson() }
val urls = if (urls0.isNotEmpty()) {
urls0.map { it.attr("data-id") }.toJson()
} else {
document.select("#info > ul > li ").mapNotNull { it.selectFirst("a")?.attr("href") }
.toJson()
}
return newMovieLoadResponse(
title,
@ -168,46 +178,49 @@ class FilmpertuttiProvider : MainAPI() {
}
}
// to be updated when UnshortenUrl is ready
// to be updated when UnshortenUrl is ready
suspend fun unshorten_linkup(uri: String): String {
var r: NiceResponse? = null
var uri = uri
when{
when {
uri.contains("/tv/") -> uri = uri.replace("/tv/", "/tva/")
uri.contains("delta") -> uri = uri.replace("/delta/", "/adelta/")
(uri.contains("/ga/") || uri.contains("/ga2/")) -> uri = base64Decode(uri.split('/').last()).trim()
uri.contains("/speedx/") -> uri = uri.replace("http://linkup.pro/speedx", "http://speedvideo.net")
(uri.contains("/ga/") || uri.contains("/ga2/")) -> uri =
base64Decode(uri.split('/').last()).trim()
uri.contains("/speedx/") -> uri =
uri.replace("http://linkup.pro/speedx", "http://speedvideo.net")
else -> {
r = app.get(uri, allowRedirects = true)
uri = r.url
val link =
Regex("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>").find(r.text)?.value ?:
Regex("""action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">""").find(r.text)?.value ?:
Regex("""href","((.|\\n)*?)"""").findAll(r.text).elementAtOrNull(1)?.groupValues?.get(1)
Regex("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>").find(r.text)?.value
?: Regex("""action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">""").find(r.text)?.value
?: Regex("""href","((.|\\n)*?)"""").findAll(r.text)
.elementAtOrNull(1)?.groupValues?.get(1)
if (link!=null) {
if (link != null) {
uri = link
}
}
}
val short = Regex("""^https?://.*?(https?://.*)""").find(uri)?.value
if (short!=null){
if (short != null) {
uri = short
}
if (r==null){
if (r == null) {
r = app.get(
uri,
allowRedirects = false)
if (r.headers["location"]!= null){
allowRedirects = false
)
if (r.headers["location"] != null) {
uri = r.headers["location"].toString()
}
}
if (uri.contains("snip.")) {
if (uri.contains("out_generator")) {
uri = Regex("url=(.*)\$").find(uri)!!.value
}
else if (uri.contains("/decode/")) {
} else if (uri.contains("/decode/")) {
uri = app.get(uri, allowRedirects = true).url
}
}
@ -222,16 +235,14 @@ class FilmpertuttiProvider : MainAPI() {
callback: (ExtractorLink) -> Unit
): Boolean {
tryParseJson<List<String>>(data)?.apmap { id ->
if (id.contains("buckler")){
val id2 = unshorten_linkup(id).trim().replace("/v/","/e/").replace("/f/","/e/")
if (id.contains("buckler")) {
val id2 = unshorten_linkup(id).trim().replace("/v/", "/e/").replace("/f/", "/e/")
loadExtractor(id2, data, subtitleCallback, callback)
}
else if (id.contains("isecure")){
} else if (id.contains("isecure")) {
val doc1 = app.get(id).document
val id2 = doc1.selectFirst("iframe")!!.attr("src")
loadExtractor(id2, data, subtitleCallback, callback)
}
else{
} else {
loadExtractor(id, data, subtitleCallback, callback)
}
}

View file

@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.movieproviders
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.animeproviders.GogoanimeProvider
import com.lagradost.cloudstream3.animeproviders.GogoanimeProvider.Companion.extractVidstream
import com.lagradost.cloudstream3.metaproviders.TmdbLink
import com.lagradost.cloudstream3.metaproviders.TmdbProvider

View file

@ -25,7 +25,8 @@ class PeliSmartProvider: MainAPI() {
Pair("$mainUrl/documentales/", "Documentales"),
)
for ((url, name) in urls) {
// has no inf loading
urls.apmap { (url, name) ->
try {
val soup = app.get(url).document
val home = soup.select(".description-off").map {

View file

@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.movieproviders
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
@ -19,37 +18,35 @@ class SoaptwoDayProvider : MainAPI() {
TvType.TvSeries,
)
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/movielist/", "Movies"),
Pair("$mainUrl/tvlist/", "TV Series"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home =
soup.select("div.container div.row div.col-sm-12.col-lg-12 div.row div.col-sm-12.col-lg-12 .col-xs-6")
.map {
val title = it.selectFirst("h5 a")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
TvType.TvSeries,
fixUrl(it.selectFirst("img")!!.attr("src")),
null,
null,
)
}
override val mainPage = mainPageOf(
Pair("$mainUrl/movielist?page=", "Movies"),
Pair("$mainUrl/tvlist?page=", "TV Series"),
)
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
}
}
return HomePageResponse(items)
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
val soup = app.get(url).document
val home =
soup.select("div.container div.row div.col-sm-12.col-lg-12 div.row div.col-sm-12.col-lg-12 .col-xs-6")
.map {
val title = it.selectFirst("h5 a")!!.text()
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
TvType.TvSeries,
fixUrl(it.selectFirst("img")!!.attr("src")),
null,
null,
)
}
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {

View file

@ -1,10 +1,9 @@
package com.lagradost.cloudstream3.movieproviders
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
class TantifilmProvider : MainAPI() {
@ -18,37 +17,33 @@ class TantifilmProvider : MainAPI() {
TvType.TvSeries,
)
override suspend fun getMainPage(page: Int, categoryName: String, categoryData: String): HomePageResponse {
val items = ArrayList<HomePageList>()
val urls = listOf(
Pair("$mainUrl/watch-genre/serie-tv/", "Serie Tv"),
Pair("$mainUrl/watch-genre/azione/", "Azione"),
Pair("$mainUrl/watch-genre/avventura/", "Avventura"),
)
for ((url, name) in urls) {
try {
val soup = app.get(url).document
val home = soup.select("div.media3").map {
val title = it.selectFirst("p")!!.text().substringBefore("(")
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
TvType.Movie,
it.selectFirst("img")!!.attr("src"),
null,
null,
)
}
override val mainPage = mainPageOf(
Pair("$mainUrl/watch-genre/serie-tv/page/", "Serie Tv"),
Pair("$mainUrl/watch-genre/azione/page/", "Azione"),
Pair("$mainUrl/watch-genre/avventura/page/", "Avventura"),
)
items.add(HomePageList(name, home))
} catch (e: Exception) {
logError(e)
}
override suspend fun getMainPage(
page: Int,
categoryName: String,
categoryData: String
): HomePageResponse {
val url = categoryData + page
val soup = app.get(url).document
val home = soup.select("div.media3").map {
val title = it.selectFirst("p")!!.text().substringBefore("(")
val link = it.selectFirst("a")!!.attr("href")
TvSeriesSearchResponse(
title,
link,
this.name,
TvType.Movie,
it.selectFirst("img")!!.attr("src"),
null,
null,
)
}
if (items.size <= 0) throw ErrorLoadingException()
return HomePageResponse(items)
return newHomePageResponse(categoryName, home)
}
override suspend fun search(query: String): List<SearchResponse> {
@ -125,7 +120,7 @@ class TantifilmProvider : MainAPI() {
val episodeList = ArrayList<Episode>()
for ((season,seasonurl) in list) {
for ((season, seasonurl) in list) {
val seasonDocument = app.get(seasonurl).document
val episodes = seasonDocument.select("nav.second_nav > select > option")
if (episodes.isNotEmpty()) {
@ -147,11 +142,12 @@ class TantifilmProvider : MainAPI() {
title,
url,
type,
episodeList) {
this.posterUrl= fixUrlNull(poster)
episodeList
) {
this.posterUrl = fixUrlNull(poster)
this.year = year.toIntOrNull()
this.plot= descipt[0]
this.rating= rating
this.plot = descipt[0]
this.rating = rating
this.recommendations = recomm
addTrailer(trailerurl)
}

View file

@ -5,12 +5,14 @@ import android.os.Bundle
import android.view.View
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder
import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings
import com.lagradost.cloudstream3.APIHolder.getApiProviderLangSettings
import com.lagradost.cloudstream3.AcraApplication.Companion.removeKey
import com.lagradost.cloudstream3.CommonActivity
import com.lagradost.cloudstream3.DubStatus
import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.network.initClient
import com.lagradost.cloudstream3.ui.APIRepository
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.getPref
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
@ -55,7 +57,7 @@ val appLanguages = arrayListOf(
Triple("", "Romanian", "ro"),
Triple("", "Italian", "it"),
Triple("", "Chinese", "zh"),
Triple("", "Indonesian", "id"),
Triple("\uD83C\uDDEE\uD83C\uDDE9", "Indonesian", "in"),
Triple("", "Czech", "cs"),
).sortedBy { it.second } //ye, we go alphabetical, so ppl don't put their lang on top
@ -120,13 +122,13 @@ class SettingsLang : PreferenceFragmentCompat() {
return@setOnPreferenceClickListener true
}
getPref(R.string.locale_key)?.setOnPreferenceClickListener {
getPref(R.string.locale_key)?.setOnPreferenceClickListener { pref ->
val tempLangs = appLanguages.toMutableList()
//if (beneneCount > 100) {
// tempLangs.add(Triple("\uD83E\uDD8D", "mmmm... monke", "mo"))
//}
val current = getCurrentLocale(requireContext())
val languageCodes = tempLangs.map { it.third }
val current = getCurrentLocale(pref.context)
val languageCodes = tempLangs.map { (_, _, iso) -> iso }
val languageNames = tempLangs.map { (emoji, name, iso) ->
val flag = emoji.ifBlank { SubtitleHelper.getFlagFromIso(iso) ?: "ERROR" }
"$flag $name"

View file

@ -119,8 +119,10 @@ object SubtitleHelper {
private val flagRegex = Regex("[\uD83C\uDDE6-\uD83C\uDDFF]{2}")
fun getFlagFromIso(inp: String?): String? {
if (inp.isNullOrBlank() || inp.length < 2) return null
try {
val ret = getFlagFromIsoShort(flags[inp ?: return null])
val ret = getFlagFromIsoShort(flags[inp])
?: getFlagFromIsoShort(inp.uppercase()) ?: return null
return if (flagRegex.matches(ret)) {
@ -135,8 +137,9 @@ object SubtitleHelper {
}
private fun getFlagFromIsoShort(flagAscii: String?): String? {
if (flagAscii.isNullOrBlank() || flagAscii.length < 2) return null
try {
val firstChar: Int = Character.codePointAt(flagAscii ?: return null, 0) + offset
val firstChar: Int = Character.codePointAt(flagAscii, 0) + offset
val secondChar: Int = Character.codePointAt(flagAscii, 1) + offset
return (String(Character.toChars(firstChar)) + String(Character.toChars(secondChar)))

View file

@ -240,7 +240,7 @@
"language": "en",
"name": "GogoAnime",
"status": 1,
"url": "https://gogoanime.sk"
"url": "https://gogoanime.lu"
},
"GomunimeProvider": {
"language": "id",