From b78a76d9270a0fe43b68695a65b04e74604437c7 Mon Sep 17 00:00:00 2001 From: Jace <54625750+Jacekun@users.noreply.github.com> Date: Tue, 5 Apr 2022 19:36:42 +0800 Subject: [PATCH 1/3] [Feature] Add quality to pinoymoviepedia (#911) --- .../movieproviders/PinoyMoviePediaProvider.kt | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt index 9495a28f..db24b553 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PinoyMoviePediaProvider.kt @@ -1,9 +1,9 @@ package com.lagradost.cloudstream3.movieproviders -import com.fasterxml.jackson.module.kotlin.readValue import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.extractors.FEmbed 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 @@ -53,21 +53,22 @@ class PinoyMoviePediaProvider : MainAPI() { name = urlTitle.select("h3")?.text() ?: "" year = titleYear?.select("span")?.text()?.takeLast(4)?.toIntOrNull() } + // Get year from name if (year == null) { - // Get year from name val rex = Regex("\\((\\d+)") year = rex.find(name)?.value?.replace("(", "")?.toIntOrNull() } + //Get quality + val qual = getQualityFromString(it.selectFirst("span.quality")?.text()) - val tvType = TvType.Movie MovieSearchResponse( - name, - link, - this.name, - tvType, - image, - year, - null, + name = name, + url = link, + apiName = this.name, + TvType.Movie, + posterUrl = image, + year = year, + quality = qual ) }?.distinctBy { c -> c.url } ?: listOf() // Add @@ -93,14 +94,16 @@ class PinoyMoviePediaProvider : MainAPI() { val title = details.select("div.title")?.text() ?: "" val year = details.select("div.meta > span.year")?.text()?.toIntOrNull() val image = inner.select("div.image > div > a > img")?.attr("src") + val qual = getQualityFromString(it.selectFirst("span.quality")?.text()) MovieSearchResponse( - title, - link, - this.name, + name = title, + url = link, + apiName = this.name, TvType.Movie, - image, - year + posterUrl = image, + year = year, + quality = qual ) }?.distinctBy { c -> c.url } ?: listOf() } @@ -149,7 +152,7 @@ class PinoyMoviePediaProvider : MainAPI() { playcontainer?.select("iframe")?.forEach { item -> val lnk = item?.attr("src")?.trim() ?: "" //Log.i(this.name, "Result => (lnk) $lnk") - if (lnk.isNotBlank()) { + if (lnk.isNotEmpty()) { listOfLinks.add(lnk) } } @@ -219,7 +222,7 @@ class PinoyMoviePediaProvider : MainAPI() { ): Boolean { // parse movie servers var count = 0 - mapper.readValue>(data).apmap { link -> + tryParseJson>(data)?.apmap { link -> count++ if (link.contains("fembed.com")) { val extractor = FEmbed() From d95dbf92e6384d2889e3574b42dc4ad9d755bf49 Mon Sep 17 00:00:00 2001 From: Jace <54625750+Jacekun@users.noreply.github.com> Date: Tue, 5 Apr 2022 19:48:06 +0800 Subject: [PATCH 2/3] [Bugfix] Include asian drama on Movies/TV preferred media setting. (#910) * [Bugfix] Include asian drama on Movies/TV preferred media setting. - Add Documentary on preferred media. * added missing value for array --- .../java/com/lagradost/cloudstream3/MainAPI.kt | 14 ++++++++------ app/src/main/res/values/array.xml | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt index 0076d193..13b26e72 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt @@ -268,12 +268,14 @@ object APIHolder { } else { // Filter API depending on preferred media type val listEnumAnime = listOf(TvType.Anime, TvType.AnimeMovie, TvType.OVA) - val listEnumMovieTv = listOf(TvType.Movie, TvType.TvSeries, TvType.Cartoon) - val mediaTypeList = if (currentPrefMedia == 1) listEnumMovieTv else listEnumAnime - - val filteredAPI = - allApis.filter { api -> api.supportedTypes.any { it in mediaTypeList } } - filteredAPI + val listEnumMovieTv = listOf(TvType.Movie, TvType.TvSeries, TvType.Cartoon, TvType.AsianDrama) + val listEnumDoc = listOf(TvType.Documentary) + val mediaTypeList = when (currentPrefMedia) { + 2 -> listEnumAnime + 3 -> listEnumDoc + else -> listEnumMovieTv + } + allApis.filter { api -> api.supportedTypes.any { it in mediaTypeList } } } } } diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index f3e585d4..b3d83f47 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -50,11 +50,13 @@ All Movies and TV Anime + Documentary 0 1 2 + 3 From 77b1a2825ef0d3734a81d9a2eec3abd6a1596bbf Mon Sep 17 00:00:00 2001 From: Davide <49226282+pizidavi@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:17:17 +0200 Subject: [PATCH 3/3] Updated Italian translation (#913) --- app/src/main/res/values-it/strings.xml | 34 +++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 37b5cfa7..24080110 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -105,8 +105,8 @@ Colore finestra Tipo bordo Elevazione sottotitolo - Font - Dimensione font + Carattere + Dimensione Cerca per provider Cerca per tipo @@ -254,14 +254,15 @@ Errore download, controlla i permessi di archiviazione Chromecast - Mirror Chromecast + Chromecast mirror Riproduci in app Riproduci in VLC Riproduci nel browser Copia link - Download automatico - Download Mirror + Download + Download mirror Aggiorna link + Download sottotitoli Nessun aggiornamento trovato Controlla aggiornamenti @@ -279,13 +280,13 @@ Dimensione cache video su disco Cancella cache immagini e video - Se impostato troppo alto può causare problemi su sistemi con poca RAM. Come dispositivi Android TV o vecchi telefoni + Se impostato troppo alto può causare problemi su sistemi con poca RAM. Come i dispositivi Android TV o vecchi telefoni Se impostato troppo alto può causare problemi su sistemi con poca Archiviazione interna. Come i dispositivi Android TV DNS over HTTPS Utile per bypassare i blocchi ISP - Download path + Posizione Download Mostra anime doppiati/sottotitolati @@ -316,6 +317,13 @@ Aggiungi tracking Aggiunto %s Sync + Valutato + %d / 10 + /?? + /%d + %s autenticato + Impossibile autenticarsi a %s + Nessuno Normale @@ -324,9 +332,9 @@ Min @string/none Contorno - Depresso + Bassorilievo Ombra - Sollevato + Rilievo Sincronizza sottotitoli 1000ms Ritardo sottotitoli @@ -352,6 +360,7 @@ Sorgente In Arrivo + Cam Cam Cam @@ -362,5 +371,12 @@ BlueRay WP DVD + 4K + SD + UHD + HDR + SDR + Web + Poster