forked from recloudstream/cloudstream
added server support for gogo
This commit is contained in:
parent
64c5a029ac
commit
9d19f4cde7
2 changed files with 32 additions and 13 deletions
7
.idea/discord.xml
Normal file
7
.idea/discord.xml
Normal 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>
|
|
@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.animeproviders
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.extractorApis
|
||||||
import com.lagradost.cloudstream3.utils.getQualityFromName
|
import com.lagradost.cloudstream3.utils.getQualityFromName
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
@ -203,20 +204,31 @@ class GogoanimeProvider : MainAPI() {
|
||||||
val page = khttp.get(link, headers = mapOf("Referer" to iframe))
|
val page = khttp.get(link, headers = mapOf("Referer" to iframe))
|
||||||
val pageDoc = Jsoup.parse(page.text)
|
val pageDoc = Jsoup.parse(page.text)
|
||||||
|
|
||||||
return pageDoc.select(".dowload > a[download]").map {
|
return pageDoc.select(".dowload > a").map {
|
||||||
|
if (it.hasAttr("download")) {
|
||||||
val qual = if (it.text()
|
val qual = if (it.text()
|
||||||
.contains("HDP")
|
.contains("HDP")
|
||||||
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
|
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
|
||||||
ExtractorLink(
|
listOf(ExtractorLink(
|
||||||
"Gogoanime",
|
"Gogoanime",
|
||||||
if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p",
|
if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p",
|
||||||
it.attr("href"),
|
it.attr("href"),
|
||||||
page.url,
|
page.url,
|
||||||
getQualityFromName(qual),
|
getQualityFromName(qual),
|
||||||
it.attr("href").contains(".m3u8")
|
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(
|
override fun loadLinks(
|
||||||
data: String,
|
data: String,
|
||||||
|
|
Loading…
Reference in a new issue