-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(en/aniwave): migrate 9anime to aniwave and fix extractors
also support soft subs
- Loading branch information
Showing
19 changed files
with
237 additions
and
303 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
255 changes: 147 additions & 108 deletions
255
.../animeextension/en/nineanime/NineAnime.kt → ...mi/animeextension/en/nineanime/Aniwave.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/en/aniwave/src/eu/kanade/tachiyomi/animeextension/en/nineanime/JSONUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
88 changes: 0 additions & 88 deletions
88
src/en/nineanime/src/eu/kanade/tachiyomi/animeextension/en/nineanime/JSONUtil.java
This file was deleted.
Oops, something went wrong.
103 changes: 0 additions & 103 deletions
103
src/en/nineanime/src/eu/kanade/tachiyomi/animeextension/en/nineanime/JsInterceptor.kt
This file was deleted.
Oops, something went wrong.