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.*
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,19 +204,30 @@ 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 {
val qual = if (it.text() if (it.hasAttr("download")) {
.contains("HDP") val qual = if (it.text()
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString() .contains("HDP")
ExtractorLink( ) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
"Gogoanime", listOf(ExtractorLink(
if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p", "Gogoanime",
it.attr("href"), if(qual == "null") "Gogoanime" else "Gogoanime - " + qual + "p",
page.url, it.attr("href"),
getQualityFromName(qual), page.url,
it.attr("href").contains(".m3u8") 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( override fun loadLinks(