added server support for gogo

This commit is contained in:
ArjixWasTaken 2021-09-29 19:32:44 +03:00
parent 64c5a029ac
commit 9d19f4cde7
2 changed files with 32 additions and 13 deletions

7
.idea/discord.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
</component>
</project>

View file

@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.animeproviders
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.extractorApis
import com.lagradost.cloudstream3.utils.getQualityFromName
import org.jsoup.Jsoup
import java.util.*
@ -203,19 +204,30 @@ class GogoanimeProvider : MainAPI() {
val page = khttp.get(link, headers = mapOf("Referer" to iframe))
val pageDoc = Jsoup.parse(page.text)
return pageDoc.select(".dowload > a[download]").map {
val qual = if (it.text()
.contains("HDP")
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
ExtractorLink(
"Gogoanime",
if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p",
it.attr("href"),
page.url,
getQualityFromName(qual),
it.attr("href").contains(".m3u8")
)
}
return pageDoc.select(".dowload > a").map {
if (it.hasAttr("download")) {
val qual = if (it.text()
.contains("HDP")
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
listOf(ExtractorLink(
"Gogoanime",
if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p",
it.attr("href"),
page.url,
getQualityFromName(qual),
it.attr("href").contains(".m3u8")
))
} else {
val extractorLinks = ArrayList<ExtractorLink>()
for (api in extractorApis) {
if (api.name.equals(it.text().replace("Download", "").trim(), ignoreCase = true)) {
extractorLinks.addAll(api.getSafeUrl(it.attr("href")) ?: listOf())
break
}
}
extractorLinks
}
}.flatten()
}
override fun loadLinks(