fix [legionanime] (#1099)

This commit is contained in:
Diego Peña y Lillo
2022-12-21 04:54:16 -04:00
committed by GitHub
parent b375293d79
commit 837c7b741e
2 changed files with 43 additions and 37 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'LegionAnime' extName = 'LegionAnime'
pkgNameSuffix = 'es.legionanime' pkgNameSuffix = 'es.legionanime'
extClass = '.LegionAnime' extClass = '.LegionAnime'
extVersionCode = 5 extVersionCode = 6
libVersion = '13' libVersion = '13'
} }

View File

@ -198,44 +198,50 @@ class LegionAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
} else { } else {
it.jsonObject["name"]!!.jsonPrimitive.content.substringAfter("-").reversed() it.jsonObject["name"]!!.jsonPrimitive.content.substringAfter("-").reversed()
} }
when { try {
url.contains("streamtape") -> { when {
val video = StreamTapeExtractor(client).videoFromUrl(url, server) url.contains("streamtape") -> {
if (video != null) { val video = StreamTapeExtractor(client).videoFromUrl(url, server)
videoList.add(video) if (video != null) {
videoList.add(video)
}
}
(url.contains("fembed") || url.contains("vanfem")) -> {
val newUrl = url.replace("fembed", "embedsito").replace("vanfem", "embedsito")
try {
videoList.addAll(FembedExtractor(client).videosFromUrl(newUrl, server))
} catch (_: Exception) {
}
}
url.contains("sb") -> {
val video = StreamSBExtractor(client).videosFromUrl(url, headers)
videoList.addAll(video)
}
url.contains("jkanime") -> {
videoList.add(JkanimeExtractor(client).getDesuFromUrl(url))
}
url.contains("/stream/amz.php?") -> {
try {
val video = amazonExtractor(url)
if (video.isNotBlank()) {
videoList.add(Video(video, server, video))
}
} catch (_: Exception) {
}
}
url.contains("yourupload") -> {
val headers = headers.newBuilder().add("referer", "https://www.yourupload.com/").build()
videoList.addAll(YourUploadExtractor(client).videoFromUrl(url, headers))
}
url.contains("zippyshare") -> {
val hostUrl = url.substringBefore("/v/")
val videoUrlD = ZippyExtractor().getVideoUrl(url, json)
val videoUrl = hostUrl + videoUrlD
videoList.add(Video(videoUrl, server, videoUrl))
} }
} }
(url.contains("fembed") || url.contains("vanfem")) -> { } catch (_: Exception) {
val newUrl = url.replace("fembed", "embedsito").replace("vanfem", "embedsito") // ignore
try {
videoList.addAll(FembedExtractor(client).videosFromUrl(newUrl, server))
} catch (_: Exception) {}
}
url.contains("sb") -> {
val video = StreamSBExtractor(client).videosFromUrl(url, headers)
videoList.addAll(video)
}
url.contains("jkanime") -> {
videoList.add(JkanimeExtractor(client).getDesuFromUrl(url))
}
url.contains("/stream/amz.php?") -> {
try {
val video = amazonExtractor(url)
if (video.isNotBlank()) {
videoList.add(Video(video, server, video))
}
} catch (_: Exception) {}
}
url.contains("yourupload") -> {
val headers = headers.newBuilder().add("referer", "https://www.yourupload.com/").build()
videoList.addAll(YourUploadExtractor(client).videoFromUrl(url, headers))
}
url.contains("zippyshare") -> {
val hostUrl = url.substringBefore("/v/")
val videoUrlD = ZippyExtractor().getVideoUrl(url, json)
val videoUrl = hostUrl + videoUrlD
videoList.add(Video(videoUrl, server, videoUrl))
}
} }
} }
return videoList return videoList