wcostream - parsing qualities from m3u8

This commit is contained in:
Arjix 2021-09-26 23:22:42 +03:00 committed by GitHub
parent f56b6c168d
commit ce844d5068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,16 +41,31 @@ class WcoStream : ExtractorApi() {
if (mapped.success) {
mapped.media.sources.forEach {
sources.add(
ExtractorLink(
name,
name + if (it.label != null) "- ${it.label}" else "",
it.file,
"",
Qualities.P720.value,
it.file.contains(".m3u8")
if (it.file.contains("m3u8")) {
hlsHelper.m3u8Generation(M3u8Helper.M3u8Stream(it.file, null)).forEach { stream ->
sources.add(
ExtractorLink(
name,
name + if (stream.quality != null) " - ${stream.quality}" else "",
stream.streamUrl,
"",
getQualityFromName(stream.quality.toString()),
true
)
)
}
} else {
sources.add(
ExtractorLink(
name,
name + if (it.label != null) " - ${it.label}" else "",
it.file,
"",
Qualities.P720.value,
false
)
)
)
}
}
}
return sources