Update video extraction (#1611)
This commit is contained in:
parent
cc6e071a03
commit
5f31d362be
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'AnimesZone'
|
extName = 'AnimesZone'
|
||||||
pkgNameSuffix = 'pt.animeszone'
|
pkgNameSuffix = 'pt.animeszone'
|
||||||
extClass = '.AnimesZone'
|
extClass = '.AnimesZone'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
containsNsfw = true
|
containsNsfw = true
|
||||||
}
|
}
|
||||||
|
@ -59,10 +59,6 @@ class AnimesZone : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val episodeRegex = Regex("""Episódio ?\d+\.?\d* ?""")
|
private val episodeRegex = Regex("""Episódio ?\d+\.?\d* ?""")
|
||||||
|
|
||||||
private val DateFormatter by lazy {
|
|
||||||
SimpleDateFormat("d MMMM yyyy", Locale.ENGLISH)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================== Popular ===============================
|
// ============================== Popular ===============================
|
||||||
@ -361,6 +357,8 @@ class AnimesZone : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
when {
|
when {
|
||||||
"/bloggerjwplayer" in url ->
|
"/bloggerjwplayer" in url ->
|
||||||
videoList.addAll(BloggerJWPlayerExtractor.videosFromScript(decrypted))
|
videoList.addAll(BloggerJWPlayerExtractor.videosFromScript(decrypted))
|
||||||
|
"jwplayer-2" in url ->
|
||||||
|
videoList.addAll(BloggerJWPlayerExtractor.videosFromScript(decrypted))
|
||||||
"/m3u8" in url ->
|
"/m3u8" in url ->
|
||||||
videoList.addAll(PlaylistExtractor.videosFromScript(decrypted))
|
videoList.addAll(PlaylistExtractor.videosFromScript(decrypted))
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,22 @@ object BloggerJWPlayerExtractor {
|
|||||||
fun videosFromScript(script: String): List<Video> {
|
fun videosFromScript(script: String): List<Video> {
|
||||||
val sources = script.substringAfter("sources: [").substringBefore("],")
|
val sources = script.substringAfter("sources: [").substringBefore("],")
|
||||||
|
|
||||||
return sources.split("{").drop(1).map {
|
return sources.split("{").drop(1).mapNotNull {
|
||||||
val label = it.substringAfter("label").substringAfter(":\"").substringBefore('"')
|
val label = it.substringAfter("label")
|
||||||
|
.substringAfter(":")
|
||||||
|
.substringAfter("\"")
|
||||||
|
.substringBefore('"')
|
||||||
|
|
||||||
val videoUrl = it.substringAfter("file")
|
val videoUrl = it.substringAfter("file")
|
||||||
.substringAfter(":\"")
|
.substringAfter(":")
|
||||||
|
.substringAfter("\"")
|
||||||
.substringBefore('"')
|
.substringBefore('"')
|
||||||
.replace("\\", "")
|
.replace("\\", "")
|
||||||
Video(videoUrl, "BloggerJWPlayer - $label", videoUrl)
|
if (videoUrl.isEmpty()) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
Video(videoUrl, "BloggerJWPlayer - $label", videoUrl)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user