forked from recloudstream/cloudstream
* Dramasee and WatchAsian fix to support asianload domain. Fixes #526 * [skip ci] minor edits from PR suggestions. * fix pinoymoviepedia titles on homepage. * fix pinoymovies title on homepage. * Update DramaSeeProvider.kt Co-authored-by: Osten <balt.758@gmail.com>
This commit is contained in:
parent
4bac7eb33b
commit
54cd44179d
5 changed files with 60 additions and 39 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.lagradost.cloudstream3.extractors.helper
|
||||
|
||||
import android.util.Log
|
||||
import com.lagradost.cloudstream3.apmap
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
|
@ -8,18 +9,16 @@ import com.lagradost.cloudstream3.utils.loadExtractor
|
|||
class AsianEmbedHelper {
|
||||
companion object {
|
||||
suspend fun getUrls(url: String, callback: (ExtractorLink) -> Unit) {
|
||||
if (url.startsWith("https://asianembed.io")) {
|
||||
// Fetch links
|
||||
val doc = app.get(url).document
|
||||
val links = doc.select("div#list-server-more > ul > li.linkserver")
|
||||
if (!links.isNullOrEmpty()) {
|
||||
links.forEach {
|
||||
val datavid = it.attr("data-video") ?: ""
|
||||
//Log.i("AsianEmbed", "Result => (datavid) ${datavid}")
|
||||
if (datavid.isNotEmpty()) {
|
||||
val res = loadExtractor(datavid, url, callback)
|
||||
Log.i("AsianEmbed", "Result => ($res) (datavid) ${datavid}")
|
||||
}
|
||||
// Fetch links
|
||||
val doc = app.get(url).document
|
||||
val links = doc.select("div#list-server-more > ul > li.linkserver")
|
||||
if (!links.isNullOrEmpty()) {
|
||||
links.apmap {
|
||||
val datavid = it.attr("data-video") ?: ""
|
||||
//Log.i("AsianEmbed", "Result => (datavid) ${datavid}")
|
||||
if (datavid.isNotEmpty()) {
|
||||
val res = loadExtractor(datavid, url, callback)
|
||||
Log.i("AsianEmbed", "Result => ($res) (datavid) $datavid")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class DramaSeeProvider : MainAPI() {
|
|||
|
||||
// Episodes Links
|
||||
val episodeList = ArrayList<TvSeriesEpisode>()
|
||||
body?.select("ul.episodes > li.episode-item")?.forEach { ep ->
|
||||
body?.select("ul.episodes > li")?.forEach { ep ->
|
||||
val innerA = ep.select("a") ?: return@forEach
|
||||
val count = innerA.select("span.episode")?.text()?.toIntOrNull() ?: 0
|
||||
val epLink = fixUrlNull(innerA.attr("href")) ?: return@forEach
|
||||
|
@ -110,13 +110,13 @@ class DramaSeeProvider : MainAPI() {
|
|||
val innerPage = app.get(fixUrl(ajaxUrl), referer = epLink).document
|
||||
val listOfLinks = mutableListOf<String>()
|
||||
innerPage.select("div.player.active > main > div")?.forEach { em ->
|
||||
val href = em.attr("src") ?: ""
|
||||
val href = fixUrlNull(em.attr("src")) ?: ""
|
||||
if (href.isNotEmpty()) {
|
||||
listOfLinks.add(href)
|
||||
}
|
||||
}
|
||||
|
||||
//Log.i(this.name, "Result => (listOfLinks) ${listOfLinks}")
|
||||
//Log.i(this.name, "Result => (listOfLinks) ${listOfLinks.toJson()}")
|
||||
episodeList.add(
|
||||
TvSeriesEpisode(
|
||||
name = null,
|
||||
|
@ -160,18 +160,16 @@ class DramaSeeProvider : MainAPI() {
|
|||
mapper.readValue<List<String>>(data).apmap { item ->
|
||||
if (item.isNotEmpty()) {
|
||||
count++
|
||||
var url = fixUrl(item.trim())
|
||||
val url = fixUrl(item.trim())
|
||||
//Log.i(this.name, "Result => (url) ${url}")
|
||||
when {
|
||||
url.startsWith("https://asianembed.io") -> {
|
||||
url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> {
|
||||
AsianEmbedHelper.getUrls(url, callback)
|
||||
}
|
||||
url.startsWith("https://embedsito.com") -> {
|
||||
val extractor = XStreamCdn()
|
||||
extractor.domainUrl = "embedsito.com"
|
||||
extractor.getUrl(url).forEach { link ->
|
||||
callback.invoke(link)
|
||||
}
|
||||
extractor.getSafeUrl(url)?.forEach(callback)
|
||||
}
|
||||
else -> {
|
||||
loadExtractor(url, mainUrl, callback)
|
||||
|
|
|
@ -36,20 +36,28 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
val inner = mainbody?.select("div#${item.second} > article")
|
||||
|
||||
val elements: List<SearchResponse> = inner?.mapNotNull {
|
||||
if (it == null) {
|
||||
return@mapNotNull null
|
||||
}
|
||||
if (it == null) { return@mapNotNull null }
|
||||
|
||||
// Get inner div from article
|
||||
val urlTitle = it.select("div.data") ?: return@mapNotNull null
|
||||
// Fetch details
|
||||
val link = fixUrlNull(urlTitle.select("a")?.attr("href")) ?: return@mapNotNull null
|
||||
val name = urlTitle.text() ?: ""
|
||||
val image = it.select("div.poster > img")?.attr("src")
|
||||
// Get Year from Title
|
||||
val year = try {
|
||||
|
||||
// Get Title and Year
|
||||
val titleYear = it.select("div.data.dfeatur")
|
||||
var name = titleYear?.select("h3")?.text() ?: ""
|
||||
var year = titleYear?.select("span")?.text()?.toIntOrNull()
|
||||
|
||||
if (name.isEmpty()) {
|
||||
name = urlTitle.select("h3")?.text() ?: ""
|
||||
year = titleYear?.select("span")?.text()?.takeLast(4)?.toIntOrNull()
|
||||
}
|
||||
if (year == null) {
|
||||
// Get year from name
|
||||
val rex = Regex("\\((\\d+)")
|
||||
rex.find(name)?.value?.replace("(", "")?.toIntOrNull()
|
||||
} catch (e: Exception) { null }
|
||||
year = rex.find(name)?.value?.replace("(", "")?.toIntOrNull()
|
||||
}
|
||||
|
||||
val tvType = TvType.Movie
|
||||
MovieSearchResponse(
|
||||
|
|
|
@ -39,11 +39,18 @@ class PinoyMoviesEsProvider : MainAPI() {
|
|||
}
|
||||
// Fetch details
|
||||
val link = urlTitle?.select("a")?.attr("href") ?: ""
|
||||
val name = urlTitle?.text() ?: ""
|
||||
val year = urlTitle?.select("span")?.text()?.toIntOrNull()
|
||||
//Log.i(this.name, "Result => (link) ${link}")
|
||||
val image = it?.select("div.poster > img")?.attr("data-src")
|
||||
|
||||
// Get Title and Year
|
||||
val name = urlTitle?.select("h3")?.text() ?: ""
|
||||
var year = urlTitle?.select("span")?.text()?.toIntOrNull()
|
||||
|
||||
if (year == null) {
|
||||
// Get year from name
|
||||
val rex = Regex("\\((\\d+)")
|
||||
year = rex.find(name)?.value?.replace("(", "")?.toIntOrNull()
|
||||
}
|
||||
|
||||
MovieSearchResponse(
|
||||
name,
|
||||
link,
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.lagradost.cloudstream3.movieproviders
|
|||
|
||||
import com.fasterxml.jackson.module.kotlin.readValue
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.extractors.*
|
||||
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
||||
import com.lagradost.cloudstream3.extractors.helper.AsianEmbedHelper
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
|
@ -144,7 +144,7 @@ class WatchAsianProvider : MainAPI() {
|
|||
//If there's only 1 episode, consider it a movie.
|
||||
if (episodeList.size == 1) {
|
||||
//Clean title
|
||||
title = title.removeSuffix("Episode 1")
|
||||
title = title.trim().removeSuffix("Episode 1")
|
||||
val streamlink = getServerLinks(episodeList[0].data)
|
||||
//Log.i(this.name, "Result => (streamlink) $streamlink")
|
||||
return MovieLoadResponse(title, url, this.name, TvType.Movie, streamlink, poster, year, descript, null, null)
|
||||
|
@ -178,11 +178,20 @@ class WatchAsianProvider : MainAPI() {
|
|||
count++
|
||||
val url = fixUrl(item.trim())
|
||||
//Log.i(this.name, "Result => (url) $url")
|
||||
if (url.startsWith("https://asianembed.io")) {
|
||||
// Fetch links
|
||||
AsianEmbedHelper.getUrls(url, callback)
|
||||
} else {
|
||||
loadExtractor(url, mainUrl, callback)
|
||||
when {
|
||||
url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> {
|
||||
AsianEmbedHelper.getUrls(url, callback)
|
||||
}
|
||||
url.startsWith("https://embedsito.com") -> {
|
||||
val extractor = XStreamCdn()
|
||||
extractor.domainUrl = "embedsito.com"
|
||||
extractor.getSafeUrl(url)?.apmap { link ->
|
||||
callback.invoke(link)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
loadExtractor(url, mainUrl, callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
return count > 0
|
||||
|
|
Loading…
Reference in a new issue