Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MissAV/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 8
version = 9

cloudstream {
authors = listOf("luck731")
Expand Down
53 changes: 48 additions & 5 deletions MissAV/src/main/kotlin/com/MissAV/MissAVProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class MissAVProvider : MainAPI() {
override val hasChromecastSupport = true
override val supportedTypes = setOf(TvType.NSFW)
override val vpnStatus = VPNStatus.MightBeNeeded
val subtitleCatUrl = "https://www.subtitlecat.com"

override val mainPage = mainPageOf(
"/dm514/en/new" to "Recent Update",
Expand Down Expand Up @@ -46,7 +47,7 @@ class MissAVProvider : MainAPI() {

val searchResponse = mutableListOf<SearchResponse>()

for (i in 1..5) {
for (i in 1..7) {
val document = app.get("$mainUrl/en/search/$query?page=$i").document
//val document = app.get("${mainUrl}/page/$i/?s=$query").document

Expand Down Expand Up @@ -82,7 +83,7 @@ class MissAVProvider : MainAPI() {
override suspend fun load(url: String): LoadResponse {
val document = app.get(url).document

val title = document.selectFirst("meta[property=og:title]")?.attr("content")?.trim().toString().replace("| PornHoarder.tv","")
val title = document.selectFirst("meta[property=og:title]")?.attr("content")?.trim().toString()
val poster = fixUrlNull(document.selectFirst("[property='og:image']")?.attr("content"))
val description = document.selectFirst("meta[property=og:description]")?.attr("content")?.trim()

Expand All @@ -93,8 +94,11 @@ class MissAVProvider : MainAPI() {
}

override suspend fun loadLinks(data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit): Boolean {
with(app.get(data)) {
getAndUnpack(this.text).let { unpackedText ->


val data = app.get(data)
val doc = data.document
getAndUnpack(data.text).let { unpackedText ->
val linkList = unpackedText.split(";")
val finalLink = "source='(.*)'".toRegex().find(linkList.first())?.groups?.get(1)?.value
callback.invoke(
Expand All @@ -109,7 +113,46 @@ class MissAVProvider : MainAPI() {
}
)
}
}

try {
val title = doc.selectFirst("meta[property=og:title]")?.attr("content")?.trim().toString()
val javCode = "([a-zA-Z]+-\\d+)".toRegex().find(title)?.groups?.get(1)?.value
if(!javCode.isNullOrEmpty())
{
val query = "$subtitleCatUrl/index.php?search=$javCode"
val subDoc = app.get(query, timeout = 15).document
val subList = subDoc.select("td a")
for(item in subList)
{
if(item.text().contains(javCode,ignoreCase = true))
{
val fullUrl = "$subtitleCatUrl/${item.attr("href")}"
val pDoc = app.get(fullUrl, timeout = 10).document
val sList = pDoc.select(".col-md-6.col-lg-4")
for(item in sList)
{
try {
val language = item.select(".sub-single span:nth-child(2)").text()
val text = item.select(".sub-single span:nth-child(3) a")
if(text != null && text.size > 0 && text[0].text() == "Download")
{
val url = "$subtitleCatUrl${text[0].attr("href")}"
subtitleCallback.invoke(
SubtitleFile(
language.replace("\uD83D\uDC4D \uD83D\uDC4E",""), // Use label for the name
url // Use extracted URL
)
)
}
} catch (e: Exception) { }
}

}
}

}
} catch (e: Exception) { }



return true
Expand Down