|
|
|
@ -7,12 +7,12 @@ import org.koitharu.kotatsu.parsers.config.ConfigKey
|
|
|
|
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
|
|
|
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
|
|
|
import org.koitharu.kotatsu.parsers.model.*
|
|
|
|
import org.koitharu.kotatsu.parsers.model.*
|
|
|
|
import org.koitharu.kotatsu.parsers.util.*
|
|
|
|
import org.koitharu.kotatsu.parsers.util.*
|
|
|
|
import org.koitharu.kotatsu.parsers.util.json.*
|
|
|
|
import org.koitharu.kotatsu.parsers.util.json.mapJSONToSet
|
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
import java.util.*
|
|
|
|
import java.util.*
|
|
|
|
|
|
|
|
|
|
|
|
@MangaSourceParser("TENSHIMANGA", "Tenshi Manga", "tr")
|
|
|
|
@MangaSourceParser("TENSHIMANGA", "Tenshi Manga", "tr")
|
|
|
|
internal class TenshiManga(context: MangaLoaderContext):
|
|
|
|
internal class TenshiManga(context: MangaLoaderContext) :
|
|
|
|
PagedMangaParser(context, MangaParserSource.TENSHIMANGA, 25) {
|
|
|
|
PagedMangaParser(context, MangaParserSource.TENSHIMANGA, 25) {
|
|
|
|
|
|
|
|
|
|
|
|
override val configKeyDomain = ConfigKey.Domain("tenshimanga.com")
|
|
|
|
override val configKeyDomain = ConfigKey.Domain("tenshimanga.com")
|
|
|
|
@ -104,9 +104,9 @@ internal class TenshiManga(context: MangaLoaderContext):
|
|
|
|
SortOrder.ALPHABETICAL_DESC -> "2"
|
|
|
|
SortOrder.ALPHABETICAL_DESC -> "2"
|
|
|
|
SortOrder.NEWEST -> "3"
|
|
|
|
SortOrder.NEWEST -> "3"
|
|
|
|
SortOrder.POPULARITY -> "4"
|
|
|
|
SortOrder.POPULARITY -> "4"
|
|
|
|
SortOrder.UPDATED, -> "5"
|
|
|
|
SortOrder.UPDATED -> "5"
|
|
|
|
else -> "1"
|
|
|
|
else -> "1"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -154,12 +154,12 @@ internal class TenshiManga(context: MangaLoaderContext):
|
|
|
|
val dateFormat = SimpleDateFormat("MMM d ,yyyy", Locale("tr"))
|
|
|
|
val dateFormat = SimpleDateFormat("MMM d ,yyyy", Locale("tr"))
|
|
|
|
MangaChapter(
|
|
|
|
MangaChapter(
|
|
|
|
id = generateUid(href),
|
|
|
|
id = generateUid(href),
|
|
|
|
title = el.selectFirstOrThrow("h3").text(),
|
|
|
|
title = el.selectFirst("h3")?.textOrNull(),
|
|
|
|
number = (i + 1).toFloat(),
|
|
|
|
number = (i + 1).toFloat(),
|
|
|
|
volume = 0,
|
|
|
|
volume = 0,
|
|
|
|
url = href,
|
|
|
|
url = href,
|
|
|
|
scanlator = null,
|
|
|
|
scanlator = null,
|
|
|
|
uploadDate = el.selectFirst("span")?.text()?.let { dateFormat.tryParse(it) } ?: 0L,
|
|
|
|
uploadDate = dateFormat.parseSafe(el.selectFirst("span")?.text()),
|
|
|
|
branch = null,
|
|
|
|
branch = null,
|
|
|
|
source = source,
|
|
|
|
source = source,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -185,7 +185,8 @@ internal class TenshiManga(context: MangaLoaderContext):
|
|
|
|
|
|
|
|
|
|
|
|
private suspend fun fetchTags(): Set<MangaTag> {
|
|
|
|
private suspend fun fetchTags(): Set<MangaTag> {
|
|
|
|
val doc = webClient.httpGet("https://$domain/search").parseHtml()
|
|
|
|
val doc = webClient.httpGet("https://$domain/search").parseHtml()
|
|
|
|
val script = doc.select("script").find { it.html().contains("self.__next_f.push([1,\"10:[\\\"\\$,\\\"section") }?.html()
|
|
|
|
val script =
|
|
|
|
|
|
|
|
doc.select("script").find { it.html().contains("self.__next_f.push([1,\"10:[\\\"\\$,\\\"section") }?.html()
|
|
|
|
?: return emptySet()
|
|
|
|
?: return emptySet()
|
|
|
|
|
|
|
|
|
|
|
|
val jsonStr = script.substringAfter("\"category\":[")
|
|
|
|
val jsonStr = script.substringAfter("\"category\":[")
|
|
|
|
@ -197,7 +198,7 @@ internal class TenshiManga(context: MangaLoaderContext):
|
|
|
|
MangaTag(
|
|
|
|
MangaTag(
|
|
|
|
key = jo.getString("id"),
|
|
|
|
key = jo.getString("id"),
|
|
|
|
title = jo.getString("name"),
|
|
|
|
title = jo.getString("name"),
|
|
|
|
source = source
|
|
|
|
source = source,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|