Fix Mangadex Login, Fix Mangadex tracking, Set Mangadex track status to Reading on tracked
This commit is contained in:
@@ -31,6 +31,7 @@ class MdUtil {
|
||||
const val apiChapterSuffix = "?mark_read=0"
|
||||
const val groupSearchUrl = "$baseUrl/groups/0/1/"
|
||||
const val followsAllApi = "/v2/user/me/followed-manga"
|
||||
const val isLoggedInApi = "/v2/user/me"
|
||||
const val followsMangaApi = "/v2/user/me/manga/"
|
||||
const val apiCovers = "/covers"
|
||||
const val reportUrl = "https://api.mangadex.network/report"
|
||||
@@ -51,10 +52,16 @@ class MdUtil {
|
||||
val englishDescriptionTags = listOf(
|
||||
"[b][u]English:",
|
||||
"[b][u]English",
|
||||
"English:",
|
||||
"English :",
|
||||
"[English]:",
|
||||
"English Translaton:",
|
||||
"[B][ENG][/B]"
|
||||
)
|
||||
|
||||
val bbCodeToRemove = listOf(
|
||||
"list", "*", "hr", "u", "b", "i", "s", "center", "spoiler="
|
||||
)
|
||||
val descriptionLanguages = listOf(
|
||||
"=FRANCAIS=",
|
||||
"[b] Spanish: [/ b]",
|
||||
@@ -78,19 +85,23 @@ class MdUtil {
|
||||
"\r\n\r\nItalian\r\n",
|
||||
"Arabic /",
|
||||
"Descriptions in Other Languages",
|
||||
"Español /",
|
||||
"Español:",
|
||||
"Espanol",
|
||||
"[Españ",
|
||||
"Españ",
|
||||
"Farsi/",
|
||||
"Français",
|
||||
"French - ",
|
||||
"Francois",
|
||||
"French:",
|
||||
"French/",
|
||||
"French /",
|
||||
"German/",
|
||||
"German /",
|
||||
"Hindi /",
|
||||
"Bahasa Indonesia",
|
||||
"Indonesia:",
|
||||
"Indonesian:",
|
||||
"Indonesian :",
|
||||
"Indo:",
|
||||
"[u]Indonesian",
|
||||
"Italian / ",
|
||||
@@ -98,9 +109,16 @@ class MdUtil {
|
||||
"Italian/",
|
||||
"Italiano",
|
||||
"Italian:",
|
||||
"Italian summary:",
|
||||
"Japanese /",
|
||||
"Original Japanese",
|
||||
"Official Japanese Translation",
|
||||
"Official Chinese Translation",
|
||||
"Official French Translation",
|
||||
"Official Indonesian Translation",
|
||||
"Links:",
|
||||
"Pasta-Pizza-Mandolino/Italiano",
|
||||
"Persian/فارسی",
|
||||
"Persian /فارسی",
|
||||
"Polish /",
|
||||
"Polish Summary /",
|
||||
@@ -108,6 +126,8 @@ class MdUtil {
|
||||
"Polski",
|
||||
"Português",
|
||||
"Portuguese (BR)",
|
||||
"PT/BR:",
|
||||
"Pt/Br:",
|
||||
"Pt-Br:",
|
||||
"Portuguese /",
|
||||
"[right]",
|
||||
@@ -115,6 +135,8 @@ class MdUtil {
|
||||
"Résume Français",
|
||||
"RÉSUMÉ FRANCAIS :",
|
||||
"RUS:",
|
||||
"Ru/Pyc",
|
||||
"\\r\\nRUS\\r\\n",
|
||||
"Russia/",
|
||||
"Russian /",
|
||||
"Spanish:",
|
||||
@@ -162,23 +184,22 @@ class MdUtil {
|
||||
fun removeTimeParamUrl(url: String): String = url.substringBeforeLast("?")
|
||||
|
||||
fun cleanString(string: String): String {
|
||||
var cleanedString = string
|
||||
|
||||
bbCodeToRemove.forEach {
|
||||
cleanedString = cleanedString.replace("[$it]", "", true)
|
||||
.replace("[/$it]", "", true)
|
||||
}
|
||||
|
||||
val bbRegex =
|
||||
"""\[(\w+)[^]]*](.*?)\[/\1]""".toRegex()
|
||||
var intermediate = string
|
||||
.replace("[list]", "", true)
|
||||
.replace("[/list]", "", true)
|
||||
.replace("[*]", "")
|
||||
.replace("[hr]", "", true)
|
||||
.replace("[u]", "", true)
|
||||
.replace("[/u]", "", true)
|
||||
.replace("[b]", "", true)
|
||||
.replace("[/b]", "", true)
|
||||
|
||||
// Recursively remove nested bbcode
|
||||
while (bbRegex.containsMatchIn(intermediate)) {
|
||||
intermediate = intermediate.replace(bbRegex, "$2")
|
||||
while (bbRegex.containsMatchIn(cleanedString)) {
|
||||
cleanedString = cleanedString.replace(bbRegex, "$2")
|
||||
}
|
||||
return Parser.unescapeEntities(intermediate, false)
|
||||
|
||||
return Parser.unescapeEntities(cleanedString, false)
|
||||
}
|
||||
|
||||
fun cleanDescription(string: String): String {
|
||||
|
||||
Reference in New Issue
Block a user