mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed tracker in Samehadaku
This commit is contained in:
parent
4edcde11b0
commit
dbfff2f329
2 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -101,7 +101,7 @@ class Samehadaku : MainAPI() {
|
|||
}
|
||||
|
||||
val document = app.get(fixUrl ?: return null).document
|
||||
val title = document.selectFirst("h1.entry-title")?.text()?.removeSurrounding("Nonton", "Subtitle Indonesia")?.trim() ?: return null
|
||||
val title = document.selectFirst("h1.entry-title")?.text()?.removeBloat() ?: return null
|
||||
val poster = document.selectFirst("div.thumb > img")?.attr("src")
|
||||
val tags = document.select("div.genre-info > a").map { it.text() }
|
||||
val year = document.selectFirst("div.spe > span:contains(Rilis)")?.ownText()?.let {
|
||||
|
@ -180,6 +180,10 @@ class Samehadaku : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
private fun String.removeBloat() : String{
|
||||
return this.replace(Regex("(Nonton)|(Anime)|(Subtitle\\sIndonesia)"), "").trim()
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
|
|
Loading…
Reference in a new issue