mirror of
https://github.com/Jacekun/cs3xxx-repo.git
synced 2024-08-14 23:57:09 +00:00
[Beta Providers] HpJav, JavMost, Jav Guru
This commit is contained in:
parent
96856cec0a
commit
019a3bcb2c
14 changed files with 532 additions and 2 deletions
26
JavMost/build.gradle.kts
Normal file
26
JavMost/build.gradle.kts
Normal file
|
@ -0,0 +1,26 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
|
||||
|
||||
cloudstream {
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = ""
|
||||
authors = listOf("Jace")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 3 // will be 3 if unspecified
|
||||
|
||||
// List of video source types. Users are able to filter for extensions in a given category.
|
||||
// You can find a list of avaliable types here:
|
||||
// https://recloudstream.github.io/cloudstream/html/app/com.lagradost.cloudstream3/-tv-type/index.html
|
||||
tvTypes = listOf("NSFW")
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=www5.javmost.com&sz=%size%"
|
||||
}
|
2
JavMost/src/main/AndroidManifest.xml
Normal file
2
JavMost/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
159
JavMost/src/main/kotlin/com/jacekun/JavMost.kt
Normal file
159
JavMost/src/main/kotlin/com/jacekun/JavMost.kt
Normal file
|
@ -0,0 +1,159 @@
|
|||
package com.jacekun
|
||||
|
||||
import com.lagradost.cloudstream3.MainAPI
|
||||
import com.lagradost.cloudstream3.TvType
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.app
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
class JavMost : MainAPI() {
|
||||
private val DEV = "DevDebug"
|
||||
private val globaltvType = TvType.Movie
|
||||
|
||||
override var name = "JAVMost.com"
|
||||
override var mainUrl = "https://www5.javmost.com"
|
||||
override val supportedTypes = setOf(TvType.NSFW)
|
||||
override val hasDownloadSupport = false
|
||||
override val hasMainPage = true
|
||||
override val hasQuickSearch = false
|
||||
|
||||
override suspend fun getMainPage(
|
||||
page: Int,
|
||||
request: MainPageRequest
|
||||
): HomePageResponse {
|
||||
val html = app.get(mainUrl).text
|
||||
val document = Jsoup.parse(html)
|
||||
val all = ArrayList<HomePageList>()
|
||||
|
||||
val mainbody = document.getElementsByTag("body")
|
||||
?.select("div#page-container > div#content > div#content-update > div")
|
||||
?.select("div.col-md-4.col-sm-6")
|
||||
val title = "Homepage"
|
||||
// Fetch list of items and map
|
||||
val elements: List<SearchResponse> = mainbody!!.map {
|
||||
|
||||
val inner = it.select("div.card")
|
||||
val linkA = inner.select("div.card-block > a")
|
||||
val link = linkA?.firstOrNull()?.attr("href") ?: ""
|
||||
val name = listOfNotNull(linkA?.firstOrNull()?.text(), linkA?.getOrNull(1)?.text()).joinToString(" ")
|
||||
//Log.i(DEV, "Result => (name and link) ${name} / ${link}")
|
||||
var image = inner?.select("center > a > img")?.attr("data-src")
|
||||
if (image == null) {
|
||||
image = inner?.select("center > a > img")?.attr("src")
|
||||
} else {
|
||||
if (image == "http") {
|
||||
image = inner?.select("center > a > img")?.attr("src")
|
||||
}
|
||||
}
|
||||
//Log.i(DEV, "Result => (image) ${image}")
|
||||
val year = inner.select("div.card-block > p")?.text()
|
||||
?.substring(0, 20)?.replace("Release", "")?.trim()
|
||||
?.substring(0, 4)?.toIntOrNull()
|
||||
|
||||
MovieSearchResponse(
|
||||
name,
|
||||
link,
|
||||
this.name,
|
||||
globaltvType,
|
||||
image,
|
||||
year,
|
||||
null,
|
||||
)
|
||||
}
|
||||
|
||||
all.add(
|
||||
HomePageList(
|
||||
title, elements
|
||||
)
|
||||
)
|
||||
|
||||
return HomePageResponse(all)
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse>? {
|
||||
val html = app.get("$mainUrl/search/${query}/").text
|
||||
val document = Jsoup.parse(html)
|
||||
val mainbody = document.getElementsByTag("body")
|
||||
?.select("div#page-container > div#content > div#content-update > div")
|
||||
?.select("div.col-md-4.col-sm-6")
|
||||
//Log.i(DEV, "Result => $document")
|
||||
if (mainbody != null) {
|
||||
return mainbody.map {
|
||||
val content = it.select("div.card").firstOrNull()
|
||||
val linkImg = content?.select("a")?.firstOrNull()
|
||||
|
||||
val href = fixUrl(linkImg?.attr("href") ?: "")
|
||||
var image = linkImg?.select("img")?.attr("data-src")?.trim('\'')
|
||||
if (image != null) { image = fixUrl(image) }
|
||||
//Log.i(DEV, "Result => (link) ${href}, (img) ${image}")
|
||||
val titleContent = content?.select("div.card-block > a")
|
||||
//Log.i(DEV, "Result => (titleContent) ${titleContent}")
|
||||
val title = when (titleContent?.size) {
|
||||
2 -> listOfNotNull(
|
||||
titleContent[0]?.text(),
|
||||
titleContent[1]?.text()
|
||||
).joinToString(" ")
|
||||
1 -> titleContent[0]?.text()
|
||||
else -> "<No Title found>"
|
||||
} ?: "<No Title found>"
|
||||
//Log.i(DEV, "Result => (title) ${title}")
|
||||
var year: Int? = null
|
||||
val yearP = content?.select("div.card-block")?.firstOrNull()?.select("p")
|
||||
//Log.i(DEV, "Result => (yearP) ${yearP}")
|
||||
val yearElem = when(yearP != null) {
|
||||
true -> yearP?.filter { yearit -> yearit.text()?.contains("Release") == true }
|
||||
false -> null
|
||||
}
|
||||
val yearString = when (yearElem?.size!! > 0) {
|
||||
true -> yearElem?.get(0)?.text()?.substring(0, 22)?.trim()
|
||||
?.replace("Release", "")?.trim()
|
||||
false -> null
|
||||
}
|
||||
//Log.i(DEV, "Result => (yearString) ${yearString}")
|
||||
if (yearString != null) {
|
||||
val maxSize = if (yearString.length > 4) { 4 } else { yearString.length }
|
||||
year = yearString?.substring(0, maxSize)?.toIntOrNull()
|
||||
}
|
||||
//Log.i(DEV, "Result => (year) ${year}")
|
||||
|
||||
MovieSearchResponse(
|
||||
title,
|
||||
href,
|
||||
this.name,
|
||||
globaltvType,
|
||||
image,
|
||||
year
|
||||
)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val response = app.get(url).text
|
||||
val document = Jsoup.parse(response)
|
||||
//Log.i(DEV, "Url => ${url}")
|
||||
val body = document.getElementsByTag("head")
|
||||
|
||||
//Log.i(DEV, "Result => ${body}")
|
||||
var poster = body?.select("meta[property=og:image]")?.firstOrNull()?.attr("content")
|
||||
if (poster != null) { poster = fixUrl(poster) }
|
||||
//Log.i(DEV, "Result (image) => ${poster}")
|
||||
val title = body?.select("meta[property=og:title]")?.firstOrNull()?.attr("content") ?: "<No Title>"
|
||||
val descript = body?.select("meta[property=og:description]")?.firstOrNull()?.attr("content") ?: "<No Synopsis found>"
|
||||
//Log.i(DEV, "Result => ${descript}")
|
||||
val streamUrl = ""
|
||||
val year = null
|
||||
return MovieLoadResponse(
|
||||
name = title,
|
||||
url = url,
|
||||
apiName = this.name,
|
||||
type = globaltvType,
|
||||
dataUrl = streamUrl,
|
||||
posterUrl = poster,
|
||||
year = year,
|
||||
plot = descript,
|
||||
comingSoon = true
|
||||
)
|
||||
}
|
||||
}
|
13
JavMost/src/main/kotlin/com/jacekun/JavMostPlugin.kt
Normal file
13
JavMost/src/main/kotlin/com/jacekun/JavMostPlugin.kt
Normal file
|
@ -0,0 +1,13 @@
|
|||
package com.jacekun
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class JavMostPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(JavMost())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue