fix: Removed portuguese dead sources (#445)
|
@ -1,9 +0,0 @@
|
|||
ext {
|
||||
extName = 'AnimesFox BR'
|
||||
extClass = '.AnimesFoxBR'
|
||||
themePkg = 'dooplay'
|
||||
baseUrl = 'https://animesfox.net'
|
||||
overrideVersionCode = 2
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 22 KiB |
|
@ -1,209 +0,0 @@
|
|||
package eu.kanade.tachiyomi.animeextension.pt.animesfoxbr
|
||||
|
||||
import android.util.Base64
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.FormBody
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class AnimesFoxBR : DooPlay(
|
||||
"pt-BR",
|
||||
"AnimesFox BR",
|
||||
"https://animesfox.net",
|
||||
) {
|
||||
// ============================== Popular ===============================
|
||||
// The site doesn't have a true popular anime tab,
|
||||
// so we use the latest added anime page instead.
|
||||
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/animes/page/$page")
|
||||
|
||||
override fun popularAnimeSelector() = "div.clw div.b_flex > div > a"
|
||||
|
||||
override fun popularAnimeNextPageSelector() = "div.pagination i#nextpagination"
|
||||
|
||||
// ============================== Episodes ==============================
|
||||
override fun episodeListSelector() = "div.se-a > div.anime_item > a"
|
||||
|
||||
override fun episodeFromElement(element: Element, seasonName: String) =
|
||||
super.episodeFromElement(element, seasonName).apply {
|
||||
name = name.substringBefore("- ")
|
||||
}
|
||||
|
||||
// ============================ Video Links =============================
|
||||
override val prefQualityValues = arrayOf("360p ~ SD", "720p ~ HD")
|
||||
override val prefQualityEntries = prefQualityValues
|
||||
|
||||
override fun videoListParse(response: Response): List<Video> {
|
||||
val doc = response.asJsoup()
|
||||
return doc.select("ul#playeroptionsul li").mapNotNull {
|
||||
val url = getPlayerUrl(it)
|
||||
val language = it.selectFirst("span.title")?.text() ?: "Linguagem desconhecida"
|
||||
when {
|
||||
baseUrl in url -> extractVideos(url, language)
|
||||
else -> null
|
||||
}
|
||||
}.flatten()
|
||||
}
|
||||
|
||||
private fun extractVideos(url: String, language: String): List<Video> {
|
||||
return client.newCall(GET(url, headers)).execute().let { response ->
|
||||
response.body.string()
|
||||
.substringAfter("sources:[")
|
||||
.substringBefore("]")
|
||||
.split("},")
|
||||
.mapNotNull {
|
||||
val videoUrl = it.substringAfter("file: \"")
|
||||
.substringBefore('"')
|
||||
.ifBlank { return@mapNotNull null }
|
||||
val quality = it.substringAfter("label:\"").substringBefore('"')
|
||||
Video(videoUrl, "$language($quality)", videoUrl, headers = headers)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getPlayerUrl(player: Element): String {
|
||||
val body = FormBody.Builder()
|
||||
.add("action", "doo_player_ajax")
|
||||
.add("post", player.attr("data-post"))
|
||||
.add("nume", player.attr("data-nume"))
|
||||
.add("type", player.attr("data-type"))
|
||||
.build()
|
||||
|
||||
return client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", headers, body))
|
||||
.execute()
|
||||
.let { response ->
|
||||
response.body.string()
|
||||
.substringAfter("\"embed_url\":\"")
|
||||
.substringBefore("\",")
|
||||
.replace("\\", "")
|
||||
.let { url ->
|
||||
when {
|
||||
url.contains("token=") -> {
|
||||
url.substringAfter("token=")
|
||||
.substringBefore("' ")
|
||||
.let { Base64.decode(it, Base64.DEFAULT) }
|
||||
.let(::String)
|
||||
}
|
||||
url.contains("iframe") -> {
|
||||
url.substringAfter("?link=").substringBefore("'")
|
||||
}
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =============================== Search ===============================
|
||||
override fun searchAnimeNextPageSelector() = "div.pagination > *:last-child:not(.current)"
|
||||
|
||||
// ============================== Filters ===============================
|
||||
override fun genresListRequest() = GET("$baseUrl/categorias")
|
||||
|
||||
override fun genresListSelector() = "div.box_category > a"
|
||||
|
||||
override fun genresListParse(document: Document) =
|
||||
super.genresListParse(document).map {
|
||||
Pair(it.first.substringAfter(" "), it.second)
|
||||
}.toTypedArray()
|
||||
|
||||
// =========================== Anime Details ============================
|
||||
override fun animeDetailsParse(document: Document): SAnime {
|
||||
val doc = getRealAnimeDoc(document)
|
||||
return SAnime.create().apply {
|
||||
setUrlWithoutDomain(doc.location())
|
||||
thumbnail_url = doc.selectFirst("div.capa_poster img")!!.attr("src")
|
||||
val container = doc.selectFirst("div.container_anime_r")!!
|
||||
title = container.selectFirst("div > h1")!!.text().let {
|
||||
when {
|
||||
"email protected" in it -> {
|
||||
val decoded = container.selectFirst("div > h1 > a")!!
|
||||
.attr("data-cfemail")
|
||||
.decodeEmail()
|
||||
it.replace("[email protected]", decoded)
|
||||
}
|
||||
else -> it
|
||||
}
|
||||
}
|
||||
genre = container.select("div.btn_gen").eachText().joinToString()
|
||||
description = buildString {
|
||||
container.selectFirst("div.sinopse")?.let {
|
||||
append(it.text() + "\n\n")
|
||||
}
|
||||
|
||||
container.selectFirst("div.container_anime_nome > h2")?.let {
|
||||
append("Nome alternativo: ${it.text()}\n")
|
||||
}
|
||||
|
||||
container.select("div.container_anime_back").forEach {
|
||||
val infoType = it.selectFirst("div.info-nome")?.text() ?: return@forEach
|
||||
val infoData = it.selectFirst("span")?.text() ?: return@forEach
|
||||
append("$infoType: $infoData\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =============================== Latest ===============================
|
||||
override val latestUpdatesPath = "episodios"
|
||||
|
||||
override fun latestUpdatesSelector() = popularAnimeSelector()
|
||||
|
||||
override fun latestUpdatesNextPageSelector() = popularAnimeNextPageSelector()
|
||||
|
||||
// ============================== Settings ==============================
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
val videoLanguagePref = ListPreference(screen.context).apply {
|
||||
key = PREF_LANGUAGE_KEY
|
||||
title = PREF_LANGUAGE_TITLE
|
||||
entries = PREF_LANGUAGE_ENTRIES
|
||||
entryValues = PREF_LANGUAGE_VALUES
|
||||
setDefaultValue(PREF_LANGUAGE_DEFAULT)
|
||||
summary = "%s"
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
val selected = newValue as String
|
||||
val index = findIndexOfValue(selected)
|
||||
val entry = entryValues[index] as String
|
||||
preferences.edit().putString(key, entry).commit()
|
||||
}
|
||||
}
|
||||
|
||||
screen.addPreference(videoLanguagePref)
|
||||
super.setupPreferenceScreen(screen)
|
||||
}
|
||||
|
||||
// ============================= Utilities ==============================
|
||||
override val animeMenuSelector = "div.epsL i.material-icons:contains(library)"
|
||||
|
||||
private fun String.decodeEmail(): String {
|
||||
val hex = chunked(2).map { it.toInt(16) }
|
||||
return hex.drop(1).joinToString("") {
|
||||
Char(it xor hex.first()).toString()
|
||||
}
|
||||
}
|
||||
|
||||
override fun List<Video>.sort(): List<Video> {
|
||||
val quality = preferences.getString(videoSortPrefKey, videoSortPrefDefault)!!
|
||||
val language = preferences.getString(PREF_LANGUAGE_KEY, PREF_LANGUAGE_DEFAULT)!!
|
||||
return sortedWith(
|
||||
compareBy(
|
||||
{ it.quality.lowercase().contains(quality.lowercase()) },
|
||||
{ it.quality.lowercase().contains(language.lowercase()) },
|
||||
),
|
||||
).reversed()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PREF_LANGUAGE_KEY = "preferred_language"
|
||||
private const val PREF_LANGUAGE_DEFAULT = "Legendado"
|
||||
private const val PREF_LANGUAGE_TITLE = "Língua preferida"
|
||||
private val PREF_LANGUAGE_VALUES = arrayOf("Legendado", "Dublado")
|
||||
private val PREF_LANGUAGE_ENTRIES = PREF_LANGUAGE_VALUES
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".pt.otakuanimes.OtakuAnimesUrlActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="otakuanimesscc.com"
|
||||
android:pathPattern="/..*"
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="otakuanimesscc.com"
|
||||
android:pathPattern="/anime/..*"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
|
@ -1,12 +0,0 @@
|
|||
ext {
|
||||
extName = 'OtakuAnimes'
|
||||
extClass = '.OtakuAnimes'
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation(project(":lib:playlist-utils"))
|
||||
}
|
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 11 KiB |
|
@ -1,247 +0,0 @@
|
|||
package eu.kanade.tachiyomi.animeextension.pt.otakuanimes
|
||||
|
||||
import android.app.Application
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
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.animesource.online.ParsedAnimeHttpSource
|
||||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class OtakuAnimes : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
|
||||
override val name = "Otaku Animes"
|
||||
|
||||
override val baseUrl = "https://otakuanimesscc.com"
|
||||
|
||||
override val lang = "pt-BR"
|
||||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val preferences by lazy {
|
||||
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
}
|
||||
|
||||
override fun headersBuilder() = super.headersBuilder()
|
||||
.add("Referer", baseUrl)
|
||||
.add("Origin", baseUrl)
|
||||
|
||||
// ============================== Popular ===============================
|
||||
override fun popularAnimeRequest(page: Int) = GET(baseUrl, headers)
|
||||
|
||||
override fun popularAnimeSelector() = "div.calendarioL div.ultAnisContainerItem > a"
|
||||
|
||||
override fun popularAnimeFromElement(element: Element) = SAnime.create().apply {
|
||||
setUrlWithoutDomain(element.attr("href"))
|
||||
title = element.selectFirst("div.aniNome")!!.text().trim()
|
||||
thumbnail_url = element.selectFirst("img")?.getImageUrl()
|
||||
}
|
||||
|
||||
override fun popularAnimeNextPageSelector() = null
|
||||
|
||||
// =============================== Latest ===============================
|
||||
override fun latestUpdatesRequest(page: Int) =
|
||||
GET("$baseUrl/lista-de-animes/page/$page", headers)
|
||||
|
||||
override fun latestUpdatesSelector() = "div.ultAnisContainer div.ultAnisContainerItem > a"
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element) = popularAnimeFromElement(element)
|
||||
|
||||
override fun latestUpdatesNextPageSelector() = "div.paginacao a.next"
|
||||
|
||||
// =============================== Search ===============================
|
||||
override suspend fun getSearchAnime(
|
||||
page: Int,
|
||||
query: String,
|
||||
filters: AnimeFilterList,
|
||||
): AnimesPage {
|
||||
return if (query.startsWith(PREFIX_SEARCH)) {
|
||||
val path = query.removePrefix(PREFIX_SEARCH)
|
||||
client.newCall(GET("$baseUrl/$path"))
|
||||
.awaitSuccess()
|
||||
.use(::searchAnimeByIdParse)
|
||||
} else {
|
||||
super.getSearchAnime(page, query, filters)
|
||||
}
|
||||
}
|
||||
|
||||
private fun searchAnimeByIdParse(response: Response): AnimesPage {
|
||||
val details = animeDetailsParse(response).apply {
|
||||
setUrlWithoutDomain(response.request.url.toString())
|
||||
initialized = true
|
||||
}
|
||||
|
||||
return AnimesPage(listOf(details), false)
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val url = "$baseUrl/page".toHttpUrl().newBuilder()
|
||||
.addPathSegment(page.toString())
|
||||
.addQueryParameter("s", query)
|
||||
.build()
|
||||
|
||||
return GET(url, headers = headers)
|
||||
}
|
||||
|
||||
override fun searchAnimeSelector() = "div.SectionBusca div.ultAnisContainerItem > a"
|
||||
|
||||
override fun searchAnimeFromElement(element: Element) = latestUpdatesFromElement(element)
|
||||
|
||||
override fun searchAnimeNextPageSelector() = latestUpdatesNextPageSelector()
|
||||
|
||||
// =========================== Anime Details ============================
|
||||
override fun animeDetailsParse(document: Document): SAnime {
|
||||
val doc = getRealDoc(document)
|
||||
|
||||
return SAnime.create().apply {
|
||||
setUrlWithoutDomain(doc.location())
|
||||
title = doc.selectFirst("div.animeFirstContainer h1")!!.text()
|
||||
thumbnail_url = doc.selectFirst("div.animeCapa img")?.getImageUrl()
|
||||
description = doc.selectFirst("div.animeSecondContainer > p")?.text()
|
||||
genre = doc.select("ul.animeGen li").eachText()?.joinToString(", ")
|
||||
}
|
||||
}
|
||||
|
||||
// ============================== Episodes ==============================
|
||||
override fun episodeListParse(response: Response): List<SEpisode> {
|
||||
return getRealDoc(response.asJsoup())
|
||||
.select(episodeListSelector())
|
||||
.map(::episodeFromElement)
|
||||
.reversed()
|
||||
}
|
||||
|
||||
override fun episodeListSelector() = "div.sectionEpiInAnime a"
|
||||
|
||||
override fun episodeFromElement(element: Element) = SEpisode.create().apply {
|
||||
setUrlWithoutDomain(element.attr("href"))
|
||||
element.text().let {
|
||||
name = it.trim()
|
||||
episode_number = name.substringAfterLast(" ").toFloatOrNull() ?: 1F
|
||||
}
|
||||
}
|
||||
|
||||
// ============================ Video Links =============================
|
||||
override fun videoListParse(response: Response): List<Video> {
|
||||
val document = response.asJsoup()
|
||||
|
||||
return document.select("#player iframe")
|
||||
.parallelCatchingFlatMapBlocking {
|
||||
getVideosFromURL(it.attr("src"))
|
||||
}
|
||||
}
|
||||
|
||||
private val playlistUtils by lazy { PlaylistUtils(client) }
|
||||
private fun getVideosFromURL(url: String): List<Video> {
|
||||
return when {
|
||||
"playerhls" in url -> {
|
||||
return client.newCall(GET(url, headers)).execute().body.string()
|
||||
.substringAfter("sources: [")
|
||||
.substringBefore("],").split("{").drop(1).map {
|
||||
val label = it.substringAfter("label: \"")
|
||||
.substringBefore('"')
|
||||
|
||||
val playlistUrl = it.substringAfter("file: '")
|
||||
.substringBefore("'")
|
||||
.replace("\\", "")
|
||||
|
||||
return playlistUtils.extractFromHls(
|
||||
playlistUrl,
|
||||
videoNameGen = { label },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
override fun videoListSelector(): String {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun videoFromElement(element: Element): Video {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun videoUrlParse(document: Document): String {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
// ============================== Settings ==============================
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
ListPreference(screen.context).apply {
|
||||
key = PREF_QUALITY_KEY
|
||||
title = PREF_QUALITY_TITLE
|
||||
entries = PREF_QUALITY_VALUES
|
||||
entryValues = PREF_QUALITY_VALUES
|
||||
setDefaultValue(PREF_QUALITY_DEFAULT)
|
||||
summary = "%s"
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
val selected = newValue as String
|
||||
val index = findIndexOfValue(selected)
|
||||
val entry = entryValues[index] as String
|
||||
preferences.edit().putString(key, entry).commit()
|
||||
}
|
||||
}.also(screen::addPreference)
|
||||
}
|
||||
|
||||
override fun List<Video>.sort(): List<Video> {
|
||||
val quality = preferences.getString(PREF_QUALITY_KEY, PREF_QUALITY_DEFAULT)!!
|
||||
return sortedWith(
|
||||
compareBy(
|
||||
{ it.quality.contains(quality) },
|
||||
{ REGEX_QUALITY.find(it.quality)?.groupValues?.get(1)?.toIntOrNull() ?: 0 },
|
||||
),
|
||||
).reversed()
|
||||
}
|
||||
|
||||
// ============================= Utilities ==============================
|
||||
private fun getRealDoc(document: Document): Document {
|
||||
val menu = document.selectFirst("a.aniBack")
|
||||
if (menu != null) {
|
||||
val originalUrl = menu.parent()!!.attr("href")
|
||||
val response = client.newCall(GET(originalUrl, headers)).execute()
|
||||
return response.asJsoup()
|
||||
}
|
||||
|
||||
return document
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to get the image url via various possible attributes.
|
||||
* Taken from Tachiyomi's Madara multisrc.
|
||||
*/
|
||||
protected open fun Element.getImageUrl(): String? {
|
||||
return when {
|
||||
hasAttr("data-src") -> attr("abs:data-src")
|
||||
hasAttr("data-lazy-src") -> attr("abs:data-lazy-src")
|
||||
hasAttr("srcset") -> attr("abs:srcset").substringBefore(" ")
|
||||
else -> attr("abs:src")
|
||||
}.substringBefore("?resize")
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val PREFIX_SEARCH = "path:"
|
||||
private val REGEX_QUALITY by lazy { Regex("""(\d+)p""") }
|
||||
|
||||
private const val PREF_QUALITY_KEY = "preferred_quality"
|
||||
private const val PREF_QUALITY_TITLE = "Qualidade preferida"
|
||||
private const val PREF_QUALITY_DEFAULT = "720p"
|
||||
private val PREF_QUALITY_VALUES = arrayOf("360p", "720p", "1080p")
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package eu.kanade.tachiyomi.animeextension.pt.otakuanimes
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
/**
|
||||
* Springboard that accepts https://otakuanimesscc.com/a/<slug> and https://otakuanimesscc.com/<id> intents
|
||||
* and redirects them to the main Aniyomi process.
|
||||
*/
|
||||
class OtakuAnimesUrlActivity : Activity() {
|
||||
|
||||
private val tag = javaClass.simpleName
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size > 0) {
|
||||
val searchQuery = if (pathSegments.size > 1) {
|
||||
"${pathSegments[0]}/${pathSegments[1]}"
|
||||
} else {
|
||||
pathSegments[0]
|
||||
}
|
||||
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.ANIMESEARCH"
|
||||
putExtra("query", "${OtakuAnimes.PREFIX_SEARCH}$searchQuery")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
try {
|
||||
startActivity(mainIntent)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.e(tag, e.toString())
|
||||
}
|
||||
} else {
|
||||
Log.e(tag, "could not parse uri from intent $intent")
|
||||
}
|
||||
|
||||
finish()
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
ext {
|
||||
extName = 'RineCloud'
|
||||
extClass = '.RineCloud'
|
||||
themePkg = 'animestream'
|
||||
baseUrl = 'https://rine.cloud'
|
||||
overrideVersionCode = 10
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation(project(":lib:unpacker"))
|
||||
implementation(project(":lib:playlist-utils"))
|
||||
}
|
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 18 KiB |
|
@ -1,25 +0,0 @@
|
|||
package eu.kanade.tachiyomi.animeextension.pt.rinecloud
|
||||
|
||||
import eu.kanade.tachiyomi.animeextension.pt.rinecloud.extractors.RineCloudExtractor
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
||||
|
||||
class RineCloud : AnimeStream(
|
||||
"pt-BR",
|
||||
"RineCloud",
|
||||
"https://rine.cloud",
|
||||
) {
|
||||
override fun headersBuilder() = super.headersBuilder().add("Referer", baseUrl)
|
||||
|
||||
// ============================ Video Links =============================
|
||||
override val prefQualityValues = arrayOf("1080p", "720p", "480p", "360p", "240p")
|
||||
override val prefQualityEntries = prefQualityValues
|
||||
|
||||
private val rinecloudExtractor by lazy { RineCloudExtractor(client, headers) }
|
||||
override fun getVideoList(url: String, name: String): List<Video> {
|
||||
return when {
|
||||
"rine.cloud" in url -> rinecloudExtractor.videosFromUrl(url)
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package eu.kanade.tachiyomi.animeextension.pt.rinecloud.extractors
|
||||
|
||||
import android.util.Base64
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
|
||||
import eu.kanade.tachiyomi.lib.unpacker.Unpacker
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.Headers
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
class RineCloudExtractor(private val client: OkHttpClient, private val headers: Headers) {
|
||||
private val playlistUtils by lazy { PlaylistUtils(client, headers) }
|
||||
|
||||
fun videosFromUrl(url: String): List<Video> {
|
||||
val playerDoc = client.newCall(GET(url, headers)).execute().asJsoup()
|
||||
val encodedScript = playerDoc.selectFirst("script:containsData(JuicyCodes.Run)")
|
||||
?.data()
|
||||
|
||||
val script = if (encodedScript != null) {
|
||||
val decodedData = encodedScript.substringAfter("(").substringBefore(")")
|
||||
.split("+\"")
|
||||
.joinToString("") { it.replace("\"", "") }
|
||||
.let { Base64.decode(it, Base64.DEFAULT) }
|
||||
.let(::String)
|
||||
Unpacker.unpack(decodedData).ifEmpty { return emptyList() }
|
||||
} else {
|
||||
playerDoc.selectFirst("script:containsData(const player)")?.data()
|
||||
?: return emptyList()
|
||||
}
|
||||
|
||||
return script.substringAfter("sources:").substringBefore("]")
|
||||
.split("{")
|
||||
.drop(1)
|
||||
.flatMap {
|
||||
val videoUrl = it.substringAfter("\"file\"").substringAfter('"').substringBefore('"')
|
||||
val quality = it.substringAfter("\"label\"").substringAfter('"').substringBefore('"').ifBlank { "Unknown" }
|
||||
|
||||
when {
|
||||
arrayOf("googlevideo", ".mp4").any(videoUrl) -> listOf(Video(videoUrl, "Rinecloud - $quality", videoUrl, headers))
|
||||
else -> playlistUtils.extractFromHls(videoUrl, videoNameGen = { "Rinecloud - ${if (it == "Video") quality else it}" })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Array<String>.any(url: String): Boolean = this.any { url.contains(it, ignoreCase = true) }
|
||||
}
|