fix(pt/animesgratis): Change domain/name for pt/Bakashi to pt/Q1N (#439)
|
@ -1,9 +1,9 @@
|
|||
ext {
|
||||
extName = 'Bakashi'
|
||||
extClass = '.Bakashi'
|
||||
extName = 'Q1N'
|
||||
extClass = '.Q1N'
|
||||
themePkg = 'dooplay'
|
||||
baseUrl = 'https://bakashi.tv'
|
||||
overrideVersionCode = 14
|
||||
baseUrl = 'https://q1n.net'
|
||||
overrideVersionCode = 15
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 13 KiB |
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.animeextension.pt.animesgratis
|
|||
|
||||
import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.NoaExtractor
|
||||
import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.RuplayExtractor
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.lib.bloggerextractor.BloggerExtractor
|
||||
|
@ -20,10 +21,10 @@ import org.jsoup.nodes.Element
|
|||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class Bakashi : DooPlay(
|
||||
class Q1N : DooPlay(
|
||||
"pt-BR",
|
||||
"Bakashi",
|
||||
"https://bakashi.net",
|
||||
"Q1N",
|
||||
"https://q1n.net",
|
||||
) {
|
||||
|
||||
override val id: Long = 2969482460524685571L
|
||||
|
@ -34,12 +35,45 @@ class Bakashi : DooPlay(
|
|||
|
||||
// ============================== Popular ===============================
|
||||
override fun popularAnimeSelector() = "div.items.featured article div.poster"
|
||||
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/animes/", headers)
|
||||
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/a/", headers)
|
||||
|
||||
// =============================== Latest ===============================
|
||||
override val latestUpdatesPath = "e"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override fun searchAnimeSelector() = "div.result-item article div.thumbnail > a"
|
||||
override fun searchAnimeFromElement(element: Element) = popularAnimeFromElement(element)
|
||||
|
||||
// =========================== Anime Details ============================
|
||||
override val additionalInfoSelector = "div.wp-content"
|
||||
|
||||
override fun animeDetailsParse(document: Document): SAnime {
|
||||
val doc = getRealAnimeDoc(document)
|
||||
val sheader = doc.selectFirst("div.sheader")!!
|
||||
return SAnime.create().apply {
|
||||
setUrlWithoutDomain(doc.location())
|
||||
sheader.selectFirst("div.poster > img")!!.let {
|
||||
thumbnail_url = it.getImageUrl()
|
||||
title = it.attr("alt").ifEmpty {
|
||||
sheader.selectFirst("div.data > h1")!!.text()
|
||||
}
|
||||
}
|
||||
|
||||
genre = sheader.select("div.data div.sgeneros > a")
|
||||
.eachText()
|
||||
.joinToString()
|
||||
|
||||
doc.selectFirst("div#info")?.let { info ->
|
||||
description = buildString {
|
||||
append(doc.getDescription())
|
||||
additionalInfoItems.forEach {
|
||||
info.getInfo(it)?.let(::append)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================== Episodes ==============================
|
||||
override fun getSeasonEpisodes(season: Element): List<SEpisode> {
|
||||
val seasonName = season.selectFirst("span.se-t")?.text()
|
||||
|
@ -94,7 +128,7 @@ class Bakashi : DooPlay(
|
|||
"filemoon" in name -> filemoonExtractor.videosFromUrl(url)
|
||||
"mixdrop" in name -> mixDropExtractor.videoFromUrl(url)
|
||||
"streamtape" in name -> streamTapeExtractor.videosFromUrl(url)
|
||||
"/noance/" in url || "/noa" in url || "/ao/" in url -> noaExtractor.videosFromUrl(url)
|
||||
"noa" in name -> noaExtractor.videosFromUrl(url)
|
||||
"/player/" in url -> bloggerExtractor.videosFromUrl(url, headers)
|
||||
else -> emptyList()
|
||||
}
|
||||
|
@ -135,7 +169,7 @@ class Bakashi : DooPlay(
|
|||
|
||||
// ============================= Utilities ==============================
|
||||
override fun getRealAnimeDoc(document: Document): Document {
|
||||
if (!document.location().contains("/episodio/")) return document
|
||||
if (!document.location().contains("/e/")) return document
|
||||
|
||||
return document.selectFirst("div.pag_episodes div.item > a:has(i.fa-th)")?.let {
|
||||
client.newCall(GET(it.attr("href"), headers)).execute()
|
|
@ -7,19 +7,35 @@ import okhttp3.OkHttpClient
|
|||
|
||||
class NoaExtractor(private val client: OkHttpClient, private val headers: Headers) {
|
||||
fun videosFromUrl(url: String): List<Video> {
|
||||
return client.newCall(GET(url)).execute()
|
||||
val body = client.newCall(GET(url)).execute()
|
||||
.body.string()
|
||||
.substringAfter("sources: [")
|
||||
.substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.map {
|
||||
val label = it.substringAfter("label").substringAfter(":\"").substringBefore('"')
|
||||
val videoUrl = it.substringAfter("file")
|
||||
|
||||
return when {
|
||||
"file: jw.file" in body -> {
|
||||
val videoUrl = body.substringAfter("file")
|
||||
.substringAfter(":\"")
|
||||
.substringBefore('"')
|
||||
.replace("\\", "")
|
||||
Video(videoUrl, "Player - $label", videoUrl, headers)
|
||||
listOf(Video(videoUrl, "NOA", videoUrl, headers))
|
||||
}
|
||||
|
||||
"sources:" in body -> {
|
||||
body.substringAfter("sources: [")
|
||||
.substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.map {
|
||||
val label =
|
||||
it.substringAfter("label").substringAfter(":\"").substringBefore('"')
|
||||
val videoUrl = it.substringAfter("file")
|
||||
.substringAfter(":\"")
|
||||
.substringBefore('"')
|
||||
.replace("\\", "")
|
||||
Video(videoUrl, "NOA - $label", videoUrl, headers)
|
||||
}
|
||||
}
|
||||
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|