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
HpJav/build.gradle.kts
Normal file
26
HpJav/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=hpjav.tv&sz=%size%"
|
||||
}
|
2
HpJav/src/main/AndroidManifest.xml
Normal file
2
HpJav/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
118
HpJav/src/main/kotlin/com/jacekun/HpJav.kt
Normal file
118
HpJav/src/main/kotlin/com/jacekun/HpJav.kt
Normal file
|
@ -0,0 +1,118 @@
|
|||
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 HpJav : MainAPI() {
|
||||
private val DEV = "DevDebug"
|
||||
private val globaltvType = TvType.Movie
|
||||
|
||||
override var name = "HpJav TV"
|
||||
override var mainUrl = "https://hpjav.tv"
|
||||
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 document = app.get(mainUrl).document
|
||||
val all = ArrayList<HomePageList>()
|
||||
document.getElementsByTag("body")?.select("div.container")?.forEach { it2 ->
|
||||
// Fetch row title
|
||||
val title = it2.select("div.category-count > h3")?.text() ?: "<No Name Row>"
|
||||
// Fetch list of items and map
|
||||
val elements = it2.select("div.post-list > div")?.mapNotNull {
|
||||
//Fetch entries
|
||||
val aa = it.selectFirst("div.video-item > div > a") ?: return@mapNotNull null
|
||||
val linkTitle = it.select("div.entry-title > a") ?: return@mapNotNull null
|
||||
val link = fixUrlNull(linkTitle.attr("href")) ?: return@mapNotNull null
|
||||
val name = linkTitle.text() ?: "<No Title>"
|
||||
val image = if (link != "") { aa.select("img")?.attr("data-original") } else { null }
|
||||
val year = null
|
||||
//Log.i(DEV, "Result => (image) ${image} , (linkCode) ${linkCode}, (link) ${link}")
|
||||
|
||||
MovieSearchResponse(
|
||||
name,
|
||||
link,
|
||||
this.name,
|
||||
globaltvType,
|
||||
image,
|
||||
year,
|
||||
null,
|
||||
)
|
||||
}?.distinctBy { it.url } ?: listOf()
|
||||
if (elements.isNotEmpty()) {
|
||||
all.add(
|
||||
HomePageList(
|
||||
title, elements
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return HomePageResponse(all.filter { hp -> hp.list.isNotEmpty() })
|
||||
}
|
||||
|
||||
//TODO: Fix search
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val url = "$mainUrl/?s=$query"
|
||||
val document = app.get(url).document.getElementsByTag("body")
|
||||
.select("div.container > div > div.post-list")
|
||||
.select("div.col-md-3.col-sm-6.col-xs-6")
|
||||
//Log.i(DEV, "Result => $document")
|
||||
return document.map {
|
||||
val content = it.select("div.video-item > div > a").firstOrNull()
|
||||
//Log.i(DEV, "Result => $content")
|
||||
val linkCode = content?.attr("href") ?: ""
|
||||
val href = fixUrl(linkCode)
|
||||
val imgContent = content?.select("img")
|
||||
val title = imgContent?.attr("alt") ?: "<No Title Found>"
|
||||
val image = imgContent?.attr("data-original")?.trim('\'')
|
||||
val year = null
|
||||
//Log.i(DEV, "Result => Title: ${title}, Image: ${image}")
|
||||
|
||||
MovieSearchResponse(
|
||||
title,
|
||||
href,
|
||||
this.name,
|
||||
globaltvType,
|
||||
image,
|
||||
year
|
||||
)
|
||||
}
|
||||
}
|
||||
//TODO: Fix load
|
||||
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("body")
|
||||
.select("div.video-box-ather.container > div.container > div")
|
||||
.select("div > div > img")?.firstOrNull()
|
||||
//Log.i(DEV, "Result => ${body}")
|
||||
// Video details
|
||||
val poster = body?.attr("src")
|
||||
val title = body?.attr("alt") ?: "<No Title>"
|
||||
val descript = "<No Synopsis found>"
|
||||
val year = null
|
||||
|
||||
// Video link
|
||||
val streamUrl = ""
|
||||
return MovieLoadResponse(
|
||||
name = title,
|
||||
url = url,
|
||||
apiName = this.name,
|
||||
type = globaltvType,
|
||||
dataUrl = streamUrl,
|
||||
posterUrl = poster,
|
||||
year = year,
|
||||
plot = descript,
|
||||
comingSoon = true
|
||||
)
|
||||
}
|
||||
}
|
13
HpJav/src/main/kotlin/com/jacekun/HpJavPlugin.kt
Normal file
13
HpJav/src/main/kotlin/com/jacekun/HpJavPlugin.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 HpJavPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(HpJav())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue