Yomovies: added new source

This commit is contained in:
sora 2023-07-20 11:56:56 +07:00
parent 273b9238d2
commit 785eda47c2
5 changed files with 79 additions and 22 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 15
version = 16
cloudstream {

View File

@ -0,0 +1,37 @@
package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.SpeedoStream
import com.lagradost.cloudstream3.utils.AppUtils
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.cloudstream3.utils.getAndUnpack
class Streamoupload : SpeedoStream() {
override val mainUrl = "https://streamoupload.xyz"
override val name = "Streamoupload"
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val script = getAndUnpack(app.get(url, referer = referer).text)
val data = script.substringAfter("sources:[")
.substringBefore("],").replace("file", "\"file\"").trim()
AppUtils.tryParseJson<File>(data)?.let {
M3u8Helper.generateM3u8(
name,
it.file,
"$mainUrl/",
).forEach(callback)
}
}
private data class File(
@JsonProperty("file") val file: String,
)
}

View File

@ -0,0 +1,23 @@
package com.hexated
import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.mainPageOf
class Watchomovies : YomoviesProvider() {
override var mainUrl = "https://watchomovies.mom"
override var name = "Watchomovies"
override val hasMainPage = true
override var lang = "hi"
override val supportedTypes = setOf(
TvType.NSFW,
)
override val mainPage = mainPageOf(
"most-favorites" to "Most Viewed",
"genre/xxx-scenes" to "XXX Scenes",
"genre/18" to "18+ Movies",
"genre/erotic-movies" to "Erotic Movies Movies",
"genre/parody" to "Parody Movies",
"genre/tv-shows" to "TV Shows Movies",
)
}

View File

@ -9,37 +9,32 @@ import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element
import java.net.URI
class YomoviesProvider : MainAPI() {
open class YomoviesProvider : MainAPI() {
override var mainUrl = "https://yomovies.baby"
private var directUrl = mainUrl
private var directUrl = ""
override var name = "Yomovies"
override val hasMainPage = true
override var lang = "hi"
override val hasDownloadSupport = true
override val supportedTypes = setOf(
TvType.Movie,
TvType.TvSeries,
)
override val mainPage = mainPageOf(
"$mainUrl/most-favorites/page/" to "Most Viewed",
"$mainUrl/genre/web-series/page/" to "Web Series Movies",
"$mainUrl/genre/dual-audio/page/" to "Dual Audio Movies",
"$mainUrl/genre/bollywood/page/" to "Bollywood Movies",
"$mainUrl/genre/tv-shows/page/" to "TV Shows Movies",
"$mainUrl/genre/hollywood/page/" to "Hollywood Movies",
"$mainUrl/series/page/" to "All TV Series",
"most-favorites" to "Most Viewed",
"genre/web-series" to "Web Series Movies",
"genre/dual-audio" to "Dual Audio Movies",
"genre/bollywood" to "Bollywood Movies",
"genre/tv-shows" to "TV Shows Movies",
"genre/hollywood" to "Hollywood Movies",
"series" to "All TV Series",
)
override suspend fun getMainPage(
page: Int,
request: MainPageRequest
): HomePageResponse {
val document = if (page == 1) {
app.get(request.data.removeSuffix("page/")).document
} else {
app.get(request.data + page).document
}
val document = app.get("$mainUrl/${request.data}/page/$page").document
val home = document.select("div.ml-item").mapNotNull {
it.toSearchResult()
}
@ -129,12 +124,6 @@ class YomoviesProvider : MainAPI() {
}
}
private fun getBaseUrl(url: String): String {
return URI(url).let {
"${it.scheme}://${it.host}"
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
@ -175,4 +164,10 @@ class YomoviesProvider : MainAPI() {
return fixTitle(URI(this).host.substringBeforeLast(".").substringAfterLast("."))
}
private fun getBaseUrl(url: String): String {
return URI(url).let {
"${it.scheme}://${it.host}"
}
}
}

View File

@ -10,5 +10,7 @@ class YomoviesProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(YomoviesProvider())
registerMainAPI(Watchomovies())
registerExtractorAPI(Streamoupload())
}
}