fix(en/Aniplay): new server, fixed dub with subtitles showing as softsub, latest fixes #628

Merged
JosefFStraka merged 4 commits from aniplay into main 2025-02-06 14:43:30 -06:00
3 changed files with 34 additions and 14 deletions

View file

@ -2,7 +2,7 @@ ext {
extName = 'AniPlay'
extClass = '.AniPlay'
themePkg = 'anilist'
overrideVersionCode = 9
overrideVersionCode = 10
}
apply from: "$rootDir/common.gradle"

View file

@ -270,13 +270,29 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
?.map { Track(it.url ?: throw Exception("episodeData.response.subtitles.url is null ($it)"), it.lang ?: "Unk") }
?: emptyList()
val serverName = getServerName(episodeData.source)
val typeName = when {
subtitles.isNotEmpty() -> "SoftSub"
else -> getTypeName(episodeData.language)
var serverName = getServerName(episodeData.source)
if (serverName == SERVER_UNKNOWN) {
serverName = episodeData.source.substring(0, 69) + "!"
}
var typeName = getTypeName(episodeData.language)
if (typeName == "Sub" && subtitles.isNotEmpty()) {
typeName = "SoftSub"
} else if (serverName == "Yuki" && typeName == "Dub" && subtitles.isNotEmpty()) {
typeName = "Dubtitles"
}
try {
if (episodeData.response.proxy == true) {
mklive commented 2025-02-07 05:41:11 -06:00 (Migrated from github.com)

Typo?

Typo?
JosefFStraka commented 2025-02-27 13:53:44 -06:00 (Migrated from github.com)

Sorry missed this comment.
What seems to be the issue?
Yuki sometimes provides subtitles to dubbed episodes. Searched online and people call it dubtitles.
Not the best implementation but I think other providers sometimes provided nonworking subtitles or gibberish...

Sorry missed this comment. What seems to be the issue? Yuki sometimes provides subtitles to dubbed episodes. Searched online and people call it dubtitles. Not the best implementation but I think other providers sometimes provided nonworking subtitles or gibberish...
mklive commented 2025-02-28 04:36:51 -06:00 (Migrated from github.com)

I wasn't aware of that 👍

I wasn't aware of that 👍
var proxyUrl = "$PROXY_URL/fetch?url=${defaultSource.url}"
if (episodeData.response.headers != null && episodeData.response.headers.Referer?.startsWith("https://") == true) {
proxyUrl += "&ref=${episodeData.response.headers.Referer}"
}
return playlistUtils.extractFromHls(
playlistUrl = proxyUrl,
videoNameGen = { quality -> "$serverName - $quality - $typeName" },
subtitleList = subtitles,
)
}
if (episodeData.response.headers != null && episodeData.response.headers.Referer?.startsWith("https://") == true) {
return playlistUtils.extractFromHls(
playlistUrl = defaultSource.url,
@ -451,7 +467,7 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
private fun getServerName(value: String): String {
val index = PREF_SERVER_ENTRY_VALUES.indexOf(value)
if (index == -1) {
return "Other"
return SERVER_UNKNOWN
}
return PREF_SERVER_ENTRIES[index]
}
@ -459,7 +475,7 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
private fun getTypeName(value: String): String {
val index = PREF_TYPE_ENTRY_VALUES.indexOf(value.lowercase())
if (index == -1) {
return "Other"
return TYPE_UNKNOWN
}
return PREF_TYPE_ENTRIES[index]
}
@ -477,14 +493,15 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
companion object {
private const val PREF_DOMAIN_KEY = "domain"
private val PREF_DOMAIN_ENTRIES = arrayOf("aniplaynow.live (default)", "aniplay.lol (backup)")
private val PREF_DOMAIN_ENTRIES = arrayOf("aniplaynow.live (default)", "aniplay.lol (backup/experimental)")
private val PREF_DOMAIN_ENTRY_VALUES = arrayOf("aniplaynow.live", "aniplay.lol")
private const val PREF_DOMAIN_DEFAULT = "aniplaynow.live"
private const val PREF_SERVER_KEY = "server"
private val PREF_SERVER_ENTRIES = arrayOf("Kuro", "Anya", "Yuki", "Pahe")
private val PREF_SERVER_ENTRY_VALUES = arrayOf("kuro", "anya", "yuki", "pahe")
private const val PREF_SERVER_DEFAULT = "kuro"
private val PREF_SERVER_ENTRIES = arrayOf("Maze", "Yuki", "Pahe", "Kuro")
private val PREF_SERVER_ENTRY_VALUES = arrayOf("maze", "yuki", "pahe", "kuro")
private const val PREF_SERVER_DEFAULT = "yuki"
private const val SERVER_UNKNOWN = "Other"
private const val PREF_QUALITY_KEY = "quality"
private val PREF_QUALITY_ENTRIES = arrayOf("1080p", "720p", "480p", "360p")
@ -492,9 +509,10 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
private const val PREF_QUALITY_DEFAULT = "1080"
private const val PREF_TYPE_KEY = "type"
private val PREF_TYPE_ENTRIES = arrayOf("Sub", "SoftSub", "Dub")
private val PREF_TYPE_ENTRY_VALUES = arrayOf("sub", "softsub", "dub")
private const val PREF_TYPE_DEFAULT = "sub"
private val PREF_TYPE_ENTRIES = arrayOf("Sub", "SoftSub", "Dub", "Dubtitles")
private val PREF_TYPE_ENTRY_VALUES = arrayOf("sub", "softsub", "dub", "dubtitles")
private const val PREF_TYPE_DEFAULT = "softsub"
private const val TYPE_UNKNOWN = "Other"
private const val PREF_TITLE_LANGUAGE_KEY = "title_language"
private val PREF_TITLE_LANGUAGE_ENTRIES = arrayOf("Romaji", "English", "Native")
@ -518,6 +536,7 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
"NEXT_ACTION_SOURCES_LIST" to "8a76af451978c817dde2364326a5e4e45eb43db1",
),
)
private const val PROXY_URL = "https://aniplay-cors.yqizw7.easypanel.host"
private val DATE_FORMATTER = SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
}

View file

@ -37,6 +37,7 @@ data class VideoSourceResponse(
val outro: Timestamp?,
val subtitles: List<Subtitle>?,
val headers: Headers?,
val proxy: Boolean?,
) {
@Serializable
data class Source(