Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(multisrc/animestream/es): New source: AnimeYT.es and Anime.Tiodonghua.com and others fixs #2531

Merged
merged 11 commits into from
Nov 25, 2023
5 changes: 5 additions & 0 deletions multisrc/overrides/animestream/animeytes/additional.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
implementation(project(":lib-okru-extractor"))
implementation(project(":lib-streamtape-extractor"))
implementation(project(":lib-sendvid-extractor"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions multisrc/overrides/animestream/animeytes/src/AnimeYTES.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package eu.kanade.tachiyomi.animeextension.es.animeytes

import androidx.preference.CheckBoxPreference
import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
import eu.kanade.tachiyomi.network.GET

class AnimeYTES : AnimeStream(
"es",
"AnimeYT.es",
"https://animeyt.es",
) {
override val animeListUrl = "$baseUrl/tv"

// ============================ Video Links =============================
private val okruExtractor by lazy { OkruExtractor(client) }
private val streamtapeExtractor by lazy { StreamTapeExtractor(client) }
private val sendvidExtractor by lazy { SendvidExtractor(client, headers) }

override fun getVideoList(url: String, name: String): List<Video> {
return when (name) {
"OK" -> okruExtractor.videosFromUrl(url)
"Stream" -> streamtapeExtractor.videosFromUrl(url)
"Send" -> sendvidExtractor.videosFromUrl(url)
else -> emptyList()
}
}

// ============================ Latest Updates =============================

override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/anime", headers)
Dark25 marked this conversation as resolved.
Show resolved Hide resolved

// ============================ Preferences =============================
override fun setupPreferenceScreen(screen: PreferenceScreen) {
super.setupPreferenceScreen(screen) // Quality preference

val langPref = ListPreference(screen.context).apply {
key = PREF_LANG_KEY
title = PREF_LANG_TITLE
entries = PREF_LANG_ENTRIES
entryValues = PREF_LANG_VALUES
setDefaultValue(PREF_LANG_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()
}
}

val vrfIterceptPref = CheckBoxPreference(screen.context).apply {
key = PREF_VRF_INTERCEPT_KEY
title = PREF_VRF_INTERCEPT_TITLE
summary = PREF_VRF_INTERCEPT_SUMMARY
setDefaultValue(PREF_VRF_INTERCEPT_DEFAULT)
}

screen.addPreference(vrfIterceptPref)
screen.addPreference(langPref)
}
}

private const val PREF_LANG_KEY = "preferred_lang"
private const val PREF_LANG_TITLE = "Preferred language"
private const val PREF_LANG_DEFAULT = "SUB"
private val PREF_LANG_ENTRIES = arrayOf("SUB", "All", "ES", "LAT")
private val PREF_LANG_VALUES = arrayOf("SUB", "", "ES", "LAT")

private const val PREF_VRF_INTERCEPT_KEY = "vrf_intercept"
private const val PREF_VRF_INTERCEPT_TITLE = "Intercept VRF links (Requiere Reiniciar)"
private const val PREF_VRF_INTERCEPT_SUMMARY = "Intercept VRF links and open them in the browser"
private const val PREF_VRF_INTERCEPT_DEFAULT = false
Dark25 marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions multisrc/overrides/animestream/tiodonghua/additional.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencies {

implementation(project(":lib-okru-extractor"))
implementation(project(":lib-mixdrop-extractor"))
implementation(project(":lib-voe-extractor"))
implementation(project(":lib-yourupload-extractor"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions multisrc/overrides/animestream/tiodonghua/src/Tiodonghua.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package eu.kanade.tachiyomi.animeextension.es.tiodonghua

import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.mixdropextractor.MixDropExtractor
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
import eu.kanade.tachiyomi.network.GET

class Tiodonghua : AnimeStream(
"es",
"Tiodonghua.com",
"https://anime.tiodonghua.com",
) {
override val animeListUrl = "$baseUrl/anime"
Dark25 marked this conversation as resolved.
Show resolved Hide resolved

override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/anime/?status=&type=&sub=&order=update", headers)
Dark25 marked this conversation as resolved.
Show resolved Hide resolved

// ============================ Video Links =============================
private val okruExtractor by lazy { OkruExtractor(client) }
private val voeExtractor by lazy { VoeExtractor(client) }
private val youruploadExtractor by lazy { YourUploadExtractor(client) }
private val mixdropExtractor by lazy { MixDropExtractor(client) }

override fun getVideoList(url: String, name: String): List<Video> {
return when (name) {
"Okru" -> okruExtractor.videosFromUrl(url)
"Voe" -> voeExtractor.videosFromUrl(url)
"YourUpload" -> youruploadExtractor.videoFromUrl(url, headers)
"MixDrop" -> mixdropExtractor.videosFromUrl(url)
else -> emptyList()
}
}

override val fetchFilters: Boolean
get() = false

override fun setupPreferenceScreen(screen: PreferenceScreen) {
super.setupPreferenceScreen(screen) // Quality preference

val langPref = ListPreference(screen.context).apply {
key = PREF_LANG_KEY
title = PREF_LANG_TITLE
entries = PREF_LANG_ENTRIES
entryValues = PREF_LANG_VALUES
setDefaultValue(PREF_LANG_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(langPref)
}

// ============================= Utilities ==============================

override fun List<Video>.sort(): List<Video> {
val quality = preferences.getString(prefQualityKey, prefQualityDefault)!!
val lang = preferences.getString(PREF_LANG_KEY, PREF_LANG_DEFAULT)!!
return sortedWith(
compareBy(
{ it.quality.contains(lang) },
{ it.quality.contains(quality) },
),
).reversed()
}
Dark25 marked this conversation as resolved.
Show resolved Hide resolved

override val prefQualityValues = arrayOf("480p", "720p", "1080p")
override val prefQualityEntries = prefQualityValues

companion object {
private const val PREF_LANG_KEY = "preferred_lang"
private const val PREF_LANG_TITLE = "Preferred language"
private const val PREF_LANG_DEFAULT = "SUB"
private val PREF_LANG_ENTRIES = arrayOf("SUB", "All", "ES", "LAT")
private val PREF_LANG_VALUES = arrayOf("SUB", "", "ES", "LAT")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class AnimeStreamGenerator : ThemeSourceGenerator {
SingleLang("Animenosub", "https://animenosub.com", "en", isNsfw = true, overrideVersionCode = 3),
SingleLang("AnimeTitans", "https://animetitans.com", "ar", isNsfw = false, overrideVersionCode = 13),
SingleLang("AnimeXin", "https://animexin.vip", "all", isNsfw = false, overrideVersionCode = 7),
SingleLang("AnimeYT.es", "https://animeyt.es", "es", isNsfw = false, className = "AnimeYTES", pkgName = "animeytes"),
SingleLang("Tiodonghua.com", "https://anime.tiodonghua.com", "es", isNsfw = false, className = "Tiodonghua", pkgName = "tiodonghua"),
SingleLang("AsyaAnimeleri", "https://asyaanimeleri.com", "tr", isNsfw = false, overrideVersionCode = 1),
SingleLang("ChineseAnime", "https://chineseanime.top", "all", isNsfw = false, overrideVersionCode = 3),
SingleLang("desu-online", "https://desu-online.pl", "pl", className = "DesuOnline", isNsfw = false, overrideVersionCode = 3),
Expand Down
2 changes: 1 addition & 1 deletion src/es/ennovelas/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext {
extName = 'EnNovelas'
pkgNameSuffix = 'es.ennovelas'
extClass = '.EnNovelas'
extVersionCode = 6
extVersionCode = 7
libVersion = '13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EnNovelas : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override val name = "EnNovelas"

override val baseUrl = "https://f.ennovelas.net"
override val baseUrl = "https://u.ennovelas.net"

override val lang = "es"

Expand All @@ -52,7 +52,7 @@ class EnNovelas : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override fun popularAnimeSelector(): String = ".block-post"

override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/novelas/page/$page")
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/telenovelas/page/$page")

override fun popularAnimeFromElement(element: Element): SAnime {
val anime = SAnime.create()
Expand Down
2 changes: 1 addition & 1 deletion src/pt/animesvision/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ext {
extName = 'AnimesVision'
pkgNameSuffix = 'pt.animesvision'
extClass = '.AnimesVision'
extVersionCode = 21
extVersionCode = 22
jmir1 marked this conversation as resolved.
Show resolved Hide resolved
libVersion = '13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AnimesVision : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override val name = "AnimesVision"

override val baseUrl = "https://animes.vision"
override val baseUrl = "https://tanoshi.digital"
Dark25 marked this conversation as resolved.
Show resolved Hide resolved

override val lang = "pt-BR"

Expand Down