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),
|
GET(url, headers = embedHeaders),
|
||||||
).execute().asJsoup()
|
).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>()
|
val scriptData = script.parseAs<ScriptBody>()
|
||||||
|
|
||||||
|
@ -77,14 +77,13 @@ class LycorisCafeExtractor(private val client: OkHttpClient) {
|
||||||
}?: sdLink?.takeIf { it.contains("https://") }?.let {
|
}?: sdLink?.takeIf { it.contains("https://") }?.let {
|
||||||
videos.add(Video(it, "${prefix}lycoris.cafe - 480p", it))
|
videos.add(Video(it, "${prefix}lycoris.cafe - 480p", it))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return videos
|
return videos
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun decodeVideoLinks(encodedUrl: String?): String? {
|
private fun decodeVideoLinks(encodedUrl: String): String? {
|
||||||
if (encodedUrl.isNullOrEmpty()) {
|
if (encodedUrl.isBlank()) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue