en/AniPlay: wrapped extractFromHls in try catch due to unresolved host error
This commit is contained in:
parent
21bf6e1d85
commit
d9ade993e4
1 changed files with 17 additions and 13 deletions
|
@ -256,19 +256,23 @@ class AniPlay : AniListAnimeHttpSource(), ConfigurableAnimeSource {
|
|||
?.map { Track(it.url, it.lang) }
|
||||
?: emptyList()
|
||||
|
||||
playlistUtils.extractFromHls(
|
||||
playlistUrl = defaultSource.url,
|
||||
videoNameGen = { quality ->
|
||||
val serverName = getServerName(episodeData.source)
|
||||
val typeName = when {
|
||||
subtitles.isNotEmpty() -> "SoftSub"
|
||||
else -> getTypeName(episodeData.language)
|
||||
}
|
||||
|
||||
"$serverName - $quality - $typeName"
|
||||
},
|
||||
subtitleList = subtitles,
|
||||
)
|
||||
try {
|
||||
playlistUtils.extractFromHls(
|
||||
playlistUrl = defaultSource.url,
|
||||
videoNameGen = { quality ->
|
||||
val serverName = getServerName(episodeData.source)
|
||||
val typeName = when {
|
||||
subtitles.isNotEmpty() -> "SoftSub"
|
||||
else -> getTypeName(episodeData.language)
|
||||
}
|
||||
"$serverName - $quality - $typeName"
|
||||
},
|
||||
subtitleList = subtitles,
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Log.e("AniPlay", "extractFromHls Error: $e")
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
return videos.sort()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue