oploverz: skip qualities with parsing errors

closes #189
This commit is contained in:
jmir1
2021-12-14 12:00:56 +01:00
parent 2f3ca1c65a
commit 80c0c22596
2 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Oploverz' extName = 'Oploverz'
pkgNameSuffix = 'id.oploverz' pkgNameSuffix = 'id.oploverz'
extClass = '.Oploverz' extClass = '.Oploverz'
extVersionCode = 5 extVersionCode = 6
libVersion = '12' libVersion = '12'
} }

View File

@ -129,7 +129,9 @@ class Oploverz : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
val patternGoogle = "iframe[src^=https://www.blogger.com/video.g?token=]" val patternGoogle = "iframe[src^=https://www.blogger.com/video.g?token=]"
val iframe = document.select(patternGoogle).firstOrNull() val iframe = document.select(patternGoogle).firstOrNull()
val zippy = document.select(patternZippy).map { zippyFromElement(it) } val zippy = document.select(patternZippy).mapNotNull {
runCatching { zippyFromElement(it) }.getOrNull()
}
val google = if (iframe == null) { mutableListOf() } else try { val google = if (iframe == null) { mutableListOf() } else try {
googleLinkFromElement(iframe) googleLinkFromElement(iframe)
} catch (e: Exception) { mutableListOf() } } catch (e: Exception) { mutableListOf() }
@ -154,6 +156,7 @@ class Oploverz : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
} }
return videoList return videoList
} }
private fun zippyFromElement(element: Element): Video { private fun zippyFromElement(element: Element): Video {
val res = client.newCall(GET(element.attr("href"))).execute().asJsoup() val res = client.newCall(GET(element.attr("href"))).execute().asJsoup()
val scr = res.select("script:containsData(dlbutton)").html() val scr = res.select("script:containsData(dlbutton)").html()
@ -176,6 +179,7 @@ class Oploverz : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
} }
return Video(url, quality, url, null) return Video(url, quality, url, null)
} }
override fun videoListSelector(): String = throw Exception("not used") override fun videoListSelector(): String = throw Exception("not used")
override fun videoUrlParse(document: Document) = throw Exception("not used") override fun videoUrlParse(document: Document) = throw Exception("not used")