Fixes and Updates (#1090)

This commit is contained in:
miguelantonioe
2022-12-20 01:07:23 -06:00
committed by GitHub
parent f0442520cb
commit a7c1fe3017
10 changed files with 322 additions and 155 deletions

View File

@ -13,8 +13,7 @@ class FembedExtractor(private val client: OkHttpClient) {
client.newCall(POST(videoApi)).execute().body?.string().orEmpty()
}.getOrNull() ?: return emptyList<Video>()
val jsonResponse = Json { ignoreUnknownKeys = true }
.decodeFromString<FembedResponse>(body)
val jsonResponse = try{ Json { ignoreUnknownKeys = true }.decodeFromString<FembedResponse>(body) } catch (e: Exception) { FembedResponse(false, emptyList()) }
return if (jsonResponse.success) {
jsonResponse.data.map {