fix(lib/lycoris): small changes v4
This commit is contained in:
parent
bc313fa859
commit
b9e9dbb2a9
1 changed files with 21 additions and 22 deletions
|
@ -34,7 +34,7 @@ class LycorisCafeExtractor(private val client: OkHttpClient) {
|
|||
GET(url, headers = embedHeaders),
|
||||
).execute().asJsoup()
|
||||
|
||||
val script = document.select("script[type='application/json']").first()?.data().toString()
|
||||
val script = document.select("script[type='application/json']").first()?.data()?.toString() ?: return emptyList()
|
||||
|
||||
val scriptData = script.parseAs<ScriptBody>()
|
||||
|
||||
|
@ -77,14 +77,13 @@ class LycorisCafeExtractor(private val client: OkHttpClient) {
|
|||
}?: sdLink?.takeIf { it.contains("https://") }?.let {
|
||||
videos.add(Video(it, "${prefix}lycoris.cafe - 480p", it))
|
||||
}
|
||||
|
||||
}
|
||||
return videos
|
||||
|
||||
}
|
||||
|
||||
private fun decodeVideoLinks(encodedUrl: String?): String? {
|
||||
if (encodedUrl.isNullOrEmpty()) {
|
||||
private fun decodeVideoLinks(encodedUrl: String): String? {
|
||||
if (encodedUrl.isBlank()) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue