Skip to content

Commit

Permalink
fix(en/aniwave): migrate 9anime to aniwave and fix extractors
Browse files Browse the repository at this point in the history
also support soft subs
  • Loading branch information
Samfun75 committed Sep 21, 2023
1 parent 5aee7f6 commit 70fa0dc
Show file tree
Hide file tree
Showing 19 changed files with 237 additions and 303 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/en/nineanime/build.gradle → src/en/aniwave/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'

ext {
extName = '9anime'
extName = 'Aniwave'
pkgNameSuffix = 'en.nineanime'
extClass = '.NineAnime'
extVersionCode = 48
extClass = '.Aniwave'
extVersionCode = 49
libVersion = '13'
}

Expand Down
Binary file added src/en/aniwave/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/aniwave/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/aniwave/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/aniwave/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/aniwave/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/aniwave/res/web_hi_res_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.animeextension.en.nineanime
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList

object NineAnimeFilters {
object AniwaveFilters {
open class QueryPartFilter(
displayName: String,
val vals: Array<Pair<String, String>>,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package eu.kanade.tachiyomi.animeextension.en.nineanime

object JSONUtil {
fun escape(input: String): String {
val output = StringBuilder()
for (i in 0 until input.length) {
val ch = input[i]
val chx = ch.code
assert(chx != 0)
if (ch == '\n') {
output.append("\\n")
} else if (ch == '\t') {
output.append("\\t")
} else if (ch == '\r') {
output.append("\\r")
} else if (ch == '\\') {
output.append("\\\\")
} else if (ch == '"') {
output.append("\\\"")
} else if (ch == '\b') {
output.append("\\b")
} else if (ch == '\u000c') {
output.append("\\u000c")
} else if (chx >= 0x10000) {
assert(false) { "Java stores as u16, so it should never give us a character that's bigger than 2 bytes. It literally can't." }
} else if (chx > 127) {
output.append(String.format("\\u%04x", chx))
} else {
output.append(ch)
}
}
return output.toString()
}

fun unescape(input: String): String {
val builder = StringBuilder()
var i = 0
while (i < input.length) {
val delimiter = input[i]
i++ // consume letter or backslash
if (delimiter == '\\' && i < input.length) {
// consume first after backslash
val ch = input[i]
i++
if (ch == '\\' || ch == '/' || ch == '"' || ch == '\'') {
builder.append(ch)
} else if (ch == 'n') {
builder.append('\n')
} else if (ch == 'r') {
builder.append('\r')
} else if (ch == 't') {
builder.append(
'\t',
)
} else if (ch == 'b') {
builder.append('\b')
} else if (ch == 'f') {
builder.append(
'\u000c',
)
} else if (ch == 'u') {
val hex = StringBuilder()

// expect 4 digits
if (i + 4 > input.length) {
throw RuntimeException("Not enough unicode digits! ")
}
for (x in input.substring(i, i + 4).toCharArray()) {
if (!Character.isLetterOrDigit(x)) {
throw RuntimeException("Bad character in unicode escape.")
}
hex.append(x.lowercaseChar())
}
i += 4 // consume those four digits.
val code = hex.toString().toInt(16)
builder.append(code.toChar())
} else {
throw RuntimeException("Illegal escape sequence: \\$ch")
}
} else { // it's not a backslash, or it's the last character.
builder.append(delimiter)
}
}
return builder.toString()
}
}
Binary file removed src/en/nineanime/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed src/en/nineanime/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed src/en/nineanime/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file removed src/en/nineanime/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file removed src/en/nineanime/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
Binary file removed src/en/nineanime/res/web_hi_res_512.png
Binary file not shown.

This file was deleted.

This file was deleted.

0 comments on commit 70fa0dc

Please sign in to comment.