fixes [OnePace] [VostFree] (#813)

* fixes [OnePace]

* fix [VostFree]
This commit is contained in:
Diego Peña Y Lillo
2022-08-29 05:24:25 -04:00
committed by GitHub
parent 86b2ed198c
commit 3d54b44b26
4 changed files with 14 additions and 9 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Onepace'
pkgNameSuffix = 'all.onepace'
extClass = '.OnepaceFactory'
extVersionCode = 6
extVersionCode = 7
libVersion = '13'
containsNsfw = false
}

View File

@ -26,7 +26,7 @@ import org.jsoup.nodes.Element
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy
import java.lang.Exception
import kotlin.Exception
open class Onepace(override val lang: String, override val name: String) : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
@ -106,10 +106,15 @@ open class Onepace(override val lang: String, override val name: String) : Confi
val jsoup = client.newCall(GET(realUrl)).execute().asJsoup()
return jsoup.select("table.listingplikow tbody tr.filerow.even").map {
val epName = it.select("td.cien a.name").text().replace(".mp4", "")
val epNum = epName.substringAfter("][").substringBefore("]")
.replace("-", ".")
.replace(",", ".")
.replace("F", ".").replace("B", "0").toFloat()
val epNum = try {
epName.substringAfter("][").substringBefore("]")
.replace("-", ".")
.replace(",", ".")
.replace("F", ".").replace("B", "0").toFloat()
} catch (e: Exception) {
// bruh
(Math.random() * 100).toFloat()
}
val epUrl = it.select("td.cien a.name").attr("href")
SEpisode.create().apply {
name = epName

View File

@ -5,7 +5,7 @@ ext {
extName = 'Vostfree'
pkgNameSuffix = 'fr.vostfree'
extClass = '.Vostfree'
extVersionCode = 8
extVersionCode = 9
libVersion = '13'
}

View File

@ -64,7 +64,7 @@ class Vostfree : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
override fun episodeListParse(response: Response): List<SEpisode> {
val episodes = mutableListOf<SEpisode>()
val jsoup = response.asJsoup()
jsoup.select("select.new_player_selector option").forEach { it ->
jsoup.select("select.new_player_selector option").forEachIndexed { index, it ->
val epNum = it.text().replace("Episode", "").drop(2)
if (it.text() == "Film") {
@ -79,7 +79,7 @@ class Vostfree : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
episode_number = epNum.toFloat()
name = "Épisode $epNum"
}
episode.setUrlWithoutDomain("?episode:${epNum.toInt() - 1}/${response.request.url}")
episode.setUrlWithoutDomain("?episode:$index/${response.request.url}")
episodes.add(episode)
}
}