fixes Oploverz Home (#1306)

* [fixes] Oploverz Home

* small fix
This commit is contained in:
Hexated 2022-07-19 00:23:35 +07:00 committed by GitHub
parent 602429ea8b
commit a241bed56c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,5 @@
package com.lagradost.cloudstream3.animeproviders
import android.util.Log
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
@ -90,12 +89,10 @@ class OploverzProvider : MainAPI() {
private fun Element.toSearchResult(): AnimeSearchResponse {
val href = getProperAnimeLink(this.selectFirst("a.tip")!!.attr("href"))
val title = this.selectFirst("h2[itemprop=headline]")!!.text().trim()
val posterUrl = fixUrl(this.selectFirst("img")!!.attr("src"))
val type = getType(this.selectFirst(".eggtype, .typez")!!.text().trim())
val epNum =
this.selectFirst(".eggepisode, span.epx")!!.text().replace(Regex("[^0-9]"), "").trim()
.toIntOrNull()
val title = this.selectFirst("h2[itemprop=headline]")?.text()?.trim() ?: ""
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
val type = getType(this.selectFirst(".eggtype, .typez")?.text()?.trim().toString())
val epNum = this.selectFirst(".eggepisode, span.epx")?.text()?.replace(Regex("[^0-9]"), "")?.trim()?.toIntOrNull()
return newAnimeSearchResponse(title, href, type) {
this.posterUrl = posterUrl
@ -108,8 +105,8 @@ class OploverzProvider : MainAPI() {
val document = app.get(link).document
return document.select("article[itemscope=itemscope]").map {
val title = it.selectFirst(".tt")!!.ownText().trim()
val poster = it.selectFirst("img")!!.attr("src")
val title = it.selectFirst(".tt")?.ownText()?.trim().toString()
val poster = fixUrlNull(it.selectFirst("img")?.attr("src"))
val tvType = getType(it.selectFirst(".typez")?.text().toString())
val href = fixUrl(it.selectFirst("a.tip")!!.attr("href"))