fix(pt/animesgratis): Change domain/name for pt/Bakashi to pt/Q1N (#439)

This commit is contained in:
WebDitto 2024-12-19 18:06:23 -03:00 committed by GitHub
parent 8a5a2221c7
commit f4d837083e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 69 additions and 19 deletions

View file

@ -1,9 +1,9 @@
ext { ext {
extName = 'Bakashi' extName = 'Q1N'
extClass = '.Bakashi' extClass = '.Q1N'
themePkg = 'dooplay' themePkg = 'dooplay'
baseUrl = 'https://bakashi.tv' baseUrl = 'https://q1n.net'
overrideVersionCode = 14 overrideVersionCode = 15
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

@ -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.NoaExtractor
import eu.kanade.tachiyomi.animeextension.pt.animesgratis.extractors.RuplayExtractor 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.SEpisode
import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.bloggerextractor.BloggerExtractor import eu.kanade.tachiyomi.lib.bloggerextractor.BloggerExtractor
@ -20,10 +21,10 @@ import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
class Bakashi : DooPlay( class Q1N : DooPlay(
"pt-BR", "pt-BR",
"Bakashi", "Q1N",
"https://bakashi.net", "https://q1n.net",
) { ) {
override val id: Long = 2969482460524685571L override val id: Long = 2969482460524685571L
@ -34,12 +35,45 @@ class Bakashi : DooPlay(
// ============================== Popular =============================== // ============================== Popular ===============================
override fun popularAnimeSelector() = "div.items.featured article div.poster" 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 =============================== // =============================== Search ===============================
override fun searchAnimeSelector() = "div.result-item article div.thumbnail > a" override fun searchAnimeSelector() = "div.result-item article div.thumbnail > a"
override fun searchAnimeFromElement(element: Element) = popularAnimeFromElement(element) 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 ============================== // ============================== Episodes ==============================
override fun getSeasonEpisodes(season: Element): List<SEpisode> { override fun getSeasonEpisodes(season: Element): List<SEpisode> {
val seasonName = season.selectFirst("span.se-t")?.text() val seasonName = season.selectFirst("span.se-t")?.text()
@ -94,7 +128,7 @@ class Bakashi : DooPlay(
"filemoon" in name -> filemoonExtractor.videosFromUrl(url) "filemoon" in name -> filemoonExtractor.videosFromUrl(url)
"mixdrop" in name -> mixDropExtractor.videoFromUrl(url) "mixdrop" in name -> mixDropExtractor.videoFromUrl(url)
"streamtape" in name -> streamTapeExtractor.videosFromUrl(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) "/player/" in url -> bloggerExtractor.videosFromUrl(url, headers)
else -> emptyList() else -> emptyList()
} }
@ -135,7 +169,7 @@ class Bakashi : DooPlay(
// ============================= Utilities ============================== // ============================= Utilities ==============================
override fun getRealAnimeDoc(document: Document): Document { 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 { return document.selectFirst("div.pag_episodes div.item > a:has(i.fa-th)")?.let {
client.newCall(GET(it.attr("href"), headers)).execute() client.newCall(GET(it.attr("href"), headers)).execute()

View file

@ -7,19 +7,35 @@ import okhttp3.OkHttpClient
class NoaExtractor(private val client: OkHttpClient, private val headers: Headers) { class NoaExtractor(private val client: OkHttpClient, private val headers: Headers) {
fun videosFromUrl(url: String): List<Video> { fun videosFromUrl(url: String): List<Video> {
return client.newCall(GET(url)).execute() val body = client.newCall(GET(url)).execute()
.body.string() .body.string()
.substringAfter("sources: [")
.substringBefore("]") return when {
.split("{") "file: jw.file" in body -> {
.drop(1) val videoUrl = body.substringAfter("file")
.map {
val label = it.substringAfter("label").substringAfter(":\"").substringBefore('"')
val videoUrl = it.substringAfter("file")
.substringAfter(":\"") .substringAfter(":\"")
.substringBefore('"') .substringBefore('"')
.replace("\\", "") .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()
}
} }
} }